Compare commits

...

79 Commits

Author SHA1 Message Date
Michael Hudson-Doyle
fdbc3cc77e releasing package livecd-rootfs version 2.208.18 2019-12-06 14:03:30 +13:00
Michael Hudson-Doyle
6d35da08a4 add bug to changelog 2019-12-06 13:08:42 +13:00
Michael Hudson-Doyle
bc0edf358d Preserve ubuntu-advantage-tools' apt preferences against live-build's attempt to delete them. 2019-12-06 11:38:47 +13:00
Steve Langasek
3a3e0defbd releasing package livecd-rootfs version 2.208.17 2019-04-08 11:17:37 -07:00
Steve Langasek
d2b34d4930 Also don't create the update-motd directory since we're not writing to it.
It will almost certainly be created at some point but we don't need to
create it here.
2019-04-08 11:17:37 -07:00
Steve Langasek
7583c4f0b9 Drop /etc/update-motd.d/51-cloudguest from cloud images; this is not consistent with current Ubuntu Advantage product language. Any future customizations to update-motd for cloud images should be done via a package instead. 2019-04-08 11:17:35 -07:00
Łukasz 'sil2100' Zemczak
b1c7871ba0 releasing package livecd-rootfs version 2.208.16 2019-03-04 15:38:46 +01:00
Łukasz 'sil2100' Zemczak
67080c730a Enable universe for omap and omap4. 2019-03-04 15:38:13 +01:00
Balint Reczey
497cc73baa debian/control: Update Vcs-*: URLs 2018-12-12 16:25:54 +01:00
Michael Hudson-Doyle
b2baa6770f releasing package livecd-rootfs version 2.208.15 2017-10-31 10:33:19 +13:00
Michael Hudson-Doyle
e16e65e98e Merge lp:~mwhudson/livecd-rootfs/bug-1711735
Fix security mirror sources.list entries for non-x86 architectures by
backporting trunk revision 1408. (LP: #1711735)
2017-10-31 10:32:33 +13:00
Michael Hudson-Doyle
20bb43c3f3 Fix security mirror sources.list entries for non-x86 architectures by
backporting trunk revision 1408. (LP: #1711735)
2017-10-30 13:21:41 +13:00
Steve Langasek
c7bb8a60c5 Changelog fixup for missing SRU bug ref 2017-06-06 22:18:48 -07:00
Mathieu Trudel-Lapierre
6a0f5b1e41 releasing package livecd-rootfs version 2.208.14 2017-06-01 16:30:26 -04:00
Mathieu Trudel-Lapierre
3468b592b8 * Add ubuntu-cpc project (LP: #1693018)
* Move building of all architecture-specific CPC artifacts into Launchpad
    - Fixup virtual FLAVOUR kernel name
  * added additional CPC build targets:
    - added manifest generation for squashfs and root.tar.gz
    - added VMDK generation
    - added OVA generation from VMDK's
    - added generic Vagrant image generation
  * Fix typo in ubuntu-cpc preventing non-intel builds.
  * add devpts-live to hook builds
  * add logic to settle the disks after UEFI builds
  * extended hooks/functions to support creation of derivative images
  * including mounting images.
  * added the ability to create qcow2 images in hooks/functions
  * simplified loop clean-up in hooks/functions
  * removed assumption that disk1.img would be built
  * switched qcow2 generation to use hooks/functions function
  * Produce OVA files for i386 cloud builds.
  * Remove unneeded packages from the root.tar.{gz,xz} cloud image targets
  * Install grub in ppc64el cloud images so they are bootable
  * Set timeout options so ppc64el cloud images don't display a grub boot
    menu (matching the behaviour of other cloud images).
  * Specify a regex to run-parts so that cloud image extra scripts are found
    and executed.
  * Refactor/reorder ubuntu-cpc support for consistency with other flavors,
    so that subarch overrides can be applied correctly.
  * fixed loop setup due to change of kpartx output
  * only use grub-install logic for Intel architectures
  * Refactor some non-idiomatic architecture handling in
    live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot that also misidentifies
    the architecture name for armhf.
  * Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it
    at the end.  This is a general-purpose change that should be applied to
    all flavors and archs, but at the moment it's only needed on armhf+raspi2
    to work around the raspberrypi2-firmware postinst calling sync, which is
    actually warranted in the normal case.
  * If a subarch is specified for a cloud image build, don't build rootfs
    artifacts; these should come from the 'generic' build.
  * Fix architecture handling in hooks.  We know we're always being invoked
    from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
    environment, because auto/config and auto/build both rely on this.  So
    don't scatter dpkg --print-architecture calls throughout, especially
    when many of these are not cross-build-aware.
  * Refactor ubuntu-cpc hooks to allow us to handle images where the root
    partition should not be partition 1.
  * ubuntu-cpc: fix hooks/032-disk-image.binary call to
    create_empty_partition, which requires five args due to "-u"
  * ubuntu-cpc: in hooks/030-root-tarball.binary create /lib/modules to fix
  * Refactor ubuntu-cpc hooks to always produce a 'plain' rootfs via
    live-build and reuse this for the tarball, instead of lb_binary_rootfs
    creating some artifact that we ignore / throw away.
  * Initial support for raspi2 subarch.
  * Import live-build/ubuntu-cpc/hooks/raspi2/mkknlimg from
    https://github.com/raspberrypi/linux/blob/rpi-4.1.y/scripts/mkknlimg
    and use it to install a bootable uboot.bin.
  * live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot: Add fake_cloud_init
    function to create a nocloud data source for cloud images that aren't
    meant to be used on real clouds and use it by default on armhf+raspi2
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: add serial device for
    Vagrant images
  * Refactor ubuntu-cpc hooks to hard-code producing an 'ext4' rootfs, which
    is used outside of the livecd-rootfs build process (specifically for EC2
    publication).
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: scope serial device for
    Virtualbox only.
  * Enable building of powerpc cloud images.
  * Fixes for vagrant box builder in ubuntu-cpc
    - Install virtualbox-guest-utils
    - Don't disable default synced folder
    - Don't set vm name
    - Add cloud-init config to manage /etc/hosts
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
    so that the teardown is done properly /before/ we try to make an
    image from our filesystem, since otherwise /etc/resolv.conf is broken.
  * Don't overwrite the default sources.list in cloud images.
  * Replace sources.list generated using COMPONENTS with the sources.list from
    an Ubuntu Server installation (i.e. with all components enabled, and all
    deb-src lines commented).
  * Fix the manifest generation in OVA files so that ovf files don't have
    double extensions.
  * Fix the OVF's metadata to include Ubuntu specific identifiers and
    descriptions instead of the generic Linux ones.
  * Add replace_grub_root_with_label function thereby consolidating multiple
    uses of the same calls to sed.
  * ubuntu-cpc: Remove redundant copy of grub files.
  * Add `apt-get update` to ubuntu-cpc ppc64el builds so they use the new
    sources.
2017-06-01 16:30:07 -04:00
Robert C Jennings
1343885b3d Add changelog entry for mapping of virual flavor to generic kernel 2017-06-01 14:32:08 -05:00
Robert C Jennings
54fd57be7b Remove old bug references from backport 2017-06-01 14:22:08 -05:00
Robert C Jennings
4d4a0b11db Coalesce changelog for ubuntu-cpc commits (LP: #1693018) 2017-05-25 20:40:57 -05:00
Robert C Jennings
5fed3097d2 ubuntu-cpc: Add apt-get update to ppc64el build so it uses new sources 2017-05-25 20:35:31 -05:00
Robert C Jennings
f0b2591de5 ubuntu-cpc: apt sources.list fixes, OVA manifest fixes
[ Daniel Watkins ]
  * Don't overwrite the default sources.list in cloud images.
  * Replace sources.list generated using COMPONENTS with the sources.list from
    an Ubuntu Server installation (i.e. with all components enabled, and all
    deb-src lines commented).  LP: #1513529.
  [ Chris Glass ]
  * Fix the manifest generation in OVA files so that ovf files don't have
    double extensions.  (LP: #1627931)
  * Fix the OVF's metadata to include Ubuntu specific identifiers and
    descriptions instead of the generic Linux ones.  (LP: #1656293)
  [ Daniel Watkins ]
  * Add replace_grub_root_with_label function thereby consolidating multiple
    uses of the same calls to sed.
  [ Robert C Jennings ]
  * ubuntu-cpc: Remove redundant copy of grub files. (LP: #1637290)
2017-05-25 20:35:31 -05:00
Robert C Jennings
f83f97bc8b ubuntu-cpc: Fix unmount handling (LP: #1621393)
[Steve Langasek]
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
    so that the teardown is done properly /before/ we try to make an
    image from our filesystem, since otherwise /etc/resolv.conf is broken.
    LP: #1621393.
2017-05-25 20:35:30 -05:00
Robert C Jennings
d94c09e109 ubuntu-cpc: Fixes for vagrant box builder (LP: #1565985)
[ Louis Zuckerman ]
  * Fixes for vagrant box builder in ubuntu-cpc LP: #1565985
    - Install virtualbox-guest-utils
    - Don't disable default synced folder
    - Don't set vm name
    - Add cloud-init config to manage /etc/hosts LP: #1561250
2017-05-25 20:35:29 -05:00
Robert C Jennings
bfcc963d8b ubuntu-cpc: Enable building of powerpc cloud images. 2017-05-25 20:35:29 -05:00
Robert C Jennings
b0453f87e8 ubuntu-cpc: Vagrant config for serial device must be scoped for Virtualbox only
[ Ben Howard ]
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: scope serial device for
    Virtualbox only.
2017-05-25 20:35:28 -05:00
Robert C Jennings
2229a1a754 ubuntu-cpc: Add serial device in Vagrant images and refactor ext4 rootfs
[ Ben Howard ]
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: add serial device for
    Vagrant images (LP: #1546108).
  [ Daniel Watkins ]
  * Refactor ubuntu-cpc hooks to hard-code producing an 'ext4' rootfs, which
    is used outside of the livecd-rootfs build process (specifically for EC2
    publication).
2017-05-25 20:35:28 -05:00
Robert C Jennings
02340e2480 ubuntu-cpc: nocloud data source for non-cloud cloud images (armhf+raspi2) 2017-05-25 20:35:27 -05:00
Robert C Jennings
742985bb4d Clean/refactor to add raspi2, plus ubuntu-cpc fixes
[ Steve Langasek ]
  * Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it
    at the end.  This is a general-purpose change that should be applied to
    all flavors and archs, but at the moment it's only needed on armhf+raspi2
    to work around the raspberrypi2-firmware postinst calling sync, which is
    actually warranted in the normal case.
  * If a subarch is specified for a cloud image build, don't build rootfs
    artifacts; these should come from the 'generic' build.
  * Fix architecture handling in hooks.  We know we're always being invoked
    from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
    environment, because auto/config and auto/build both rely on this.  So
    don't scatter dpkg --print-architecture calls throughout, especially
    when many of these are not cross-build-aware.
  * Refactor ubuntu-cpc hooks to allow us to handle images where the root
    partition should not be partition 1.

  [ Ben Howard ]
  * ubuntu-cpc: fix hooks/032-disk-image.binary call to
    create_empty_partition, which requires five args due to "-u"
  * ubuntu-cpc: in hooks/030-root-tarball.binary create /lib/modules to fix
    (LP: 1543204).

  [ Steve Langasek ]
  * Refactor ubuntu-cpc hooks to always produce a 'plain' rootfs via
    live-build and reuse this for the tarball, instead of lb_binary_rootfs
    creating some artifact that we ignore / throw away.
  * Initial support for raspi2 subarch.
  * Import live-build/ubuntu-cpc/hooks/raspi2/mkknlimg from
    https://github.com/raspberrypi/linux/blob/rpi-4.1.y/scripts/mkknlimg
    and use it to install a bootable uboot.bin.
2017-05-25 20:35:26 -05:00
Robert C Jennings
cb8ede888f ubuntu-cpc: Refactor arch handling to fix armhf
[ Steve Langasek ]
  * Refactor some non-idiomatic architecture handling in
    live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot that also misidentifies
    the architecture name for armhf.
2017-05-25 20:35:26 -05:00
Robert C Jennings
4a65c41a5e ubuntu-cpc: Mask blkid failure in mount_image
On trusty parted does not create the FS based on the type passed to it.
As a result, calling mount_image for a newly created image will not have
an FS on the root partition.  Calling blkid in mount_image to provide
additional debug output will fail when the root partition has no FS.
The root FS is created after mount_image is called in the hook that
creates the base.ext4 image.  We can ignore the blkid failure as it is
used for debug output; the base image will not have output but derivative
images already have a formatted partition and we'll have handy info.
2017-05-25 20:35:25 -05:00
Robert C Jennings
9cf7b2278f ubuntu-cpc: Refactor for consistency & fix grub-install logic
[ Steve Langasek ]
  * Refactor/reorder ubuntu-cpc support for consistency with other flavors,
    so that subarch overrides can be applied correctly.
  [ Ben Howard ]
  * ubuntu-cpc:
    - fixed loop setup due to change of kpartx output
    - only use grub-install logic for Intel architectures
2017-05-25 20:35:24 -05:00
Robert C Jennings
3bab687119 ubuntu-cpc: Fix ppc64el grub timeout. Also run extras correctly.
* Set timeout options so ppc64el cloud images don't display a grub boot
    menu (matching the behaviour of other cloud images).
  * Specify a regex to run-parts so that cloud image extra scripts are found
    and executed.
2017-05-25 20:35:24 -05:00
Robert C Jennings
009aca99d8 ubuntu-cpc: Install grub in ppc64el images so they are bootable (LP: #1538610) 2017-05-25 20:35:23 -05:00
Robert C Jennings
fd9a4dc0ba ubuntu-cpc: Remove unneeded packages from the root.tar.{gz,xz} (LP: #1534764) 2017-05-25 20:35:22 -05:00
Robert C Jennings
d870400851 ubuntu-cpc: Produce OVA files for i386 cloud builds 2017-05-25 20:35:22 -05:00
Robert C Jennings
65bb92f3a6 ubunutu-cpc: Improvements for derivative image creation
* ubunutu-cpc:
    - extended hooks/functions to support creation of derivative images
      including mounting images.
    - added the ability to create qcow2 images in hooks/functions
    - simplified loop clean-up in hooks/functions
    - removed assumption that disk1.img would be built
    - switched qcow2 generation to use hooks/functions function
2017-05-25 20:35:21 -05:00
Robert C Jennings
004ee17e1f ubuntu-cpc: Add /dev/pts to hook env, also settle disks after UEFI builds 2017-05-25 20:35:20 -05:00
Robert C Jennings
323da962e5 Fix typo in ubuntu-cpc preventing non-intel builds 2017-05-25 20:35:19 -05:00
Robert C Jennings
f433184416 Added additional CPC build targets
- added manifest generation for squashfs and root.tar.gz
    - added VMDK generation
    - added OVA generation from VMDK's
2017-05-25 20:35:17 -05:00
Robert C Jennings
38c87ca9af Move building of all architecture-specific CPC artifacts into Launchpad (LP: #1513754) 2017-05-25 20:35:16 -05:00
Robert C Jennings
8a36dbc115 Add the ubuntu-cpc project base (LP: #1693018) 2017-05-25 20:35:15 -05:00
Steve Langasek
09b81abf36 Merge lp:~rbalint/livecd-rootfs/livecd-rootfs-autopkgtest-fix-for-trusty 2017-05-12 11:41:39 -07:00
Balint Reczey
85b7e46d59 Update changelog 2017-05-12 10:54:21 +02:00
Steve Langasek
b94b8db726 Mark autopkgtests isolation-machine since debootstrap won't work in a
container.
2017-05-12 10:10:31 +02:00
Balint Reczey
1ceefdadae Add basic autopkgtest 2017-05-12 10:10:28 +02:00
Adam Conrad
4d871ff2d9 live-build/auto/config: Switch HWE from wily to xenial (LP: #1568918) 2016-07-25 14:31:30 -06:00
Steve Langasek
4970f16940 Rename old ubuntu-core tarballs to ubuntu-base, for consistency with
the changes already made to yakkety and the ubuntu-cdimage project.
LP: #1579950.
2016-05-09 17:04:55 -07:00
Adam Conrad
6376e6128a Only install thermald on amd64|i386 on lubuntu, fixing PPC build. 2016-01-16 01:25:54 -07:00
Adam Conrad
1e66c5afaa live-build/auto/config: Switch HWE from lts-vivid to lts-wily. 2016-01-15 19:19:58 -07:00
Adam Conrad
9f2446f0cd Switch from lts-vivid to lts-wily HWE kernels (LP: #1524366) 2016-01-15 19:17:40 -07:00
Adam Conrad
b47a6a73c2 * Add xserver-xorg-core-lts-vivid to X HWE hints for the resolver.
* Add libwayland-egl1-mesa-lts-vivid to X HWE hints (LP: #1479524)
* Add kde-window-manager to kubuntu hints to fix a resolver issue.
* Add thermald to lubuntu hints to work around lack of recommends.
2015-07-30 07:05:38 -06:00
Adam Conrad
06fd13d6a2 * live-build/auto/config: Switch HWE from lts-utopic to lts-vivid.
* Remove obsolete libegl1-mesa-drivers-lts-* from HWE_X_PACKAGES.
2015-06-22 18:32:04 -06:00
Adam Conrad
91df73cd18 Add audacious-plugins to LUBUNTU_HWE_HINTS to unsnag the PPC build. 2015-02-18 12:54:24 -07:00
Adam Conrad
0c09cb18b9 Release 2.208.5 2015-02-17 16:23:58 -07:00
Adam Conrad
35d37567e1 Remove xscreensaver-data and xscreensaver with XUBUNTU_HWE_HINTS. 2015-02-17 14:53:49 -07:00
Adam Conrad
912a490c96 * Rename XUBUNTU_HWE_HINTS to XFCE_HWE_HINTS, so it's more reusable
and have MYTHBUNTU, XUBUNTU, and UBUNTUSTUDIO all make use of it.
* Explicitly seed the correct notify option for every last flavour.
2015-02-17 14:14:44 -07:00
Adam Conrad
e100f3a610 Explicitly install the xserver-xorg-input-all-lts-utopic package 2015-02-17 13:58:35 -07:00
Adam Conrad
ca3279cc45 Release 2.208.4 2015-02-17 12:09:46 -07:00
Adam Conrad
763dda686f Add gnome-terminal to UNITY_HWE_HINTS for universe flavours that get xvt by accident 2015-02-17 07:43:26 -07:00
Adam Conrad
31fea13a91 Also reuse XUBUNTU_HWE_HINTS for UBUNTUSTUDIO_HWE_HINTS with tweaks 2015-02-17 07:27:36 -07:00
Adam Conrad
b283e3f938 Reuse XUBUNTU_HWE_HINTS for MYTHBUNTU_HWE_HINTS and add some tweaks 2015-02-17 07:00:39 -07:00
Adam Conrad
540536a920 * Add UBUNTUGNOME_HWE_HINTS and populate it skip using unity packages
* Add LUBUNTU_HWE_HINTS and populate to work around task->meta change
2015-02-17 06:32:53 -07:00
Adam Conrad
efe0af3b68 Revert lubuntu to using tasks for minimal and standard, since their
unique snowflake apt --no-install-recommends setup breaks switching
2015-02-14 01:43:58 -07:00
Adam Conrad
1b70734c2f Add XUBUNTU_HWE_HINTS and populate to work around task->meta change 2015-02-14 01:06:32 -07:00
Adam Conrad
97273b7c56 One more hint to get webkit and zenity off the kubuntu image 2015-02-14 00:30:39 -07:00
Adam Conrad
d5e4b69cdb * Use the correct metapackage for edubuntu-desktop, and add HWE_HINTS
* Add KUBUNTU_HWE_HINTS and populate to work around task->meta change
2015-02-14 00:08:24 -07:00
Adam Conrad
93012bbfc6 Hint pinentry-qt4 for kubuntu-desktop to avoid GNOME deps. 2015-02-04 04:44:36 -07:00
Adam Conrad
6faa717bf7 Use the correct metapackage for edubuntu-desktop 2015-02-04 04:43:37 -07:00
Adam Conrad
7b9f251999 Pull xserver-xorg-video-geode-lts-utopic out of the i386 images. 2015-02-03 07:04:58 -07:00
Adam Conrad
0fbb4d5a11 Release 2.208.2 2015-02-03 01:45:49 -07:00
Adam Conrad
6770013ca3 Add unity to the UNITY_HWE hints 2015-02-03 00:13:38 -07:00
Adam Conrad
3670bc958b Define UNITY_HWE_HINTS to hint correct alternative package selections. 2015-02-02 08:26:50 -07:00
Adam Conrad
638fa1b0b9 Yet another lts-foo FLAVOUR cut 2015-02-02 06:21:03 -07:00
Adam Conrad
90df19ceae Before trying to copy kernels around, cut -lts* off the end of FLAVOUR,
since the actual files on disk are -generic, not -generic-lts-utopic.
2015-02-02 05:40:00 -07:00
Adam Conrad
3528438c85 * Abstract the signed kernel image, so it's only defined in one spot.
* Define HWE_X_PACKAGES required to install lts-utopic and use it.
2015-02-02 02:43:19 -07:00
Adam Conrad
2c6347c6f1 Move from task-based installs to package-based installs, and switch
to using the lts-utopic HWE kernel and X stack for all flavours.
2015-02-02 01:44:19 -07:00
Colin Watson
1bbd4778e0 If EXTRA_PPAS is set in the environment (as a space-separated sequence
of <ppa-owner>/<ppa-name> pairs), fetch signing keys for those from
Launchpad using python3-software-properties, and add those PPAs when
building the live filesystem.  This makes it easier for a builder to
build an image against an additional PPA (LP: #1334374).
2014-06-26 12:43:29 +01:00
Colin Watson
a546c6d7a6 releasing package livecd-rootfs version 2.208.1 2014-06-24 14:53:40 +01:00
Colin Watson
4fc5871ffe Filter out kernel packages that mistakenly ended up in live tasks, so
that we can install updated versions separately (LP: #1325281).
2014-06-24 14:50:42 +01:00
Colin Watson
63113028d9 Install linux-signed-generic directly in live passes rather than relying
on it being in the corresponding tasks.  linux-signed-generic shouldn't
be in a task because that expands to ABI-versioned packages, and tasks
can't be updated post-release.
2014-06-24 09:34:12 +01:00
39 changed files with 2992 additions and 126 deletions

291
debian/changelog vendored
View File

@ -1,3 +1,294 @@
livecd-rootfs (2.208.18) trusty; urgency=medium
* Preserve ubuntu-advantage-tools' apt preferences against live-build's
attempt to delete them. (LP: #1855354)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Fri, 06 Dec 2019 14:03:11 +1300
livecd-rootfs (2.208.17) trusty; urgency=medium
* Drop /etc/update-motd.d/51-cloudguest from cloud images; this is not
consistent with current Ubuntu Advantage product language. Any future
customizations to update-motd for cloud images should be done via a
package instead. LP: #1823776.
-- Steve Langasek <steve.langasek@ubuntu.com> Tue, 19 Mar 2019 22:23:21 -0700
livecd-rootfs (2.208.16) trusty; urgency=medium
* For omap and omap4, enable the universe component for u-boot-linaro-omap*
packages. Without it those SUBARCHs will now fail to build.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Mon, 04 Mar 2019 15:34:14 +0100
livecd-rootfs (2.208.15) trusty; urgency=medium
* Fix security mirror sources.list entries for non-x86 architectures by
backporting trunk revision 1408. (LP: #1711735)
-- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Tue, 31 Oct 2017 10:33:13 +1300
livecd-rootfs (2.208.14) trusty; urgency=medium
[ Robert C. Jennings ]
* Add ubuntu-cpc project (LP: #1693018)
[ Daniel Watkins ]
* Move building of all architecture-specific CPC artifacts into Launchpad
- Fixup virtual FLAVOUR kernel name
[ Oliver Grawert ]
* added additional CPC build targets:
- added manifest generation for squashfs and root.tar.gz
- added VMDK generation
- added OVA generation from VMDK's
- added generic Vagrant image generation
[ Ben Howard ]
* Fix typo in ubuntu-cpc preventing non-intel builds.
* add devpts-live to hook builds
* add logic to settle the disks after UEFI builds
* extended hooks/functions to support creation of derivative images
* including mounting images.
* added the ability to create qcow2 images in hooks/functions
* simplified loop clean-up in hooks/functions
* removed assumption that disk1.img would be built
* switched qcow2 generation to use hooks/functions function
[ Daniel Watkins ]
* Produce OVA files for i386 cloud builds.
[ Ben Howard ]
* Remove unneeded packages from the root.tar.{gz,xz} cloud image targets
[ Daniel Watkins ]
* Install grub in ppc64el cloud images so they are bootable
[ Daniel Watkins ]
* Set timeout options so ppc64el cloud images don't display a grub boot
menu (matching the behaviour of other cloud images).
* Specify a regex to run-parts so that cloud image extra scripts are found
and executed.
[ Steve Langasek ]
* Refactor/reorder ubuntu-cpc support for consistency with other flavors,
so that subarch overrides can be applied correctly.
[ Ben Howard ]
* fixed loop setup due to change of kpartx output
* only use grub-install logic for Intel architectures
[ Steve Langasek ]
* Refactor some non-idiomatic architecture handling in
live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot that also misidentifies
the architecture name for armhf.
[ Steve Langasek ]
* Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it
at the end. This is a general-purpose change that should be applied to
all flavors and archs, but at the moment it's only needed on armhf+raspi2
to work around the raspberrypi2-firmware postinst calling sync, which is
actually warranted in the normal case.
* If a subarch is specified for a cloud image build, don't build rootfs
artifacts; these should come from the 'generic' build.
* Fix architecture handling in hooks. We know we're always being invoked
from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
environment, because auto/config and auto/build both rely on this. So
don't scatter dpkg --print-architecture calls throughout, especially
when many of these are not cross-build-aware.
* Refactor ubuntu-cpc hooks to allow us to handle images where the root
partition should not be partition 1.
[ Ben Howard ]
* ubuntu-cpc: fix hooks/032-disk-image.binary call to
create_empty_partition, which requires five args due to "-u"
* ubuntu-cpc: in hooks/030-root-tarball.binary create /lib/modules to fix
[ Steve Langasek ]
* Refactor ubuntu-cpc hooks to always produce a 'plain' rootfs via
live-build and reuse this for the tarball, instead of lb_binary_rootfs
creating some artifact that we ignore / throw away.
* Initial support for raspi2 subarch.
* Import live-build/ubuntu-cpc/hooks/raspi2/mkknlimg from
https://github.com/raspberrypi/linux/blob/rpi-4.1.y/scripts/mkknlimg
and use it to install a bootable uboot.bin.
[ Adam Conrad ]
* live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot: Add fake_cloud_init
function to create a nocloud data source for cloud images that aren't
meant to be used on real clouds and use it by default on armhf+raspi2
[ Ben Howard ]
* live-build/ubuntu-cpc/hooks/042-vagrant.binary: add serial device for
Vagrant images
[ Daniel Watkins ]
* Refactor ubuntu-cpc hooks to hard-code producing an 'ext4' rootfs, which
is used outside of the livecd-rootfs build process (specifically for EC2
publication).
[ Ben Howard ]
* live-build/ubuntu-cpc/hooks/042-vagrant.binary: scope serial device for
Virtualbox only.
[ Daniel Watkins ]
* Enable building of powerpc cloud images.
[ Louis Zuckerman ]
* Fixes for vagrant box builder in ubuntu-cpc
- Install virtualbox-guest-utils
- Don't disable default synced folder
- Don't set vm name
- Add cloud-init config to manage /etc/hosts
[ Steve Langasek ]
* live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
so that the teardown is done properly /before/ we try to make an
image from our filesystem, since otherwise /etc/resolv.conf is broken.
[ Daniel Watkins ]
* Don't overwrite the default sources.list in cloud images.
* Replace sources.list generated using COMPONENTS with the sources.list from
an Ubuntu Server installation (i.e. with all components enabled, and all
deb-src lines commented).
[ Chris Glass ]
* Fix the manifest generation in OVA files so that ovf files don't have
double extensions.
* Fix the OVF's metadata to include Ubuntu specific identifiers and
descriptions instead of the generic Linux ones.
[ Daniel Watkins ]
* Add replace_grub_root_with_label function thereby consolidating multiple
uses of the same calls to sed.
[ Robert C Jennings ]
* ubuntu-cpc: Remove redundant copy of grub files.
[ Daniel Watkins ]
* Add `apt-get update` to ubuntu-cpc ppc64el builds so they use the new
sources.
[ Balint Reczey ]
* Add basic but configurable autopkgtest. LP: #1690440.
-- Robert C Jennings <robert.jennings@canonical.com> Thu, 01 Jun 2017 16:30:10 -0400
livecd-rootfs (2.208.13) trusty; urgency=medium
* live-build/auto/config: Switch HWE from wily to xenial (LP: #1568918)
-- Adam Conrad <adconrad@ubuntu.com> Fri, 08 Jul 2016 02:13:52 -0600
livecd-rootfs (2.208.12) trusty; urgency=medium
* Rename old ubuntu-core tarballs to ubuntu-base, for consistency with
the changes already made to yakkety and the ubuntu-cdimage project.
LP: #1579950.
-- Steve Langasek <steve.langasek@ubuntu.com> Mon, 09 May 2016 17:03:01 -0700
livecd-rootfs (2.208.11) trusty; urgency=medium
* Only install thermald on amd64|i386 on lubuntu, fixing PPC build.
-- Adam Conrad <adconrad@ubuntu.com> Sat, 16 Jan 2016 01:23:46 -0700
livecd-rootfs (2.208.10) trusty; urgency=medium
* live-build/auto/config: Switch HWE from lts-vivid to lts-wily.
-- Adam Conrad <adconrad@ubuntu.com> Fri, 15 Jan 2016 19:18:16 -0700
livecd-rootfs (2.208.9) trusty; urgency=medium
* Switch from lts-vivid to lts-wily HWE kernels (LP: #1524366)
-- Adam Conrad <adconrad@ubuntu.com> Wed, 09 Dec 2015 10:47:37 -0700
livecd-rootfs (2.208.8) trusty; urgency=medium
* Add xserver-xorg-core-lts-vivid to X HWE hints for the resolver.
* Add libwayland-egl1-mesa-lts-vivid to X HWE hints (LP: #1479524)
* Add kde-window-manager to kubuntu hints to fix a resolver issue.
* Add thermald to lubuntu hints to work around lack of recommends.
-- Adam Conrad <adconrad@ubuntu.com> Tue, 28 Jul 2015 20:06:52 -0600
livecd-rootfs (2.208.7) trusty; urgency=medium
* live-build/auto/config: Switch HWE from lts-utopic to lts-vivid.
* Remove obsolete libegl1-mesa-drivers-lts-* from HWE_X_PACKAGES.
-- Adam Conrad <adconrad@ubuntu.com> Mon, 22 Jun 2015 14:07:52 -0600
livecd-rootfs (2.208.6) trusty; urgency=medium
* Add audacious-plugins to LUBUNTU_HWE_HINTS to unsnag the PPC build.
-- Adam Conrad <adconrad@ubuntu.com> Wed, 18 Feb 2015 12:00:36 -0700
livecd-rootfs (2.208.5) trusty; urgency=medium
* Explicitly install the xserver-xorg-input-all-lts-utopic package.
* Rename XUBUNTU_HWE_HINTS to XFCE_HWE_HINTS, so it's more reusable
and have MYTHBUNTU, XUBUNTU, and UBUNTUSTUDIO all make use of it.
* Explicitly seed the correct notify option for every last flavour.
* Remove xscreensaver-data and xscreensaver with XUBUNTU_HWE_HINTS.
-- Adam Conrad <adconrad@ubuntu.com> Tue, 17 Feb 2015 13:57:51 -0700
livecd-rootfs (2.208.4) trusty; urgency=medium
* Use the correct metapackage for edubuntu-desktop, and add HWE_HINTS
* Add KUBUNTU_HWE_HINTS and populate to work around task->meta change
* Revert lubuntu to using tasks for minimal and standard, since their
unique snowflake apt --no-install-recommends setup breaks switching
* Add XUBUNTU_HWE_HINTS and populate to work around task->meta change
* Add UBUNTUGNOME_HWE_HINTS and populate it skip using unity packages
* Add LUBUNTU_HWE_HINTS and populate to work around task->meta change
* Reuse XUBUNTU_HWE_HINTS for MYTHBUNTU_HWE_HINTS and add some tweaks
* Also reuse XUBUNTU_HWE_HINTS for UBUNTUSTUDIO_HWE_HINTS with tweaks
-- Adam Conrad <adconrad@ubuntu.com> Wed, 04 Feb 2015 04:42:54 -0700
livecd-rootfs (2.208.3) trusty; urgency=medium
* Pull xserver-xorg-video-geode-lts-utopic out of the i386 images.
-- Adam Conrad <adconrad@ubuntu.com> Tue, 03 Feb 2015 07:03:03 -0700
livecd-rootfs (2.208.2) trusty; urgency=medium
[ Colin Watson ]
* If EXTRA_PPAS is set in the environment (as a space-separated sequence
of <ppa-owner>/<ppa-name> pairs), fetch signing keys for those from
Launchpad using python3-software-properties, and add those PPAs when
building the live filesystem. This makes it easier for a builder to
build an image against an additional PPA (LP: #1334374).
[ Adam Conrad ]
* Move from task-based installs to package-based installs, and switch
to using the lts-utopic HWE kernel and X stack for all flavours.
* Abstract the signed kernel image, so it's only defined in one spot.
* Before trying to copy kernels around, cut -lts* off the end of FLAVOUR,
since the actual files on disk are -generic, not -generic-lts-utopic.
* Define HWE_X_PACKAGES required to install lts-utopic and use it.
* Define UNITY_HWE_HINTS to hint correct alternative package selections.
-- Adam Conrad <adconrad@ubuntu.com> Mon, 02 Feb 2015 01:43:48 -0700
livecd-rootfs (2.208.1) trusty; urgency=medium
* Install linux-signed-generic directly in live passes rather than relying
on it being in the corresponding tasks. linux-signed-generic shouldn't
be in a task because that expands to ABI-versioned packages, and tasks
can't be updated post-release.
* Filter out kernel packages that mistakenly ended up in live tasks, so
that we can install updated versions separately (LP: #1325281).
-- Colin Watson <cjwatson@ubuntu.com> Tue, 24 Jun 2014 14:51:03 +0100
livecd-rootfs (2.208) trusty; urgency=medium
* Adding support for ubuntu-touch i386 based images

4
debian/control vendored
View File

@ -4,11 +4,11 @@ Priority: optional
Build-Depends: debhelper (>= 7)
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Standards-Version: 3.9.4
Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-core-dev/livecd-rootfs/trunk
Vcs-Git: https://git.launchpad.net/livecd-rootfs -b ubuntu/trusty
Package: livecd-rootfs
Architecture: any
Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a55-1), android-tools-fsutils [armhf]
Depends: ${misc:Depends}, debootstrap, rsync, python-minimal | python, procps, squashfs-tools (>= 1:3.3-1), grep-dctrl, fdupes, lsb-release, lzma, e2fsprogs, germinate (>= 1.25.1), apt-utils, gnupg, live-build (>= 3.0~a55-1), android-tools-fsutils [armhf], python3-software-properties
Suggests: partimage
Breaks: ubuntu-defaults-builder (<< 0.32)
Description: construction script for the livecd rootfs

6
debian/copyright vendored
View File

@ -1,4 +1,4 @@
live-build/* is copyright (c) 2004-2013 by Canonical Ltd.
live-build/* is copyright (c) 2004-2016 by Canonical Ltd.
These programs are free software; you can redistribute and/or modify
them under the terms of the GNU General Public License as published by
@ -16,3 +16,7 @@ livecd-rootfs source package as the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA.
Files: live-build/ubuntu-cpc/hooks/raspi2/mkknlimg
Copyright: 2009,2010 Dick Streefland <dick@streefland.net>
2014,2015 Raspberry Pi (Trading) Limited <info@raspberrypi.org>
License: GPL-2+

1
debian/install vendored
View File

@ -1 +1,2 @@
live-build usr/share/livecd-rootfs
get-ppa-fingerprint usr/share/livecd-rootfs

3
debian/tests/control vendored Normal file
View File

@ -0,0 +1,3 @@
Tests: default-bootstraps
Depends: @, lsb-release
Restrictions: needs-root isolation-machine

95
debian/tests/default-bootstraps vendored Executable file
View File

@ -0,0 +1,95 @@
#!/bin/sh
# autopkgtest check: Build default rootfs for all supported project:subproject pairs
# (C) 2017 Canonical Ltd.
# Author: Balint Reczey <balint.reczey@canonical.com>
set -e
if [ -z "$SUITE"]; then
SUITE=$(lsb_release -c -s)
fi
# Known project:subproject:template combinations.
# Listed subprojects can be combined with other projects as well,
# but this list gives reasonable coverage.
ALL_TRIPLETS="
base::
edubuntu::
edubuntu-dvd::
kubuntu::
kubuntu-active::
kubuntu-dvd::
kubuntu-plasma5::
lubuntu::
lubuntu-next::
mythbuntu::
ubuntu::
ubuntu-base::
ubuntu-budgie::
ubuntu-budgie-desktop::
ubuntu-budgie-live::
ubuntu-core:system-image:ubuntu-core
ubuntu-desktop-next:system-image:ubuntu-desktop-next
ubuntu-desktop-next::ubuntu-desktop-next
ubuntu-dvd::
ubuntu-gnome::
ubuntukylin::
ubuntu-mate::
ubuntu-mate-core::
ubuntu-mate-desktop::
ubuntu-mate-live::
ubuntu-netbook::
ubuntu-server::
ubuntu-server:ubuntu-rtm:
ubuntu-server:ubuntu-rtm/foo:
ubuntu-server:wubi:
ubuntu-touch-custom::ubuntu-touch-custom
ubuntu-touch::ubuntu-touch
xubuntu::"
if [ -z "$SELECTED_TRIPLETS" ]; then
SELECTED_TRIPLETS="
ubuntu-base::
"
fi
live_build_rootfs() {
PROJECT=${1%%:*}
local SUBPROJECT_TMP=${1%:*}
SUBPROJECT=${SUBPROJECT_TMP#*:}
TEMPLATE=${1##*:}
ARCH=$(dpkg --print-architecture)
echo "Building rootfs for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
cp -a /usr/share/livecd-rootfs/live-build/auto .
if [ -n "$TEMPLATE" ]; then
cp -a /usr/share/livecd-rootfs/live-build/$TEMPLATE .
fi
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
SUITE=$SUITE \
ARCH=$ARCH \
lb config
)
mkdir chroot
# this part needs root rights, but right now the whole script ran as root by autopkgtest
(env PROJECT=$PROJECT \
SUBPROJECT=$SUBPROJECT \
ARCH=$ARCH \
lb build
)
echo "Build results for project: '$PROJECT' subproject: '$SUBPROJECT' template: '$TEMPLATE' in $PWD"
du -sh *
echo ""
}
WORKDIR=$(mktemp -d)
trap "RET=\$?; rm -rf $WORKDIR; exit \$RET" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
for i in $SELECTED_TRIPLETS; do
mkdir $i
(cd $i && live_build_rootfs $i)
# clean up after build to avoid filling the disk, needs root rights
rm -rf $i
done

16
get-ppa-fingerprint Executable file
View File

@ -0,0 +1,16 @@
#! /usr/bin/python3
from __future__ import print_function
from optparse import OptionParser
from softwareproperties import ppa
parser = OptionParser(usage="%prog OWNER/NAME")
_, args = parser.parse_args()
if not args:
parser.error("must provide a PPA owner/name")
owner_name, ppa_name = args[0].split("/")
ppa_info = ppa.get_ppa_info_from_lp(owner_name, ppa_name)
print(ppa_info["signing_key_fingerprint"])

View File

@ -49,122 +49,68 @@ EOF
lb chroot "$@"
if [ -d chroot/etc/apt/preferences.d.save ]; then
# https://twitter.com/infinite_scream
mv chroot/etc/apt/preferences.d.save/* chroot/etc/apt/preferences.d/
rmdir chroot/etc/apt/preferences.d.save
fi
if [ -f config/oem-config-preinstalled ]; then
# This is cargo-culted almost verbatim (with some syntax changes for
# preinstalled being slightly different in what it doesn't ask) from
# debian-installer's apt-setup:
codename=$LB_DISTRIBUTION
file="chroot/etc/apt/sources.list"
dists="main"
alldists="main"
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q restricted; then
dists="$dists restricted"
alldists="$alldists restricted"
fi
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q universe; then
UNIVERSE=true
else
UNIVERSE=false
fi
if echo "$LB_PARENT_ARCHIVE_AREAS" | grep -q multiverse; then
MULTIVERSE=true
else
MULTIVERSE=false
fi
cat > $file <<EOF
cat > chroot/etc/apt/sources.list << EOF
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb $LB_PARENT_MIRROR_BINARY $codename $dists
deb-src $LB_PARENT_MIRROR_BINARY $codename $dists
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb $LB_PARENT_MIRROR_BINARY $codename-updates $dists
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates $dists
EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted
# Even if universe isn't enabled, we write example lines for it.
echo >> $file
if [ "$UNIVERSE" = true ]; then
alldists="$alldists universe"
COMMENT=
else
cat >> $file <<EOF
## Uncomment the following two lines to add software from the 'universe'
## repository.
EOF
COMMENT='# '
fi
cat >> $file <<EOF
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename universe
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-updates universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-updates universe
EOF
# Multiverse is different, don't write anything unless enabled.
if [ "$MULTIVERSE" = true ]; then
alldists="$alldists multiverse"
cat >> $file <<EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb $LB_PARENT_MIRROR_BINARY $codename multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename multiverse
deb $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
deb-src $LB_PARENT_MIRROR_BINARY $codename-updates multiverse
EOF
fi
cat >> $file <<EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
# deb-src $LB_PARENT_MIRROR_BINARY $codename-backports $alldists
EOF
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse
cat >> $file <<EOF
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
# deb-src http://archive.canonical.com/ubuntu $LB_DISTRIBUTION partner
deb $LB_PARENT_MIRROR_BINARY $codename-security $dists
deb-src $LB_PARENT_MIRROR_BINARY $codename-security $dists
EOF
# Security sources for Ubuntu universe; not used much, but e.g. unsupported
# binary packages from a supported source package will end up here.
if [ "$UNIVERSE" = true ]; then
COMMENT=
else
COMMENT='# '
fi
cat >> $file <<EOF
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security universe
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security universe
EOF
# Security sources for Ubuntu multiverse, with the same caveats as for
# universe.
if [ "$MULTIVERSE" = true ]; then
COMMENT=
else
COMMENT='# '
fi
cat >> $file <<EOF
${COMMENT}deb $LB_PARENT_MIRROR_BINARY $codename-security multiverse
${COMMENT}deb-src $LB_PARENT_MIRROR_BINARY $codename-security multiverse
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse
EOF
fi
@ -241,6 +187,12 @@ deb file:/var/lib/preinstalled-pool/ $LB_DISTRIBUTION $LB_PARENT_ARCHIVE_AREAS
mkdir -p chroot/var/log/installer
Chroot chroot "ln -s /etc/media-info /var/log/installer/media-info"
fi
if [ "$PROJECT" = "ubuntu-cpc" ]; then
cat > chroot/etc/cloud/build.info << EOF
build_name: server
serial: $BUILDSTAMP
EOF
fi
echo "===== Checking size of /usr/share/doc ====="
echo BEGIN docdirs
@ -328,6 +280,11 @@ for FLAVOUR in $LB_LINUX_FLAVOURS; do
if [ -z "$LB_LINUX_FLAVOURS" ] || [ "$LB_LINUX_FLAVOURS" = "none" ]; then
continue
fi
FLAVOUR=${FLAVOUR%%-lts-*}
if [ "$FLAVOUR" = "virtual" ]; then
# The virtual kernel is named generic in /boot
FLAVOUR="generic"
fi
KVERS="$( (cd "binary/$INITFS"; ls vmlinu?-* 2>/dev/null || true) | (fgrep -v .efi || true) | sed -n "s/^vmlinu.-\\([^-]*-[^-]*-$FLAVOUR\\)$/\\1/p" )"
if [ -z "$KVERS" ]; then
if [ -e "binary/$INITFS/vmlinuz" ]; then
@ -357,6 +314,7 @@ done
NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"
if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then
# only one kernel flavour
FLAVOUR=${LB_LINUX_FLAVOURS%%-lts-*}
if [ -e "binary/$INITFS/vmlinuz" ]; then
ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"
else

View File

@ -39,8 +39,17 @@ add_task ()
{
local pass="$1"
shift
local filter=
local task
if [ "$1" = --filter ]; then
# Add an extra layer of backslash-quoting to anything that's
# already backslash-quoted, since it will need to pass
# through eval.
filter="$(printf %s "$2" | sed 's/\(\\.\)/\\\\\1/g')"
shift 2
fi
# The removal of direct task installation support from live-build
# poses some problems. If the chroot has multiarch configured - for
# example, if we're building for amd64 - then dumpavail will show
@ -60,7 +69,7 @@ add_task ()
for task; do
# We need a ridiculous number of backslashes to protect
# parentheses from eval.
echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task" >> "config/package-lists/livecd-rootfs.list.chroot_$pass"
echo "!chroot chroot apt-cache dumpavail | grep-dctrl -nsPackage \\\\\\( -XFArchitecture $ARCH -o -XFArchitecture all \\\\\\) -a -wFTask $task${filter:+ -a $filter}" >> "config/package-lists/livecd-rootfs.list.chroot_$pass"
done
}
@ -84,6 +93,7 @@ SOURCE='--source false'
BOOTLOADER=none
BOOTAPPEND_LIVE=
LIVE_TASK=
LIVE_TASK_FILTER=
PREINSTALLED=false
PREINSTALL_POOL=
PREINSTALL_POOL_SEEDS=
@ -101,6 +111,12 @@ add_binary_hook ()
BINARY_HOOKS="${BINARY_HOOKS:+$BINARY_HOOKS }$1"
}
case $PROJECT in
ubuntu-cpc)
IMAGEFORMAT=ext4
;;
esac
case $IMAGEFORMAT in
ext2|ext3|ext4)
OPTS="${OPTS:+$OPTS }--initramfs none --chroot-filesystem $IMAGEFORMAT"
@ -111,9 +127,15 @@ case $IMAGEFORMAT in
COMPONENTS='main restricted universe multiverse'
;;
*)
add_package live jasper
OPTS="${OPTS:+$OPTS }--swap-file-path SWAP.swap"
OPTS="${OPTS:+$OPTS }--swap-file-size 512"
case $PROJECT in
ubuntu-cpc)
;;
*)
add_package live jasper
OPTS="${OPTS:+$OPTS }--swap-file-path SWAP.swap"
OPTS="${OPTS:+$OPTS }--swap-file-size 512"
;;
esac
;;
esac
;;
@ -154,7 +176,7 @@ if [ "$PREINSTALLED" = "true" ] && [ "$SUBPROJECT" != "wubi" ]; then
ubuntu-server)
add_package live oem-config-debconf ubiquity-frontend-debconf
;;
ubuntu-core|base|ubuntu-touch)
ubuntu-core|ubuntu-base|base|ubuntu-touch|ubuntu-cpc)
;;
*)
add_package live oem-config-gtk ubiquity-frontend-gtk
@ -172,9 +194,31 @@ case $BINARYFORMAT in
;;
esac
# Default to lts-xenial for the point release, this is overridden later by
# specific projects/flavours:
case $ARCH in
powerpc)
KERNEL_FLAVOURS="powerpc-smp-lts-xenial powerpc64-smp-lts-xenial"
;;
*)
KERNEL_FLAVOURS="generic-lts-xenial"
;;
esac
HWE_X_PACKAGES="xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial"
SIGNED_KERNEL_PACKAGE="linux-signed-generic-lts-xenial"
UNITY_HWE_HINTS="unity-settings-daemon notify-osd libqt4-sql-sqlite unity gnome-terminal"
KUBUNTU_HWE_HINTS="pinentry-qt4 kde-baseapps-bin kde-window-manager"
EDUBUNTU_HWE_HINTS="gnome-session gnome-terminal"
XFCE_HWE_HINTS="lightdm-gtk-greeter unity-settings-daemon- unity-control-center- notification-daemon- libpanel-applet-4-0-"
LUBUNTU_HWE_HINTS="xfce4-notifyd xterm notification-daemon- audacious-plugins"
UBUNTUGNOME_HWE_HINTS="unity-settings-daemon- unity-control-center- libaccount-plugin-1.0-0-"
XUBUNTU_HWE_HINTS="xfce4-notifyd xscreensaver-data- $XFCE_HWE_HINTS"
MYTHBUNTU_HWE_HINTS="notify-osd $XFCE_HWE_HINTS"
UBUNTUSTUDIO_HWE_HINTS="xfce4-notifyd $XFCE_HWE_HINTS"
case $PROJECT in
ubuntu|ubuntu-dvd)
add_task install minimal standard
add_package install ubuntu-minimal ubuntu-standard
case "$ARCH+$SUBARCH" in
armhf+omap4)
# Don't use the task as this drags in the regular X
@ -186,14 +230,19 @@ case $PROJECT in
xserver-xorg-input-evdev-omap-revert
;;
*)
add_task install ubuntu-desktop
add_package install ubuntu-desktop $UNITY_HWE_HINTS
add_package install $HWE_X_PACKAGES
;;
esac
LIVE_TASK='ubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
;;
kubuntu|kubuntu-dvd)
add_task install minimal standard
add_package install ubuntu-minimal ubuntu-standard
case "$ARCH+$SUBARCH" in
armhf+omap4)
# Don't use the task as this drags in the regular X
@ -205,55 +254,79 @@ case $PROJECT in
xserver-xorg-input-evdev-omap-revert
;;
*)
add_task install kubuntu-desktop
add_package install kubuntu-desktop $KUBUNTU_HWE_HINTS
add_package install $HWE_X_PACKAGES
;;
esac
LIVE_TASK='kubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
add_chroot_hook remove-gnome-icon-cache
;;
kubuntu-active)
add_task install minimal standard kubuntu-active
add_package install ubuntu-minimal ubuntu-standard kubuntu-active
add_package install $HWE_X_PACKAGES
LIVE_TASK='kubuntu-active-live'
COMPONENTS='main restricted universe'
add_chroot_hook remove-gnome-icon-cache
;;
edubuntu|edubuntu-dvd)
add_task install minimal standard ubuntu-desktop edubuntu-desktop-gnome
add_package install ubuntu-minimal ubuntu-standard ubuntu-desktop edubuntu-desktop $UNITY_HWE_HINTS $EDUBUNTU_HWE_HINTS
add_package install $HWE_X_PACKAGES
LIVE_TASK='edubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
;;
xubuntu)
add_task install minimal standard xubuntu-desktop
add_package install ubuntu-minimal ubuntu-standard xubuntu-desktop $XUBUNTU_HWE_HINTS
add_package install $HWE_X_PACKAGES
add_package install xterm
LIVE_TASK='xubuntu-live'
COMPONENTS='main restricted universe multiverse'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe multiverse'
;;
ubuntu-netbook)
add_task install minimal standard ubuntu-netbook
add_package install ubuntu-minimal ubuntu-standard ubuntu-netbook
LIVE_TASK='netbook-live'
;;
mythbuntu)
add_task install minimal standard mythbuntu-desktop
add_package install ubuntu-minimal ubuntu-standard mythbuntu-desktop $MYTHBUNTU_HWE_HINTS
add_package install $HWE_X_PACKAGES
LIVE_TASK='mythbuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe multiverse'
;;
lubuntu)
add_task install minimal standard lubuntu-desktop
LIVE_TASK='lubuntu-live'
COMPONENTS='main restricted universe multiverse'
add_task install minimal standard
add_package install lubuntu-desktop $LUBUNTU_HWE_HINTS
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=generic ;;
amd64|i386) add_package install thermald ;;
esac
add_package install $HWE_X_PACKAGES
LIVE_TASK='lubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe multiverse'
# The Lubuntu STRUCTURE file has "feature
# no-follow-recommends". Mirror this.
@ -261,23 +334,34 @@ case $PROJECT in
;;
ubuntu-gnome)
add_task install minimal standard ubuntu-gnome-desktop
add_package install ubuntu-minimal ubuntu-standard ubuntu-gnome-desktop $UBUNTUGNOME_HWE_HINTS
add_package install $HWE_X_PACKAGES
LIVE_TASK='ubuntu-gnome-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
;;
ubuntustudio-dvd)
add_task install minimal standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-font-meta ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography
add_package install ubuntu-minimal ubuntu-standard ubuntustudio-desktop ubuntustudio-audio ubuntustudio-font-meta ubuntustudio-graphics ubuntustudio-video ubuntustudio-publishing ubuntustudio-photography $UBUNTUSTUDIO_HWE_HINTS
add_package install $HWE_X_PACKAGES
COMPONENTS='main restricted universe multiverse'
case $ARCH in
amd64|i386) KERNEL_FLAVOURS=lowlatency ;;
amd64|i386) KERNEL_FLAVOURS=lowlatency-lts-xenial ;;
esac
;;
ubuntukylin)
add_task install minimal standard ubuntu-desktop
add_package install ubuntu-minimal ubuntu-standard ubuntu-desktop $UNITY_HWE_HINTS
add_package install $HWE_X_PACKAGES
add_package install ubuntukylin-default-settings
LIVE_TASK='ubuntu-live'
LIVE_TASK_FILTER='--not -Pe ^linux-\(headers\|image\|signed\)'
case $ARCH in
amd64) add_package live $SIGNED_KERNEL_PACKAGE ;;
esac
COMPONENTS='main restricted universe'
;;
@ -286,12 +370,12 @@ case $PROJECT in
;;
ubuntu-server)
add_task install minimal
add_package install ubuntu-minimal
COMPONENTS='main'
PREINSTALL_POOL_SEEDS='server-ship'
;;
ubuntu-core)
ubuntu-core|ubuntu-base)
add_task install minimal
OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
;;
@ -309,6 +393,38 @@ case $PROJECT in
OPTS="${OPTS:+$OPTS }--zsync false"
;;
ubuntu-cpc)
add_task install minimal standard cloud-image
add_package install ubuntu-minimal
BINARY_REMOVE_LINUX=false
OPTS="${OPTS:+$OPTS }--initramfs=none"
KERNEL_FLAVOURS=virtual
case $ARCH in
armhf)
KERNEL_FLAVOURS=generic-lpae
add_package install flash-kernel
add_task install server
;;
arm64)
KERNEL_FLAVOURS=generic
add_package install flash-kernel
add_task install server
;;
ppc64el)
add_task install server
;;
powerpc)
KERNEL_FLAVOURS=powerpc64-smp
add_task install server
;;
esac
OPTS="${OPTS:+$OPTS }--system=normal"
OPTS="${OPTS:+$OPTS }--hdd-label=cloudimg-rootfs"
OPTS="${OPTS:+$OPTS }--ext-resize-blocks=536870912 --ext-block-size=4096"
OPTS="${OPTS:+$OPTS }--ext-fudge-factor=15"
;;
*)
echo "unknown project $PROJECT" >&2
exit 2
@ -316,17 +432,17 @@ case $PROJECT in
esac
if [ "$PREINSTALLED" != "true" ] && [ "$LIVE_TASK" ]; then
add_task live "$LIVE_TASK"
add_task live ${LIVE_TASK_FILTER:+--filter "$LIVE_TASK_FILTER"} "$LIVE_TASK"
fi
case $PROJECT in
ubuntu-dvd)
add_task install ubuntu-usb
add_task live ubuntu-usb-live
add_task live ${LIVE_TASK_FILTER:+--filter "$LIVE_TASK_FILTER"} ubuntu-usb-live
;;
*-dvd)
add_task live "$PROJECT-live"
add_task live ${LIVE_TASK_FILTER:+--filter "$LIVE_TASK_FILTER"} "$PROJECT-live"
;;
esac
@ -338,10 +454,12 @@ case $ARCH in
BINARY_REMOVE_LINUX=false
;;
omap)
COMPONENTS='main restricted universe'
add_package install u-boot-linaro-omap3-beagle u-boot-tools
BINARY_REMOVE_LINUX=false
;;
omap4)
COMPONENTS='main restricted universe'
case $PROJECT in
ubuntu-server|ubuntu-core|base)
add_package install u-boot-linaro-omap4-panda u-boot-tools
@ -374,12 +492,17 @@ case $ARCH in
echo "linux-firmware-nexus7 shared/nexus7_notice_accepted boolean true" >config/preseed/linux-firmware-nexus7.preseed.chroot
echo "d-i passwd/auto-login boolean true" >config/preseed/autologin.preseed.chroot
;;
raspi2)
COMPONENTS='main restricted universe'
add_package install raspberrypi2-firmware u-boot-rpi flash-kernel u-boot-tools
BINARY_REMOVE_LINUX=false
;;
esac
;;
esac
case $PROJECT in
ubuntu-server|ubuntu-core|ubuntu-touch)
ubuntu-server|ubuntu-core|ubuntu-base|ubuntu-touch)
OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
KERNEL_FLAVOURS=none
BINARY_REMOVE_LINUX=false
@ -394,7 +517,7 @@ add_chroot_hook remove-openssh-server-host-keys
add_chroot_hook remove-udev-persistent-rules
case $PROJECT in
ubuntu-server)
ubuntu-server|ubuntu-cpc)
;;
*)
@ -430,11 +553,97 @@ echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot
echo "LB_BINARY_HOOKS=\"$BINARY_HOOKS\"" >> config/binary
echo "BUILDSTAMP=\"$NOW\"" >> config/binary
case $ARCH+$SUBARCH in
armhf+raspi2)
cat > config/hooks/01-firmware-directory.chroot_early <<EOF
#!/bin/sh -ex
mkdir -p /boot/firmware
EOF
cat > config/hooks/999-raspi2-fixes.chroot <<EOF
#!/bin/sh -ex
cat >> /etc/fstab << EOM
LABEL=system-boot /boot/firmware vfat defaults 0 1
EOM
cat > /boot/firmware/cmdline.txt << EOM
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
EOM
cat > /boot/firmware/config.txt << EOM
# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
kernel=uboot.bin
# enable i2c
dtparam=i2c_arm=on
dtparam=spi=on
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
EOM
EOF
;;
*)
;;
esac
case $PROJECT in
ubuntu-server)
cat > config/hooks/100-remove-fstab.chroot <<EOF
#! /bin/sh
rm -f /etc/fstab
EOF
;;
ubuntu-base)
cat > config/hooks/100-preserve-ua-tools-prefs.chroot <<EOF
#! /bin/sh -ex
# live-build "helpfully" removes /etc/apt/preferences.d/* so we put a
# copy somewhere it won't touch it.
cp -a /etc/apt/preferences.d /etc/apt/preferences.d.save
EOF
;;
@ -484,12 +693,51 @@ EOF
fi
;;
ubuntu-touch)
cp -af /usr/share/livecd-rootfs/live-build/ubuntu-touch/* \
ubuntu-touch|ubuntu-cpc)
cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
config/
;;
esac
if [ "$EXTRA_PPAS" ]; then
rm -f config/archives/extra-ppas.list.chroot \
config/archives/extra-ppas.key.chroot
gpg_tmpdir="$(mktemp -d)"
run_gpg () {
gpg --no-default-keyring --no-options --homedir "$gpg_tmpdir" \
--secret-keyring "$gpg_tmpdir/secring.gpg" \
--keyserver hkp://keyserver.ubuntu.com:80/ \
"$@"
}
for extra_ppa in $EXTRA_PPAS; do
extra_ppa_fingerprint="$(/usr/share/livecd-rootfs/get-ppa-fingerprint "$extra_ppa")"
echo "deb http://ppa.launchpad.net/$extra_ppa/ubuntu @DISTRIBUTION@ main" >> config/archives/extra-ppas.list.chroot
run_gpg --keyring "$gpg_tmpdir/pubring.gpg" \
--recv "$extra_ppa_fingerprint"
run_gpg --keyring "$gpg_tmpdir/pubring.gpg" \
--output "$gpg_tmpdir/export.gpg" \
--export "$extra_ppa_fingerprint"
got_fingerprint="$(
run_gpg --keyring "$gpg_tmpdir/export.gpg" \
--fingerprint --batch --with-colons |
grep '^fpr:' | cut -d: -f10)"
if [ "$got_fingerprint" != "$extra_ppa_fingerprint" ]; then
echo "Fingerprints do not match. Got:" >&2
echo "$got_fingerprint" | sed 's/^/ /' >&2
echo "Expected:" >&2
echo " $extra_ppa_fingerprint" >&2
exit 1
fi
cat "$gpg_tmpdir/export.gpg" >> config/archives/extra-ppas.key.chroot
rm -f "$gpg_tmpdir/export.gpg"
done
rm -rf "$gpg_tmpdir"
cp -a config/archives/extra-ppas.list.chroot \
config/archives/extra-ppas.list.binary
cp -a config/archives/extra-ppas.key.chroot \
config/archives/extra-ppas.key.binary
fi
# cribbed from cdimage, perhaps this should be a small helper script in germinate?
add_inheritance () {
case " $inherit " in

View File

@ -0,0 +1,259 @@
# vi: ts=4 expandtab syntax=sh
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship)
rootfs_dev_mapper=
loop_device=
loop_raw=
backing_img=
apt-get -qqy install dosfstools gdisk
clean_loops() {
if [ -n "${backing_img}" ]; then
kpartx -v -d "${backing_img}"
unset backing_img
fi
if [ -z "${rootfs_dev_mapper}" ]; then
return 0
fi
unset loop_device
unset loop_raw
unset rootfs_dev_mapper
}
create_empty_disk_image() {
# Prepare an empty disk image
dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}"
}
make_ext4_partition() {
device="$1"
mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device"
}
mount_image() {
apt-get install -qqy kpartx
trap clean_loops EXIT
backing_img="$1"
local rootpart="$2"
kpartx_mapping="$(kpartx -s -v -a ${backing_img})"
# Find the loop device
loop_p1="$(echo -e ${kpartx_mapping} | head -n1 | awk '{print$3}')"
loop_device="/dev/loop$(echo ${loop_p1} | cut -b5)"
if [ ! -b ${loop_device} ]; then
echo "unable to find loop device for ${backing_img}"
exit 1
fi
# Find the rootfs location
rootfs_dev_mapper="/dev/mapper/${loop_p1%%[0-9]}${rootpart}"
if [ ! -b "${rootfs_dev_mapper}" ]; then
echo "${rootfs_dev_mapper} is not a block device";
exit 1
fi
# Add some information to the debug logs
echo "Mounted disk image ${backing_img} to ${rootfs_dev_mapper}"
blkid ${rootfs_dev_mapper} || true
return 0
}
setup_mountpoint() {
local mountpoint="$1"
mount --bind /dev "$mountpoint/dev"
mount devpts-live -t proc "$mountpoint/dev/pts"
mount proc-live -t proc "$mountpoint/proc"
mount sysfs-live -t sysfs "$mountpoint/sys"
mount -t tmpfs none "$mountpoint/tmp"
mv "$mountpoint/etc/resolv.conf" resolv.conf.tmp
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
}
mount_partition() {
partition="$1"
mountpoint="$2"
mount "$partition" "$mountpoint"
setup_mountpoint "$mountpoint"
}
mount_disk_image() {
local disk_image=${1}
local mountpoint=${2}
mount_image ${disk_image} 1
mount_partition "${rootfs_dev_mapper}" $mountpoint
local uefi_dev="/dev/mapper${loop_device///dev/}p15"
if [ -b ${uefi_dev} -a -e $mountpoint/boot/efi ]; then
mount "${uefi_dev}" $mountpoint/boot/efi
fi
# This is needed to allow for certain operations
# such as updating grub and installing software
cat > $mountpoint/usr/sbin/policy-rc.d << EOF
#!/bin/sh
# ${CLOUD_IMG_STR}
echo "All runlevel operations denied by policy" >&2
exit 101
EOF
chmod 0755 $mountpoint/usr/sbin/policy-rc.d
}
umount_settle() {
# Unmount device, and let it settle
umount $1
udevadm settle
sleep 3
}
umount_partition() {
local mountpoint=${1}
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
for submnt in proc sys dev/pts dev tmp;
do
umount_settle $mountpoint/$submnt
done
umount_settle $mountpoint
if [ -n "${rootfs_dev_mapper}" -a -b "${rootfs_dev_mapper}" ]; then
# buildd's don't have /etc/mtab symlinked
# /etc/mtab is needed in order zerofree space for ext4 filesystems
[ -e /etc/mtab ] || ln -s /proc/mounts /etc/mtab
# both of these are likely overkill, but it does result in slightly
# smaller ext4 filesystem
apt-get -qqy install zerofree
e2fsck -y -E discard ${rootfs_dev_mapper}
zerofree ${rootfs_dev_mapper}
fi
}
umount_disk_image() {
mountpoint="$1"
local uefi_dev="/dev/mapper${loop_device///dev/}p15"
if [ -e "$mountpoint/boot/efi" -a -b "$uefi_dev" ]; then
umount --detach-loop "$mountpoint/boot/efi"
fi
if [ -e $mountpoint/usr/sbin/policy-rc.d ]; then
rm $mountpoint/usr/sbin/policy-rc.d
fi
umount_partition $mountpoint
clean_loops
}
modify_vmdk_header() {
# Modify the VMDK headers so that both VirtualBox _and_ VMware can
# read the vmdk and import them. The vodoo here is _not_ documented
# anywhere....so this will have to do. This is undocumented vodoo
# that has been learned by the Cloud Image team.
vmdk_name="${1}"
descriptor=$(mktemp)
newdescriptor=$(mktemp)
# Extract the vmdk header for manipulation
dd if="${vmdk_name}" of="${descriptor}" bs=1 skip=512 count=1024
# The sed lines below is where the magic is. Specifically:
# ddb.toolsVersion: sets the open-vm-tools so that VMware shows
# the tooling as current
# ddb.virtualHWVersion: set the version to 7, which covers most
# current versions of VMware
# createType: make sure its set to stream Optimized
# remove the vmdk-stream-converter comment and replace with
# # Disk DescriptorFile. This is needed for Virtualbox
# remove the comments from vmdk-stream-converter which causes
# VirtualBox and others to fail VMDK validation
sed -e 's|# Description file.*|# Disk DescriptorFile|' \
-e '/# Believe this is random*/d' \
-e '/# Indicates no parent/d' \
-e '/# The Disk Data Base/d' \
-e 's|ddb.comment.*|ddb.toolsVersion = "2147483647"|' \
"${descriptor}" > "${newdescriptor}"
# The header is cannot be bigger than 1024
expr $(stat --format=%s ${newdescriptor}) \< 1024 > /dev/null 2>&1 || {
echo "descriptor is too large, VMDK will be invalid!"; exit 1; }
# Overwrite the vmdk header with our new, modified one
dd conv=notrunc,nocreat \
if="${newdescriptor}" of="${vmdk_name}" \
bs=1 seek=512 count=1024
rm ${descriptor} ${newdescriptor}
}
create_vmdk() {
# There is no real good way to create a _compressed_ VMDK using open source
# tooling that works across multiple VMDK-capable platforms. This functions
# uses vmdk-stream-converter and then calls modify_vmdk_header to produce a
# compatible VMDK.
src="$1"
destination="$2"
size="${3:-10240}"
apt-get install -qqy qemu-utils vmdk-stream-converter
streamconverter="/usr/share/pyshared/VMDKstream.py"
scratch_d=$(mktemp -d)
cp ${src} ${scratch_d}/resize.img
truncate --size=${size}M ${scratch_d}/resize.img
python ${streamconverter} ${scratch_d}/resize.img ${destination}
modify_vmdk_header ${destination}
qemu-img info ${destination}
rm -rf ${scratch_d}
}
create_derivative() {
# arg1 is the disk type
# arg2 is the new name
unset derivative_img
case ${1} in
uefi) disk_image="binary/boot/disk-uefi.ext4";
dname="${disk_image//-uefi/-$2-uefi}";;
*) disk_image="binary/boot/disk.ext4";
dname="${disk_image//.ext4/-$2.ext4}";;
esac
if [ ! -e ${disk_image} ]; then
echo "Did not find ${disk_image}!"; exit 1;
fi
cp ${disk_image} ${dname}
export derivative_img=${dname}
}
convert_to_qcow2() {
apt-get install -qqy qemu-utils
src="$1"
destination="$2"
qemu-img convert -c -O qcow2 -o compat=0.10 "$src" "$destination"
qemu-img info "$destination"
}
replace_grub_root_with_label() {
# When update-grub is run, it will detect the disks in the build system.
# Instead, we want grub to use the cloudimg-rootfs labelled disk
CHROOT_ROOT="$1"
sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
"$CHROOT_ROOT/boot/grub/grub.cfg"
}

View File

@ -0,0 +1,11 @@
#!/bin/sh
set -e
dpkg-divert --quiet --add --divert /bin/sync.REAL --rename /bin/sync
cat > /bin/sync <<'EOF'
#! /bin/sh
echo "$0: diverted by livecd-rootfs" >&2
exit 0
EOF
chmod +x /bin/sync

View File

@ -0,0 +1,4 @@
#!/bin/bash -eux
. /etc/os-release
echo "Ubuntu $VERSION" > /etc/ec2_version

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Configure certain packages
## console-setup
# Select the fontface
printf "%s\t%s\t%s\t%s\n" \
console-setup console-setup/console-setup/fontface47 string "Fixed" debconf-set-selections ||
{ echo "FAILED to setup console fontface"; exit 1; }
# Select the code page for font
printf "%s\t%s\t%s\t%s\n" \
console-setup console-setup/codesetcode string "Uni2" | debconf-set-selections ||
{ echo "FAILED to setup console code page to Uni2"; exit 1; }
# Set Language string for codepage 47
printf "%s\t%s\t%s\t%s\n" \
console-setup console-setup/codeset47 string ". Combined - Latin; Slavic Cyrillic; Greek" | debconf-set-selections ||
{ echo "FAILED to setup codeset47 to proper string"; exti 1; }
# Replace the console font and typ ein /etc/default/console-setup
sed -i -e 's,^CODESET.*,CODESET="Uni2",g' \
-e 's,^FONTFACE.*,FONTFACE="Fixed",g' \
/etc/default/console-setup
# Configure the console-setup
dpkg-reconfigure --frontend=noninteractive console-setup ||
{ echo "FAILED to recofigure console-setup"; exit 1; }

View File

@ -0,0 +1,14 @@
#!/bin/bash
#
# Create the necessary users and set their passwords. If needed,
# make sure they belong to the proper groups
#
# Author: Ben Howard <ben.howard@canonical.com>
# Date: 29 Jun 2011
#
echo "Adding admin group..."
addgroup --system --quiet admin
echo "Adding netdev group..."
addgroup --system --quiet netdev

View File

@ -0,0 +1,32 @@
#!/bin/bash -ex
if [ -n "$SUBARCH" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
. /build/config/functions
mkdir binary/boot/filesystem.dir
cp -a chroot/* binary/boot/filesystem.dir
setup_mountpoint binary/boot/filesystem.dir
chroot binary/boot/filesystem.dir dpkg-divert --local --rename /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir touch /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir chmod +x /usr/sbin/grub-probe
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^linux-.*'
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^grub-.*'
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get autoremove --purge --assume-yes
chroot binary/boot/filesystem.dir mkdir /lib/modules
chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf"
umount "binary/boot/filesystem.dir/proc"
umount "binary/boot/filesystem.dir/sys"
umount "binary/boot/filesystem.dir/dev/pts"
umount "binary/boot/filesystem.dir/dev"
umount "binary/boot/filesystem.dir/tmp"

View File

@ -0,0 +1,13 @@
#!/bin/bash -ex
# vi: ts=4 noexpandtab
#
# Generate the rootfs.tar.gz and manifest
if [ -n "$SUBARCH" ]; then
exit 0
fi
dpkg-query --admindir=binary/boot/filesystem.dir/var/lib/dpkg -W > livecd.ubuntu-cpc.rootfs.manifest
(cd "binary/boot/filesystem.dir/" && tar -c *) | \
xz > "livecd.ubuntu-cpc.rootfs.tar.xz"

View File

@ -0,0 +1,124 @@
#!/bin/bash -ex
. /build/config/functions
BOOTPART_START=
BOOTPART_END=
BOOT_MOUNTPOINT=
ROOTPART_START=1
case $ARCH:$SUBARCH in
ppc64el:*|powerpc:*)
echo "POWER disk images are handled separately"
exit 0
;;
armhf:raspi2)
# matches the size of the snappy image
IMAGE_SIZE=$((4*1000*1000*1000))
BOOTPART_START=8192s
BOOTPART_END=138M
BOOT_MOUNTPOINT=/boot/firmware
;;
*)
;;
esac
create_empty_partition_table() {
apt-get install -qqy parted
parted "$1" --script -- mklabel msdos
}
create_empty_partition() {
local disk="$1"
local part="$2"
local start="$3"
local end="$4"
local type="$5"
local bootable="$6"
parted_prefix="parted $disk --script --"
${parted_prefix} mkpart primary "$type" "$start" "$end"
if [ -n "$bootable" ]; then
${parted_prefix} set "$part" B
fi
${parted_prefix} print
${parted_prefix} align-check opt "$part"
}
disk_image=binary/boot/disk.ext4
create_empty_disk_image "${disk_image}"
create_empty_partition_table "${disk_image}"
ROOTPART=1
ROOT_BOOTABLE=1
if [ -n "$BOOTPART_START" ]; then
ROOTPART=2
ROOTPART_START="$BOOTPART_END"
ROOT_BOOTABLE=
create_empty_partition "$disk_image" 1 "$BOOTPART_START" "$BOOTPART_END" fat32 1
fi
create_empty_partition "${disk_image}" "$ROOTPART" "$ROOTPART_START" -1 ext2 "$ROOT_BOOTABLE"
mount_image "${disk_image}" "$ROOTPART"
# Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint
mount "${rootfs_dev_mapper}" mountpoint
if [ -n "$BOOT_MOUNTPOINT" ]; then
boot_dev_mapper="${rootfs_dev_mapper%%[0-9]}1"
# assume fat32 for now
mkfs.vfat -n system-boot "$boot_dev_mapper"
mkdir -p "mountpoint/$BOOT_MOUNTPOINT"
mount "$boot_dev_mapper" "mountpoint/$BOOT_MOUNTPOINT"
fi
cp -a chroot/* mountpoint/
setup_mountpoint mountpoint
case $ARCH:$SUBARCH in
armhf:raspi2)
chroot mountpoint flash-kernel \
--machine "Raspberry Pi 2 Model B"
# not the best place for this, but neither flash-kernel nor
# u-boot have provisions for installing u-boot via maintainer
# script
/build/config/hooks/raspi2/mkknlimg --dtok \
mountpoint/usr/lib/u-boot/rpi_2/u-boot.bin \
mountpoint/boot/firmware/uboot.bin
;;
*) ;;
esac
case $ARCH in
amd64|i386) should_install_grub=1;;
*) should_install_grub=0;;
esac
if [ "${should_install_grub}" -eq 1 ]; then
echo "(hd0) ${loop_device}" > mountpoint/tmp/device.map
chroot mountpoint grub-install ${loop_device}
chroot mountpoint grub-bios-setup \
--boot-image=i386-pc/boot.img \
--core-image=i386-pc/core.img \
--skip-fs-probe \
--device-map=/tmp/device.map \
${loop_device}
rm mountpoint/tmp/device.map
fi
if [ -n "$BOOT_MOUNTPOINT" ]; then
umount "mountpoint/$BOOT_MOUNTPOINT"
fi
umount_partition mountpoint
rmdir mountpoint
clean_loops
trap - EXIT

View File

@ -0,0 +1,19 @@
#!/bin/bash -ex
# vi: ts=4 noexpandtab
#
# Generate a squashfs root and manifest
if [ -n "$SUBARCH" ]; then
exit 0
fi
apt-get -qqy install squashfs-tools
squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
squashfs_f_manifest="${squashfs_f}.manifest"
dpkg-query --admindir=binary/boot/filesystem.dir/var/lib/dpkg -W > ${squashfs_f_manifest}
(cd "binary/boot/filesystem.dir/" &&
mksquashfs . ${squashfs_f} \
-no-progress -xattrs -comp xz )

View File

@ -0,0 +1,141 @@
#!/bin/bash -eux
case $ARCH in
amd64|arm64)
;;
*)
echo "We don't create EFI images for $ARCH."
exit 0
;;
esac
. /build/config/functions
apt-get -qqy install dosfstools gdisk
create_partitions() {
disk_image="$1"
sgdisk "${disk_image}" --zap-all
case $ARCH in
arm64)
sgdisk "${disk_image}" \
--new=15:0:204800 \
--typecode=15:ef00 \
--new=1:
;;
amd64)
sgdisk "${disk_image}" \
--new=14::+4M \
--new=15::+106M \
--new=1::
sgdisk "${disk_image}" \
-t 14:ef02 \
-t 15:ef00
;;
esac
sgdisk "${disk_image}" \
--print
}
create_and_mount_uefi_partition() {
uefi_dev="/dev/mapper${loop_device///dev/}p15"
mountpoint="$1"
mkfs.vfat -F 32 -n UEFI "${uefi_dev}"
mkdir -p "${mountpoint}"/boot/efi
mount "${uefi_dev}" "$mountpoint"/boot/efi
cat << EOF >> "mountpoint/etc/fstab"
LABEL=UEFI /boot/efi vfat defaults 0 0
EOF
}
install_grub() {
mkdir mountpoint
mount_partition "${rootfs_dev_mapper}" mountpoint
create_and_mount_uefi_partition mountpoint
echo "(hd0) ${loop_device}" > mountpoint/tmp/device.map
mkdir -p mountpoint/etc/default/grub.d
efi_boot_dir="/boot/efi/EFI/BOOT"
chroot mountpoint mkdir -p "${efi_boot_dir}"
case $ARCH in
arm64)
chroot mountpoint apt-get -qqy install --no-install-recommends grub-efi-arm64 grub-efi-arm64-bin
grub_modules="part_gpt fat gzio ext2 normal chain boot configfile linux search_fs_uuid search_label terminal serial video video_fb efi_gop"
efi_target=arm64-efi
;;
amd64)
chroot mountpoint apt-get install -qqy grub-efi-amd64-signed grub-efi-amd64 shim-signed
grub_modules="part_gpt fat ext2 normal chain boot configfile linux multiboot search_fs_uuid search_label terminal serial video video_fb video_bochs usb usb_keyboard efi_gop efi_uga"
efi_target=x86_64-efi
;;
esac
cat << EOF >> mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
${CLOUD_IMG_STR}
# For Cloud Image compatability
GRUB_PRELOAD_MODULES="${grub_modules}"
EOF
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \
--target=${efi_target} \
--removable \
--uefi-secure-boot \
--no-nvram \
--modules="${grub_modules}"
if [ -f mountpoint/boot/efi/EFI/BOOT/grub.cfg ]; then
sed -i "s| root| root hd0,gpt1|" mountpoint/boot/efi/EFI/BOOT/grub.cfg
sed -i "1i${CLOUD_IMG_STR}" mountpoint/boot/efi/EFI/BOOT/grub.cfg
# For some reason the grub disk is looking for /boot/grub/grub.cfg on
# part 15....
chroot mountpoint mkdir -p /boot/efi/boot/grub
chroot mountpoint cp /boot/efi/EFI/BOOT/grub.cfg /boot/efi/boot/grub
fi
if [ "$ARCH" = "amd64" ]; then
# Install the BIOS/GPT bits. Since GPT boots from the ESP partition,
# it means that we just run this simple command and we're done
chroot mountpoint grub-install --target=i386-pc "${loop_device}"
fi
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
chroot mountpoint update-grub
replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
chroot mountpoint apt-get -y clean
chroot mountpoint apt-get -y update
rm mountpoint/tmp/device.map
sync
umount mountpoint/boot/efi
sleep 5
udevadm settle
mount
umount_partition mountpoint
rmdir mountpoint
}
disk_image=binary/boot/disk-uefi.ext4
create_empty_disk_image "${disk_image}"
create_partitions "${disk_image}"
mount_image "${disk_image}" 1
# Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint
mount "${rootfs_dev_mapper}" mountpoint
cp -a chroot/* mountpoint/
umount mountpoint
rmdir mountpoint
install_grub
clean_loops
trap - EXIT

View File

@ -0,0 +1,79 @@
#!/bin/bash -eux
case $ARCH in
ppc64el|powerpc)
;;
*)
exit 0
;;
esac
. /build/config/functions
create_partitions() {
disk_image="$1"
apt-get install -qqy gdisk
sgdisk "${disk_image}" \
--zap-all
sgdisk "${disk_image}" \
--new=2::+8M \
--new=1:
sgdisk "${disk_image}" -t 2:4100
sgdisk "${disk_image}" \
--print
}
install_grub() {
mkdir mountpoint
mount_partition "${rootfs_dev_mapper}" mountpoint
chroot mountpoint apt-get -qqy update
chroot mountpoint apt-get -qqy install grub2
chroot mountpoint apt-get -qqy remove --purge grub-legacy-ec2
# set the kernel commandline to use hvc0
mkdir -p mountpoint/etc/default/grub.d
cat << EOF > mountpoint/etc/default/grub.d/50-cloudimg-settings.cfg
${CLOUD_IMG_STR}
# Set the recordfail timeout
GRUB_RECORDFAIL_TIMEOUT=0
# Do not wait on grub prompt
GRUB_TIMEOUT=0
# Set the default commandline
GRUB_CMDLINE_LINUX_DEFAULT="console=hvc0 earlyprintk"
EOF
prep_partition="/dev/mapper${loop_device///dev/}p2"
chroot mountpoint grub-install "${prep_partition}" \
--no-nvram \
--boot-directory=/boot \
--target=powerpc-ieee1275
chroot mountpoint dpkg-divert --local --rename /etc/grub.d/30_os-prober
chroot mountpoint update-grub
replace_grub_root_with_label mountpoint
chroot mountpoint dpkg-divert --remove --local --rename /etc/grub.d/30_os-prober
umount_partition mountpoint
rmdir mountpoint
}
disk_image=binary/boot/disk.ext4
create_empty_disk_image "${disk_image}"
create_partitions "${disk_image}"
mount_image "${disk_image}" 1
# Copy the chroot in to the disk
make_ext4_partition "${rootfs_dev_mapper}"
mkdir mountpoint
mount "${rootfs_dev_mapper}" mountpoint
cp -a chroot/* mountpoint/
umount mountpoint
rmdir mountpoint
install_grub
clean_loops
trap - EXIT

View File

@ -0,0 +1,23 @@
#!/bin/bash -ex
case $ARCH:$SUBARCH in
# Not sure if any other cloud images use subarch for something that
# should take qcow2 format, so only skipping this on raspi2 for now.
armhf:raspi2)
apt-get install -qqy pxz
pxz -T4 -c binary/boot/disk.ext4 > livecd.ubuntu-cpc.disk1.img.xz
exit 0
;;
esac
apt-get install -qqy qemu-utils
. /build/config/functions
if [ -f binary/boot/disk.ext4 ]; then
convert_to_qcow2 binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.img
fi
if [ -f binary/boot/disk-uefi.ext4 ]; then
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.uefi1.img
fi

View File

@ -0,0 +1,22 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate VMDK files
extension="disk1.vmdk"
case $ARCH in
i386|amd64) ;;
*) echo "VMDK images are not supported for $ARCH yet.";
exit 0;;
esac
. /build/config/functions
if [ -e binary/boot/disk.ext4 ]; then
create_vmdk binary/boot/disk.ext4 livecd.ubuntu-cpc.disk1.vmdk
fi
if [ -e binary/boot/disk-uefi.ext4 ]; then
create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.uefi.vmdk
fi

View File

@ -0,0 +1,105 @@
#!/bin/bash -eux
# vi: ts=4 expandtab
#
# Generate OVA images
#
# OVA images are, by defintiion a tarball consisting of a disk image, OVF file
# and checksums. This step produces an OVA that is suitable for use with
# Cloud's that support the OVF specification.
#
# For this step, we re-use the VMDK's made in 040-vmdk-image.binary
# Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in
amd64)
ovf_id=94
ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "OVA images are not supported for $ARCH yet.";
exit 0;;
esac
cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0}))
base_vmdk="livecd.ubuntu-cpc.disk1.vmdk"
if [ "$ARCH" = "amd64" ]; then
base_vmdk="livecd.ubuntu-cpc.uefi.vmdk"
fi
if [ ! -e ${base_vmdk} ]; then
find . | grep vmdk
exit 0
fi
# Lets be safe about this
scratch_d=$(mktemp -d)
trap "rm -rf ${scratch_d}" EXIT
# Used to identify bits
suite=$(chroot chroot lsb_release -c -s)
version=$(chroot chroot lsb_release --release --short)
distro=$(chroot chroot lsb_release --id --short | tr [:upper:] [:lower:])
# Put our vmdk in place for OVA conversion
prefix="${distro}-${suite}-${version}-cloudimg"
vmdk_f="${scratch_d}/${prefix}.vmdk"
cp ${base_vmdk} ${vmdk_f}
# Get information about the VMDK
vmdk_size=$(du -b "${vmdk_f}" | cut -f1)
vmdk_capacity=$(qemu-img info "${vmdk_f}" | awk '-F[\( ]' '$1 ~ /virtual/ && $NF ~ /bytes.*/ {print$(NF-1)}')
# Populate the OVF template
ovf="${scratch_d}/${prefix}.ovf"
cp ${my_d}/ovf/ubuntu-ova-v1-vmdk.tmpl ${ovf}
serial_stamp=$(date +%Y%m%d)
sed -i "${ovf}" \
-e "s/@@NAME@@/${prefix}-${serial_stamp}/g" \
-e "s/@@FILENAME@@/${vmdk_f##*/}/g" \
-e "s/@@VMDK_FILE_SIZE@@/${vmdk_size}/g" \
-e "s/@@VMDK_CAPACITY@@/${vmdk_capacity}/g" \
-e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
# Get the checksums
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
# Generate the manifest
manifest="${scratch_d}/${prefix}.mf"
cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${ovf##*/})= ${ovf_sha256}
EOF
# Now create the OVA
echo "Creating OVA with the following attributes:"
cat <<EOM
OVA information:
Name: ${prefix}
Size: ${vmdk_size}
Capacity: ${vmdk_capacity}
VMDK Name: ${vmdk_f##*/}
VMDK SHA256: ${vmdk_sha256}
OVF SHA256: ${ovf_sha256}
EOM
tar -C ${scratch_d} \
-cf ${cur_d}/livecd.ubuntu-cpc.ova \
${prefix}.ovf \
${prefix}.mf \
${vmdk_f##*/}

View File

@ -0,0 +1,221 @@
#!/bin/bash -ex
# vi: ts=4 noexpandtab
#
# Generate a generic Vagrant Box.
#
# Vagrant images are essentially nothing more than OVA's with extra-metadata
# and some preinstalled packages.
#
# We can't use the OVA's for Vagrant since Vagrant uses SSH to modify the
# instance. This build step creates a cloud-config ISO so that Cloud-Init
# will configure the initial user, creates meta-data that tells Vagrant how
# to interact with the cloud-init created users, and finally create the OVA.
#
# For this step, we make a deriviative of binary/boot/disk.ext4 and install
# some packages in it, convert it to a vmdk, and then assemble the vagrant
# box.
cur_d=${PWD}
my_d=$(dirname $(readlink -f ${0}))
# Switch on $ARCH to determine which ID and description to use in the produced
# OVF. We have fancy Ubuntu-specific IDs in the OVF specification, we might as
# well use them.
case $ARCH in
amd64)
ovf_id=94
ovf_os_type="ubuntu64Guest"
ovf_desc_bits=64 ;;
i386)
ovf_id=93
ovf_os_type="ubuntu32Guest"
ovf_desc_bits=32 ;;
*)
echo "Vagrant images are not supported for $ARCH yet."
exit 0;;
esac
. /build/config/functions
# Virtualbox is needed for making a small VMDK
apt-get -qqy install genisoimage qemu-utils
# Lets be safe about this
box_d=$(mktemp -d)
seed_d=$(mktemp -d)
mount_d=$(mktemp -d)
create_derivative "disk" "vagrant" #sets ${derivative_img}
mount_disk_image ${derivative_img} ${mount_d}
cleanup_vagrant() {
if [ -d "$mount_d" ]; then
umount_disk_image "$mount_d"
fi
rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
}
trap cleanup_vagrant EXIT
chroot ${mount_d} apt-get update
# virtualbox-guest-utils Recommends: virtualbox-guest-x11, which we want to
# avoid pulling into a cloud image.
chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
chroot ${mount_d} apt-get clean
umount_disk_image "$mount_d"
rmdir "$mount_d"
# Used to identify bits
suite=$(chroot chroot lsb_release -c -s)
version=$(chroot chroot lsb_release --release --short)
distro=$(chroot chroot lsb_release --id --short | tr [:upper:] [:lower:])
# Get the VMDK in place
prefix="${distro}-${suite}-${version}-cloudimg"
vmdk_f="${box_d}/${prefix}.vmdk"
create_vmdk ${derivative_img} ${vmdk_f}
# Vagrant needs a base user. We either inject the well-known SSH key
# or use password authentication. Both are ugly. So we'll use a password
# and make it random. This obviously is insecure...but at least its
# better than the alternatives.
ubuntu_user_pass=$(openssl rand -hex 12)
####################################
# Create the ConfigDrive
# This is a cloud-init piece that instructs cloud-init to configure
# a default user at first boot.
cdrom_vmdk_f="${box_d}/${prefix}-configdrive.vmdk"
# Create the user-data. This is totally insecure, but so is Vagrant. To
# mitigate this insecurity, the vagrant instance is not accessible
# except via local host.
cat > ${seed_d}/user-data <<END
#cloud-config
password: ${ubuntu_user_pass}
chpasswd: { expire: False }
ssh_pwauth: True
manage_etc_hosts: localhost
END
# Create the fake meta-data
cat > ${seed_d}/meta-data <<END
instance-id: iid-$(openssl rand -hex 8)
local-hostname: ubuntu-${suite}
END
# Pad the cdrom, otherwise the VMDK will be invalid
dd if=/dev/zero of=${seed_d}/bloat_file bs=1M count=10
# Create the ISO
genisoimage \
-output ${seed_d}/seed.iso \
-volid cidata \
-joliet -rock \
-input-charset utf-8 \
${seed_d}/user-data \
${seed_d}/meta-data
# Make a VMDK out of the seed file.
create_vmdk ${seed_d}/seed.iso ${cdrom_vmdk_f} 10
### END Create ConfigDrive
##########################
##########################
# VAGRANT meta-data
# Create the Vagrant file. This file is used by Vagrant to define how
# Vagrant uses Virtualbox and how Vagrant interacts with the host.
macaddr="02$(openssl rand -hex 5 | tr [:lower:] [:upper:])"
cat > ${box_d}/Vagrantfile <<EOF
# Front load the includes
include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
load include_vagrantfile if File.exist?(include_vagrantfile)
Vagrant.configure("2") do |config|
config.vm.base_mac = "${macaddr}"
config.ssh.username = "ubuntu"
config.ssh.password = "${ubuntu_user_pass}"
config.vm.provider "virtualbox" do |vb|
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
end
end
EOF
# Tag it as a Virtualbox Vagrant
cat > ${box_d}/metadata.json <<EOF
{
"provider": "virtualbox"
}
EOF
# END
##########################
##########################
# Create the actual box
# Get information about the disks for the OVF
vmdk_size=$(du -b "${vmdk_f}" | cut -f1)
vmdk_capacity=$(qemu-img info "${vmdk_f}" | awk '-F[\( ]' '$1 ~ /virtual/ && $NF ~ /bytes.*/ {print$(NF-1)}')
vmdk_sha256=$(sha256sum ${vmdk_f} | cut -d' ' -f1)
cdrom_size=$(du -b "${cdrom_vmdk_f}" | cut -f1)
cdrom_capacity=$(qemu-img info "${cdrom_vmdk_f}" | awk '-F[\( ]' '$1 ~ /virtual/ && $NF ~ /bytes.*/ {print$(NF-1)}')
cdrom_sha256=$(sha256sum ${cdrom_vmdk_f} | cut -d' ' -f1)
# Populate the OVF template
ovf="${box_d}/box.ovf"
cp ${my_d}/ovf/ubuntu-ova-v1-cloudcfg-vmdk.tmpl ${ovf}
serial_stamp=$(date +%Y%m%d)
sed -i "${ovf}" \
-e "s/@@NAME@@/${prefix}-${serial_stamp}/g" \
-e "s/@@FILENAME1@@/${vmdk_f##*/}/g" \
-e "s/@@VMDK_FILE_SIZE@@/${vmdk_size}/g" \
-e "s/@@VMDK_CAPACITY@@/${vmdk_capacity}/g" \
-e "s/@@FILENAME2@@/${cdrom_vmdk_f##*/}/g" \
-e "s/@@VMDK_FILE_SIZE2@@/${cdrom_size}/g" \
-e "s/@@VMDK_CAPACITY2@@/${cdrom_capacity}/g" \
-e "s/@@NUM_CPUS@@/2/g" \
-e "s/@@VERSION@@/${version}/g" \
-e "s/@@DATE@@/${serial_stamp}/g" \
-e "s/@@MEM_SIZE@@/1024/g" \
-e "s/@@OVF_ID@@/${ovf_id}/g" \
-e "s/@@OVF_OS_TYPE@@/${ovf_os_type}/g" \
-e "s/@@OVF_DESC_BITS@@/${ovf_desc_bits}/g"
ovf_sha256=$(sha256sum ${ovf} | cut -d' ' -f1)
# Generate the manifest
manifest="${box_d}/${prefix}.mf"
cat > "${manifest}" <<EOF
SHA256(${vmdk_f##*/})= ${vmdk_sha256}
SHA256(${cdrom_vmdk_f##*/})= ${cdrom_sha256}
SHA256(${ovf##*/})= ${ovf_sha256}
EOF
# Now create the box
echo "Creating OVA with the following attributes:"
cat <<EOM
OVA information:
Name: ${prefix}
Size: ${vmdk_size}
VMDK Name: ${vmdk_f##*/}
VMDK Capacity: ${vmdk_capacity}
VMDK SHA256: ${vmdk_sha256}
CDROM Name: ${cdrom_vmdk_f##*/}
CDROM Capacity: ${cdrom_capacity}
CDROM SHA256: ${cdrom_sha256}
EOM
tar -C ${box_d} \
-cf ${cur_d}/livecd.ubuntu-cpc.vagrant.box \
box.ovf \
Vagrantfile \
metadata.json \
${prefix}.mf \
${vmdk_f##*/} \
${cdrom_vmdk_f##*/}

View File

@ -0,0 +1,3 @@
#!/bin/bash
printf "HWCLOCKACCESS=no" >> /etc/default/rcS

View File

@ -0,0 +1,3 @@
#!/bin/bash
sed -i "s|#PasswordAuthentication yes|PasswordAuthentication no|g" /etc/ssh/sshd_config

View File

@ -0,0 +1,18 @@
#!/bin/bash
#
# Disable IPv6 privacy extensions on Utopic and later
#
codename=$(sh -c 'lsb_release --short --codename')
dist_ge() { [[ "$1" > "$2" || "$1" == "$2" ]]; }
if ! dist_ge "${codename}" "trusty"; then
exit 0
fi
cat << EOF > /etc/sysctl.d/99-cloudimg-ipv6.conf
# Written by the Cloud Image build process
# See https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1068756
net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.default.use_tempaddr = 0
EOF

View File

@ -0,0 +1,57 @@
#!/bin/bash
# Clean up extraneous log files that may be left around
rm /etc/ssh/ssh_host*key* || echo "No SSH keys to remove"
# Fix LP: #1047707, 1019338
# Truncate logs that are owned, otherwise remove
whitelisted_logs=(/var/log/btmp /var/log/lastlog /var/log/wtmp /var/log/fsck/checkfs /var/log/fsck/checkroot)
for log in $(find /var/log -type f)
do
whitelisted=$(echo "${whitelisted_logs[@]}" | grep -o ${log})
if [ -n "${whitelisted}" ]; then
: > ${log} &&
echo "Truncated whitelisted log ${log}" ||
echo "Failed to truncate whitelisted log ${log}"
else
dpkg -S ${log} > /dev/null 2>&1 &&
{ : > ${log} ||
echo "Failed to truncate $f"; } ||
{ rm ${log} &&
echo "Removed ${log} as an orphaned log file" ||
echo "Failed to remove unnecessary log $f"; }
fi
done
# Remove un-owned log directories
whitelisted_dirs=(/var/log/fsck)
for log_d in $(find /var/log/* -type d)
do
whitelisted=$(echo "${whitelisted_dirs[@]}" | grep -o "${log_d}")
if [ -z "${whitelisted}" ]; then
dpkg -S ${log_d} > /dev/null 2>&1 &&
echo "Preserving log directory ${log_d}" ||
{ rm -rf ${log_d} &&
echo "Removed log directory ${log_d} as orphaned log dir" ||
echo "Failed to remove unnessasary log dir ${log_d}"; }
else
echo "Preserving whitelisted directory ${log_d}"
fi
done
rm -rf /var/run/* || echo "Failed to clean /var/run/*"
rm /etc/passwd- || echo "No spare passwd file to cleanup"
rm /etc/shadow- || echo "No spare shadow file to cleanup"
rm /etc/gshadow- || echo "No spare gshadow file to cleanup"
rm /etc/group- || echo "No spare group file to clenaup"
rm -f /etc/apt/conf.d/00secure || echo "No apt cache to cleanup"
# Truncate instead of delete, LP: #707311
truncate --size=0 -c /etc/popularity-contest.conf

View File

@ -0,0 +1,294 @@
#!/bin/bash -x
rootd="${1:-/}"
root_fs_label=cloudimg-rootfs
set -ex
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
LANG=C
_xchroot() {
# Prevent multiple chroots
if [ "$1" = "/" ]; then
shift;
"$@"
else
chroot "$@"
fi
}
#### COMMON architecture independent functions
arch=$(_xchroot "${rootd}" dpkg --print-architecture)
add_serial_console() {
condev=$1
idir="$rootd/etc/init"
cat << EOF > "${idir}/${condev}.conf"
# CONDEV - getty
#
# This service maintains a getty on CONDEV from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)
stop on runlevel [!2345]
pre-start script
# getty will not be started if the serial console is not present
stty -F /dev/CONDEV -a 2> /dev/null > /dev/null || { stop ; exit 0; }
end script
respawn
script
exec /sbin/getty -L CONDEV 115200 vt102
end script
${CLOUD_IMG_STR}
EOF
sed -i "s/CONDEV/${condev}/g" "$idir/${condev}.conf"
}
fake_cloud_init() {
# If the cloud does not provide a meta-data service this should be run
# This will setup a nocloud datasource.
seed_d="${rootd}/var/lib/cloud/seed/nocloud-net"
mkdir -p "${seed_d}"
# fake instance-id
cat << EOF > "${seed_d}/meta-data"
instance_id: cloud-image
EOF
# fake user-data to create the default user/password
cat << EOF > "${seed_d}/user-data"
#cloud-config
password: ubuntu
chpasswd: ubuntu
ssh_pwauth: True
EOF
# tell cloud-init not to look for meta-data sources
cat << EOF > ${rootd}/etc/cloud/cloud.cfg.d/99-fake_cloud.cfg
# configure cloud-init for NoCloud
datasource_list: [ NoCloud, None ]
EOF
}
## --------------
# remove 127.0.1.1 entry (LP: #440757)
_xchroot "${rootd}" sh -c 'sed -i "/^127.0.1.1/d" /etc/hosts'
## --------------
# remove ssh pregenerated keys (LP: #512377)
_xchroot "${rootd}" sh -c 'rm -f /etc/ssh/ssh_host_[rd]sa_key*'
## --------------
_xchroot "${rootd}" locale-gen en_US.utf8
## --------------
# set cloud-init to be on
values="NoCloud, ConfigDrive, AltCloud, OVF, MAAS, Ec2, None"
printf "%s\t%s\t%s\t%s\n" \
cloud-init cloud-init/datasources multiselect "$values" |
_xchroot "${rootd}" debconf-set-selections
_xchroot "${rootd}" dpkg-reconfigure --frontend=noninteractive cloud-init
## --------------
# write some build information to the guest
# the idea is that given runtime info and this info, the instance
# can at least determine if there is a newer build available
# these variables are passed in in environment from cloudimg-build-launcher
if [ -n "${build_name}" -o -n "${serial}" ]; then
d="${rootd}/etc/cloud"
[ -d "$d" ] || mkdir -p "${d}"
{
[ -n "${build_name}" ] && echo "build_name: ${build_name}"
[ -n "${serial}" ] && echo "serial: ${serial}"
} > "$d/build.info"
fi
## --------------
# for maverick and newer, use LABEL= for the '/' entry in fstab
if [ -n "${root_fs_label}" ]; then
bl="[:blank:]"
lstr="LABEL=${root_fs_label}"
sed -i "s,^[^#${bl}]*\([${bl}]*/[${bl}].*\),${lstr}\1," "${rootd}/etc/fstab"
fi
cat > /etc/fstab << EOM
LABEL=cloudimg-rootfs / ext4 defaults 0 0
EOM
# for quantal and newer, add /etc/overlayroot.local.conf
# but do not overwrite anything that somehow got there
if [ -f "${rootd}/etc/overlayroot.conf" ] &&
[ ! -f "${rootd}/etc/overlayroot.local.conf" ]; then
{
echo "${CLOUD_IMG_STR}"
echo "overlayroot_cfgdisk=LABEL=OROOTCFG"
} > "${rootd}/etc/overlayroot.local.conf"
fi
#### END COMMON ARCH FUNCTIONS
case $arch in
# ARM images are special
armhf|arm64)
echo "Configuring ARM Serial Port"
add_serial_console ttyAMA0
# Dirty hack because SUBARCH doesn't exist when running chroot hooks,
# and we don't want raspi2 images to depend on a cloud data source:
if _xchroot "${rootd}" dpkg -l linux-image-raspi2 2>/dev/null | grep -q '^.i'; then
fake_cloud_init
fi
echo "Image architecture is ARM. Existing vmbuilder-fixups"
exit 0
;;
## Add ttyS0 for i386/amd64 for Trusty and newer
i386|amd64)
add_serial_console ttyS0
;;
powerpc|ppc64el)
add_serial_console hvc0
exit 0
;;
esac
psuedo_grub_probe() {
cat <<"PSUEDO_GRUB_PROBE"
#!/bin/sh
Usage() {
cat <<EOF
Usage: euca-psuedo-grub-probe
this is a wrapper around grub-probe to provide the answers for an ec2 guest
EOF
}
bad_Usage() { Usage 1>&2; fail "$@"; }
short_opts=""
long_opts="device-map:,target:,device"
getopt_out=$(getopt --name "${0##*/}" \
--options "${short_opts}" --long "${long_opts}" -- "$@") &&
eval set -- "${getopt_out}" ||
bad_Usage
device_map=""
target=""
device=0
arg=""
while [ $# -ne 0 ]; do
cur=${1}; next=${2};
case "$cur" in
--device-map) device_map=${next}; shift;;
--device) device=1;;
--target) target=${next}; shift;;
--) shift; break;;
esac
shift;
done
arg=${1}
case "${target}:${device}:${arg}" in
device:*:/*) echo "/dev/sda1"; exit 0;;
fs:*:*) echo "ext2"; exit 0;;
partmap:*:*)
# older versions of grub (lucid) want 'part_msdos' written
# rather than 'msdos'
legacy_pre=""
grubver=$(dpkg-query --show --showformat '${Version}\n' grub-pc 2>/dev/null) &&
dpkg --compare-versions "${grubver}" lt 1.98+20100804-5ubuntu3 &&
legacy_pre="part_"
echo "${legacy_pre}msdos";
exit 0;;
abstraction:*:*) echo ""; exit 0;;
drive:*:/dev/sda) echo "(hd0)";;
drive:*:/dev/sda*) echo "(hd0,1)";;
fs_uuid:*:*) exit 1;;
esac
PSUEDO_GRUB_PROBE
}
## install / setup grub2
gprobe="${rootd}/usr/sbin/grub-probe"
moved=0
if [ -f "${gprobe}" ]; then
mv "${gprobe}" "${gprobe}.dist"
moved=1
fi
psuedo_grub_probe > "${gprobe}"
chmod 755 "${gprobe}"
# for Quantal and later, use /etc/default/grub.d functionality
# rather than modifying the grub configuration itself.
# This avoids the mess of having to do dpkg stuff
# LP: 1179940
mkdir -p "${rootd}/etc/default/grub.d"
cat << EOF > "${rootd}/etc/default/grub.d/50-cloudimg-settings.cfg"
# Cloud Image specific Grub settings for Generic Cloud Images
${CLOUD_IMG_STR}
# Set the recordfail timeout
GRUB_RECORDFAIL_TIMEOUT=0
# Do not wait on grub prompt
GRUB_TIMEOUT=0
# Set the default commandline
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0"
# Set the grub console type
GRUB_TERMINAL=console
EOF
_xchroot "${rootd}" update-grub2
# since this is a disk image, we technically don't need to install all the
# grub modules, as the image itself is not bootable. This makes for a small
# disk image
_xchroot "${rootd}" update-grub
# reconfigure grub so that upgrades to grub-pc do not force a debconf config
# changed prompt (LP: #1009294). This re-runs update-grub
_xchroot "${rootd}" env DEBIAN_FRONTEND=noninteractive \
dpkg-reconfigure grub-pc
grub2cfg="${rootd}/boot/grub/grub.cfg"
[ ! -f "${grub2cfg}" ] ||
sed -i -e "s,root=/dev/[hs]da1,root=LABEL=${root_fs_label}," "${grub2cfg}"
[ ${moved} -eq 0 ] || mv "${gprobe}.dist" "${gprobe}"
## modify /boot/grub/menu.lst if it exists
## this is generated at install time by grub-legacy-ec2, but will have
## devices as found from the _xchroot. Here we write what it will be on ec2
if [ -f "${rootd}/boot/grub/menu.lst" ]; then
grub_root="(hd0)"
linux_root=/dev/sda1
[ -n "${root_fs_label}" ] && linux_root="LABEL=${root_fs_label}"
# the sed code below basically fixes/sets the following lines in a
# /boot/grub/menu.lst file:
# # kopt=root=xxxxxxx ro
# kernel /boot/vmlinuz-... root=xxxxxx ....
# # groot=xxxxx
# root xxxxx
# uuuid xxxxx
sed -i "${rootd}/boot/grub/menu.lst" \
-e "s|^\(# kopt=root=\)[^ ]*|\1${linux_root}|" \
-e "s|^\(kernel.*root=\)[^ ]*|\1${linux_root}|" \
-e "s|^\(# groot=\)[^ ]*|\1${grub_root}|" \
-e "s|^\(root\|uuid\)\([[:space:]]*\).*|root\2${grub_root}|"
# grub-legacy-ec2 writes this ucf entry. since we've modified
# /boot/grub/menu.lst, we have to remove it, or the user will
# get prompted for a 3 way merge of the changes the first time this runs
_xchroot "${rootd}" /usr/bin/ucfr --purge grub /var/run/grub/menu.lst
fi
# vi: ts=3 expandtab

View File

@ -0,0 +1,15 @@
#!/bin/bash
# Execute extra binary hooks.
my_dir=$(dirname $(readlink -f ${0}))
extra_d=${my_dir}/extra
if [ ! -d ${my_dir}/extra ]; then
exit 0
fi
# Export the common functions to the extras
. /build/config/functions
# Cleaner execution
/bin/run-parts --regex ".*\.binary" "${extra_d}"

View File

@ -0,0 +1,5 @@
#! /bin/sh
set -e
rm -f /bin/sync
dpkg-divert --quiet --remove --rename /bin/sync

View File

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<References>
<File ovf:href="@@FILENAME1@@" ovf:id="file1" ovf:size="@@VMDK_FILE_SIZE@@"/>
<File ovf:href="@@FILENAME2@@" ovf:id="file2" ovf:size="@@VMDK_FILE_SIZE2@@"/>
</References>
<DiskSection>
<Info>Virtual disk information</Info>
<Disk ovf:capacity="@@VMDK_CAPACITY@@" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="0"/>
<Disk ovf:capacity="@@VMDK_CAPACITY2@@" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk2" ovf:fileRef="file2" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="0"/>
</DiskSection>
<NetworkSection>
<Info>The list of logical networks</Info>
<Network ovf:name="VM Network">
<Description>The VM Network network</Description>
</Network>
</NetworkSection>
<VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info>
<Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection>
<ProductSection ovf:required="false">
<Info>Cloud-Init customization</Info>
<Product>Ubuntu @@VERSION@@ Server (@@DATE@@)</Product>
<Property ovf:key="instance-id" ovf:type="string" ovf:userConfigurable="true" ovf:value="id-ovf">
<Label>A Unique Instance ID for this instance</Label>
<Description>Specifies the instance id. This is required and used to determine if the machine should take "first boot" actions</Description>
</Property>
<Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="ubuntuguest">
<Description>Specifies the hostname for the appliance</Description>
</Property>
<Property ovf:key="seedfrom" ovf:type="string" ovf:userConfigurable="true">
<Label>Url to seed instance data from</Label>
<Description>This field is optional, but indicates that the instance should 'seed' user-data and meta-data from the given url. If set to 'http://tinyurl.com/sm-' is given, meta-data will be pulled from http://tinyurl.com/sm-meta-data and user-data from http://tinyurl.com/sm-user-data. Leave this empty if you do not want to seed from a url.</Description>
</Property>
<Property ovf:key="public-keys" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>ssh public keys</Label>
<Description>This field is optional, but indicates that the instance should populate the default user's 'authorized_keys' with this value</Description>
</Property>
<Property ovf:key="user-data" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Encoded user-data</Label>
<Description>In order to fit into a xml attribute, this value is base64 encoded . It will be decoded, and then processed normally as user-data.</Description>
<!-- The following represents '#!/bin/sh\necho "hi world"'
ovf:value="IyEvYmluL3NoCmVjaG8gImhpIHdvcmxkIgo="
-->
</Property>
<Property ovf:key="password" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Default User's password</Label>
<Description>If set, the default user's password will be set to this value to allow password based login. The password will be good for only a single login. If set to the string 'RANDOM' then a random password will be generated, and written to the console.</Description>
</Property>
</ProductSection>
<VirtualHardwareSection ovf:transport="iso">
<Info>Virtual hardware requirements</Info>
<System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>@@NAME@@</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-10</vssd:VirtualSystemType>
</System>
<Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>@@NUM_CPUS@@ virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>@@NUM_CPUS@@</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>@@MEM_SIZE@@MB of memory</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>@@MEM_SIZE@@</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSI Controller 0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceSubType>VirtualSCSI</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>1</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 1</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item ovf:required="false">
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>VirtualVideoCard</rasd:ElementName>
<rasd:InstanceID>6</rasd:InstanceID>
<rasd:ResourceType>24</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="enableMPTSupport" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="use3dRenderer" vmw:value="automatic"/>
<vmw:Config ovf:required="false" vmw:key="useAutoDetect" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="4096"/>
</Item>
<Item ovf:required="false">
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>VirtualVMCIDevice</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
<rasd:ResourceType>1</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="allowUnrestrictedCommunication" vmw:value="false"/>
</Item>
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>CD-ROM 1</rasd:ElementName>
<rasd:InstanceID>8</rasd:InstanceID>
<rasd:Parent>4</rasd:Parent>
<rasd:ResourceSubType>vmware.cdrom.remotepassthrough</rasd:ResourceSubType>
<rasd:ResourceType>15</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.exclusive" vmw:value="false"/>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:ElementName>Hard Disk 1</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
<rasd:InstanceID>9</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/>
</Item>
<Item>
<rasd:AddressOnParent>1</rasd:AddressOnParent>
<rasd:ElementName>ConfigDriveDisk</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk2</rasd:HostResource>
<rasd:InstanceID>10</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/>
</Item>
<Item>
<rasd:AddressOnParent>7</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection>VM Network</rasd:Connection>
<rasd:Description>VmxNet3 ethernet adapter on &quot;VM Network&quot;</rasd:Description>
<rasd:ElementName>Ethernet 1</rasd:ElementName>
<rasd:InstanceID>11</rasd:InstanceID>
<rasd:ResourceSubType>VmxNet3</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
</Item>
<vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="cpuHotRemoveEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="bios"/>
<vmw:Config ovf:required="false" vmw:key="virtualICH7MPresent" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="virtualSMCPresent" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="nestedHVEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.standbyAction" vmw:value="checkpoint"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="tools.toolsUpgradePolicy" vmw:value="manual"/>
</VirtualHardwareSection>
</VirtualSystem>
</Envelope>

View File

@ -0,0 +1,178 @@
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<References>
<File ovf:href="@@FILENAME@@" ovf:id="file1" ovf:size="@@VMDK_FILE_SIZE@@"/>
</References>
<DiskSection>
<Info>Virtual disk information</Info>
<Disk ovf:capacity="@@VMDK_CAPACITY@@" ovf:capacityAllocationUnits="byte" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized" ovf:populatedSize="0"/>
</DiskSection>
<NetworkSection>
<Info>The list of logical networks</Info>
<Network ovf:name="VM Network">
<Description>The VM Network network</Description>
</Network>
</NetworkSection>
<VirtualSystem ovf:id="@@NAME@@">
<Info>A virtual machine</Info>
<Name>@@NAME@@</Name>
<OperatingSystemSection ovf:id="@@OVF_ID@@" vmw:osType="@@OVF_OS_TYPE@@">
<Info>The kind of installed guest operating system</Info>
<Description>Ubuntu Linux (@@OVF_DESC_BITS@@-bit)</Description>
</OperatingSystemSection>
<ProductSection ovf:required="false">
<Info>Cloud-Init customization</Info>
<Product>Ubuntu @@VERSION@@ Server (@@DATE@@)</Product>
<Property ovf:key="instance-id" ovf:type="string" ovf:userConfigurable="true" ovf:value="id-ovf">
<Label>A Unique Instance ID for this instance</Label>
<Description>Specifies the instance id. This is required and used to determine if the machine should take "first boot" actions</Description>
</Property>
<Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="ubuntuguest">
<Description>Specifies the hostname for the appliance</Description>
</Property>
<Property ovf:key="seedfrom" ovf:type="string" ovf:userConfigurable="true">
<Label>Url to seed instance data from</Label>
<Description>This field is optional, but indicates that the instance should 'seed' user-data and meta-data from the given url. If set to 'http://tinyurl.com/sm-' is given, meta-data will be pulled from http://tinyurl.com/sm-meta-data and user-data from http://tinyurl.com/sm-user-data. Leave this empty if you do not want to seed from a url.</Description>
</Property>
<Property ovf:key="public-keys" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>ssh public keys</Label>
<Description>This field is optional, but indicates that the instance should populate the default user's 'authorized_keys' with this value</Description>
</Property>
<Property ovf:key="user-data" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Encoded user-data</Label>
<Description>In order to fit into a xml attribute, this value is base64 encoded . It will be decoded, and then processed normally as user-data.</Description>
<!-- The following represents '#!/bin/sh\necho "hi world"'
ovf:value="IyEvYmluL3NoCmVjaG8gImhpIHdvcmxkIgo="
-->
</Property>
<Property ovf:key="password" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Default User's password</Label>
<Description>If set, the default user's password will be set to this value to allow password based login. The password will be good for only a single login. If set to the string 'RANDOM' then a random password will be generated, and written to the console.</Description>
</Property>
</ProductSection>
<VirtualHardwareSection ovf:transport="iso">
<Info>Virtual hardware requirements</Info>
<System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>@@NAME@@</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>vmx-10</vssd:VirtualSystemType>
</System>
<Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>@@NUM_CPUS@@ virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>@@NUM_CPUS@@</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>@@MEM_SIZE@@MB of memory</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>@@MEM_SIZE@@</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>SCSI Controller 0</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceSubType>VirtualSCSI</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>1</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 1</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>VirtualIDEController 0</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item ovf:required="false">
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>VirtualVideoCard</rasd:ElementName>
<rasd:InstanceID>6</rasd:InstanceID>
<rasd:ResourceType>24</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="enable3DSupport" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="enableMPTSupport" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="use3dRenderer" vmw:value="automatic"/>
<vmw:Config ovf:required="false" vmw:key="useAutoDetect" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="videoRamSizeInKB" vmw:value="4096"/>
</Item>
<Item ovf:required="false">
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>VirtualVMCIDevice</rasd:ElementName>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:ResourceSubType>vmware.vmci</rasd:ResourceSubType>
<rasd:ResourceType>1</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="allowUnrestrictedCommunication" vmw:value="false"/>
</Item>
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>CD-ROM 1</rasd:ElementName>
<rasd:InstanceID>8</rasd:InstanceID>
<rasd:Parent>4</rasd:Parent>
<rasd:ResourceSubType>vmware.cdrom.remotepassthrough</rasd:ResourceSubType>
<rasd:ResourceType>15</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.exclusive" vmw:value="false"/>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:ElementName>Hard Disk 1</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
<rasd:InstanceID>9</rasd:InstanceID>
<rasd:Parent>3</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="backing.writeThrough" vmw:value="false"/>
</Item>
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:Description>Floppy Drive</rasd:Description>
<rasd:ElementName>Floppy 1</rasd:ElementName>
<rasd:InstanceID>10</rasd:InstanceID>
<rasd:ResourceSubType>vmware.floppy.remotedevice</rasd:ResourceSubType>
<rasd:ResourceType>14</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>7</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection>VM Network</rasd:Connection>
<rasd:Description>VmxNet3 ethernet adapter on &quot;VM Network&quot;</rasd:Description>
<rasd:ElementName>Ethernet 1</rasd:ElementName>
<rasd:InstanceID>11</rasd:InstanceID>
<rasd:ResourceSubType>VmxNet3</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
<vmw:Config ovf:required="false" vmw:key="wakeOnLanEnabled" vmw:value="true"/>
</Item>
<vmw:Config ovf:required="false" vmw:key="cpuHotAddEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="cpuHotRemoveEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="firmware" vmw:value="bios"/>
<vmw:Config ovf:required="false" vmw:key="virtualICH7MPresent" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="virtualSMCPresent" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="memoryHotAddEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="nestedHVEnabled" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.powerOffType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.resetType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.standbyAction" vmw:value="checkpoint"/>
<vmw:Config ovf:required="false" vmw:key="powerOpInfo.suspendType" vmw:value="preset"/>
<vmw:Config ovf:required="false" vmw:key="tools.afterPowerOn" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.afterResume" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.beforeGuestShutdown" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.beforeGuestStandby" vmw:value="true"/>
<vmw:Config ovf:required="false" vmw:key="tools.syncTimeWithHost" vmw:value="false"/>
<vmw:Config ovf:required="false" vmw:key="tools.toolsUpgradePolicy" vmw:value="manual"/>
</VirtualHardwareSection>
</VirtualSystem>
</Envelope>

View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.dmtf.org/ovf/envelope/1" xmlns:cim="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<References>
<File ovf:href="$FILE_DISK_HREF" ovf:id="file1" ovf:size="$FILE_DISK_SIZE" />
</References>
<DiskSection>
<Info>Virtual disk information</Info>
<Disk ovf:capacity="$DISK_CAPACITY" ovf:diskId="vmdisk1" ovf:fileRef="file1" ovf:format="http://wiki.qemu.org/download/qcow2-spec.html"/>
</DiskSection>
<NetworkSection>
<Info>The list of logical networks</Info>
<Network ovf:name="bridged">
<Description>The bridged network</Description>
</Network>
</NetworkSection>
<VirtualSystem ovf:id="vm">
<Info>A virtual machine</Info>
<Name>$VIRTUAL_SYSTEM_NAME</Name>
<OperatingSystemSection ovf:id="93">
<Info>$VIRTUAL_SYSTEM_OS_INFO</Info>
</OperatingSystemSection>
<ProductSection>
<Info>Cloud-Init customization</Info>
<Product>$VIRTUAL_SYSTEM_OS_INFO</Product>
<Property ovf:key="instance-id" ovf:type="string" ovf:userConfigurable="true" ovf:value="id-ovf">
<Label>A Unique Instance ID for this instance</Label>
<Description>Specifies the instance id. This is required and used to determine if the machine should take "first boot" actions</Description>
</Property>
<Property ovf:key="hostname" ovf:type="string" ovf:userConfigurable="true" ovf:value="ubuntuguest">
<Description>Specifies the hostname for the appliance</Description>
</Property>
<Property ovf:key="seedfrom" ovf:type="string" ovf:userConfigurable="true">
<Label>Url to seed instance data from</Label>
<Description>This field is optional, but indicates that the instance should 'seed' user-data and meta-data from the given url. If set to 'http://tinyurl.com/sm-' is given, meta-data will be pulled from http://tinyurl.com/sm-meta-data and user-data from http://tinyurl.com/sm-user-data. Leave this empty if you do not want to seed from a url.</Description>
</Property>
<Property ovf:key="public-keys" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>ssh public keys</Label>
<Description>This field is optional, but indicates that the instance should populate the default user's 'authorized_keys' with this value</Description>
</Property>
<Property ovf:key="user-data" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Encoded user-data</Label>
<Description>In order to fit into a xml attribute, this value is base64 encoded . It will be decoded, and then processed normally as user-data.</Description>
<!-- The following represents '#!/bin/sh\necho "hi world"'
ovf:value="IyEvYmluL3NoCmVjaG8gImhpIHdvcmxkIgo="
-->
</Property>
<Property ovf:key="password" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
<Label>Default User's password</Label>
<Description>If set, the default user's password will be set to this value to allow password based login. The password will be good for only a single login. If set to the string 'RANDOM' then a random password will be generated, and written to the console.</Description>
</Property>
</ProductSection>
<VirtualHardwareSection ovf:transport="iso">
<Info>Virtual hardware requirements</Info>
<System>
<vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
<vssd:InstanceID>0</vssd:InstanceID>
<vssd:VirtualSystemIdentifier>$VIRTUAL_SYSTEM_IDENTIFIER</vssd:VirtualSystemIdentifier>
<vssd:VirtualSystemType>$VIRTUAL_SYSTEM_TYPES</vssd:VirtualSystemType>
</System>
<Item>
<rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
<rasd:Description>Number of Virtual CPUs</rasd:Description>
<rasd:ElementName>1 virtual CPU(s)</rasd:ElementName>
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>3</rasd:ResourceType>
<rasd:VirtualQuantity>1</rasd:VirtualQuantity>
</Item>
<Item>
<rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
<rasd:Description>Memory Size</rasd:Description>
<rasd:ElementName>256MB of memory</rasd:ElementName>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>4</rasd:ResourceType>
<rasd:VirtualQuantity>256</rasd:VirtualQuantity>
</Item>
<Item ovf:required="false">
<rasd:Address>0</rasd:Address>
<rasd:Description>USB Controller</rasd:Description>
<rasd:ElementName>usb</rasd:ElementName>
<rasd:InstanceID>3</rasd:InstanceID>
<rasd:ResourceType>23</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>0</rasd:Address>
<rasd:Description>SCSI Controller</rasd:Description>
<rasd:ElementName>scsiController0</rasd:ElementName>
<rasd:InstanceID>4</rasd:InstanceID>
<rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
<rasd:ResourceType>6</rasd:ResourceType>
</Item>
<Item>
<rasd:Address>1</rasd:Address>
<rasd:Description>IDE Controller</rasd:Description>
<rasd:ElementName>ideController1</rasd:ElementName>
<rasd:InstanceID>5</rasd:InstanceID>
<rasd:ResourceType>5</rasd:ResourceType>
</Item>
<Item ovf:required="false">
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
<rasd:ElementName>cdrom1</rasd:ElementName>
<rasd:InstanceID>6</rasd:InstanceID>
<rasd:Parent>5</rasd:Parent>
<rasd:ResourceType>15</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>0</rasd:AddressOnParent>
<rasd:ElementName>disk1</rasd:ElementName>
<rasd:HostResource>ovf:/disk/vmdisk1</rasd:HostResource>
<rasd:InstanceID>7</rasd:InstanceID>
<rasd:Parent>4</rasd:Parent>
<rasd:ResourceType>17</rasd:ResourceType>
</Item>
<Item>
<rasd:AddressOnParent>2</rasd:AddressOnParent>
<rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
<rasd:Connection>bridged</rasd:Connection>
<rasd:Description>ethernet adapter on &quot;bridged&quot;</rasd:Description>
<rasd:ElementName>ethernet0</rasd:ElementName>
<rasd:InstanceID>8</rasd:InstanceID>
<rasd:ResourceSubType>E1000</rasd:ResourceSubType>
<rasd:ResourceType>10</rasd:ResourceType>
</Item>
</VirtualHardwareSection>
<AnnotationSection ovf:required="false">
<Info>$ANNOTATION_INFO</Info>
<Annotation>$ANNOTATION</Annotation>
</AnnotationSection>
</VirtualSystem>
</Envelope>

View File

@ -0,0 +1,244 @@
#!/usr/bin/env perl
# ----------------------------------------------------------------------
# mkknlimg by Phil Elwell for Raspberry Pi
# based on extract-ikconfig by Dick Streefland
#
# (c) 2009,2010 Dick Streefland <dick@streefland.net>
# (c) 2014,2015 Raspberry Pi (Trading) Limited <info@raspberrypi.org>
#
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
use strict;
use warnings;
use integer;
my $trailer_magic = 'RPTL';
my $tmpfile1 = "/tmp/mkknlimg_$$.1";
my $tmpfile2 = "/tmp/mkknlimg_$$.2";
my $dtok = 0;
my $is_283x = 0;
while (@ARGV && ($ARGV[0] =~ /^-/))
{
my $arg = shift(@ARGV);
if ($arg eq '--dtok')
{
$dtok = 1;
}
elsif ($arg eq '--283x')
{
$is_283x = 1;
}
else
{
print ("* Unknown option '$arg'\n");
usage();
}
}
usage() if (@ARGV != 2);
my $kernel_file = $ARGV[0];
my $out_file = $ARGV[1];
if (! -r $kernel_file)
{
print ("* File '$kernel_file' not found\n");
usage();
}
my @wanted_strings =
(
'bcm2708_fb',
'brcm,bcm2835-mmc',
'brcm,bcm2835-sdhost',
'brcm,bcm2708-pinctrl',
'brcm,bcm2835-gpio',
'brcm,bcm2835',
'brcm,bcm2836'
);
my $res = try_extract($kernel_file, $tmpfile1);
$res = try_decompress('\037\213\010', 'xy', 'gunzip', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\3757zXZ\000', 'abcde', 'unxz --single-stream', -1,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('BZh', 'xy', 'bunzip2', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\135\0\0\0', 'xxx', 'unlzma', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\211\114\132', 'xy', 'lzop -d', 0,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
$res = try_decompress('\002\041\114\030', 'xy', 'lz4 -d', 1,
$kernel_file, $tmpfile1, $tmpfile2) if (!$res);
my $append_trailer;
my $trailer;
my $kver = '?';
$append_trailer = $dtok;
if ($res)
{
$kver = $res->{''} || '?';
print("Version: $kver\n");
$append_trailer = $dtok;
if (!$dtok)
{
if (config_bool($res, 'bcm2708_fb') ||
config_bool($res, 'brcm,bcm2835-mmc') ||
config_bool($res, 'brcm,bcm2835-sdhost'))
{
$dtok ||= config_bool($res, 'brcm,bcm2708-pinctrl');
$dtok ||= config_bool($res, 'brcm,bcm2835-gpio');
$is_283x ||= config_bool($res, 'brcm,bcm2835');
$is_283x ||= config_bool($res, 'brcm,bcm2836');
$dtok ||= $is_283x;
$append_trailer = 1;
}
else
{
print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n");
}
}
}
elsif (!$dtok)
{
print ("* Is this a valid kernel? In pass-through mode.\n");
}
if ($append_trailer)
{
printf("DT: %s\n", $dtok ? "y" : "n");
printf("283x: %s\n", $is_283x ? "y" : "n");
my @atoms;
push @atoms, [ $trailer_magic, pack('V', 0) ];
push @atoms, [ 'KVer', $kver ];
push @atoms, [ 'DTOK', pack('V', $dtok) ];
push @atoms, [ '283x', pack('V', $is_283x) ];
$trailer = pack_trailer(\@atoms);
$atoms[0]->[1] = pack('V', length($trailer));
$trailer = pack_trailer(\@atoms);
}
my $ofh;
my $total_len = 0;
if ($out_file eq $kernel_file)
{
die "* Failed to open '$out_file' for append\n"
if (!open($ofh, '>>', $out_file));
$total_len = tell($ofh);
}
else
{
die "* Failed to open '$kernel_file'\n"
if (!open(my $ifh, '<', $kernel_file));
die "* Failed to create '$out_file'\n"
if (!open($ofh, '>', $out_file));
my $copybuf;
while (1)
{
my $bytes = sysread($ifh, $copybuf, 64*1024);
last if (!$bytes);
syswrite($ofh, $copybuf, $bytes);
$total_len += $bytes;
}
close($ifh);
}
if ($trailer)
{
# Pad to word-alignment
syswrite($ofh, "\x000\x000\x000", (-$total_len & 0x3));
syswrite($ofh, $trailer);
}
close($ofh);
exit($trailer ? 0 : 1);
END {
unlink($tmpfile1) if ($tmpfile1);
unlink($tmpfile2) if ($tmpfile2);
}
sub usage
{
print ("Usage: mkknlimg [--dtok] [--283x] <vmlinux|zImage|bzImage> <outfile>\n");
exit(1);
}
sub try_extract
{
my ($knl, $tmp) = @_;
my $ver = `strings "$knl" | grep -a -E "^Linux version [1-9]"`;
return undef if (!$ver);
chomp($ver);
my $res = { ''=>$ver };
my $string_pattern = '^('.join('|', @wanted_strings).')$';
my @matches = `strings \"$knl\" | grep -E \"$string_pattern\"`;
foreach my $match (@matches)
{
chomp($match);
$res->{$match} = 1;
}
return $res;
}
sub try_decompress
{
my ($magic, $subst, $zcat, $idx, $knl, $tmp1, $tmp2) = @_;
my $pos = `tr "$magic\n$subst" "\n$subst=" < "$knl" | grep -abo "^$subst"`;
if ($pos)
{
chomp($pos);
$pos = (split(/[\r\n]+/, $pos))[$idx];
return undef if (!defined($pos));
$pos =~ s/:.*[\r\n]*$//s;
my $cmd = "tail -c+$pos \"$knl\" | $zcat > $tmp2 2> /dev/null";
my $err = (system($cmd) >> 8);
return undef if (($err != 0) && ($err != 2));
return try_extract($tmp2, $tmp1);
}
return undef;
}
sub pack_trailer
{
my ($atoms) = @_;
my $trailer = pack('VV', 0, 0);
for (my $i = $#$atoms; $i>=0; $i--)
{
my $atom = $atoms->[$i];
$trailer .= pack('a*x!4Va4', $atom->[1], length($atom->[1]), $atom->[0]);
}
return $trailer;
}
sub config_bool
{
my ($configs, $wanted) = @_;
my $val = $configs->{$wanted} || 'n';
return (($val eq 'y') || ($val eq '1'));
}

View File

@ -0,0 +1 @@
ubuntu

View File

@ -0,0 +1,9 @@
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

View File

@ -0,0 +1,15 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Source interfaces
# Please check /etc/network/interfaces.d before changing this file
# as interfaces may have been defined in /etc/network/interfaces.d
# NOTE: the primary ethernet device is defined in
# /etc/network/interfaces.d/eth0
# See LP: #1262951
source /etc/network/interfaces.d/*.cfg

View File

@ -0,0 +1,3 @@
# The primary network interface
auto eth0
iface eth0 inet dhcp