Commit Graph

36 Commits

Author SHA1 Message Date
Robert Yang 4ebaeb281b bootimg.bbclass: fix settings for grub-efi.bbclass
Fixed:
- Found potential conflicted var LABELS ...
  Set LABELS to "boot install" would build out broken images when build
  vm + live together, use set_live_vm_vars() to fix the problem.

- Use ROOT and LABEL in boot-directdisk.bbclass and image-foo.bbclass,
  they are not only used by syslinux.bbclass, but also grub-efi.bbclass,
  add "SYSLINUX_" prefix would mislead users.

(From OE-Core rev: d7d1e0193c94abb1cd2daf1c298c8c1788f3616d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-25 10:29:16 +00:00
Robert Yang bb1c719250 syslinux.bbclass: make vm and live can be built together
* The vm image(hdddirect, vmdk, qcow2, vdi) and live image (hddimg, iso)
  couldn't be built together because the following vars settings are
  conflicted:
  - SYSLINUX_ROOT (/dev/sda2 vs /dev/ram0)
  - LABELS (boot vs boot install)
  - INITRD (None vs live install)
  - SYSLINUX_CFG (see above)
  Introduce new vars (SYSLINUX_ROOT_VM/_LIVE, the samilar to others) to
  make them can work together, now we can build all of them together:

  IMAGE_FSTYPES += "live iso hddimg hdddirect vmdk qcow2 vdi"

* Use SYSLINUX_CFG rather than SYSLINUXCFG to keep align with others
  SYSLINUX vars.

* The SYSLINUX_TIMEOUT had been set, but it didn't work since
  AUTO_SYSLINUXMENU wasn't set, this would cause confusions, so also set
  AUTO_SYSLINUXMENU.

* Move SYSLINUX_PROMPT and SYSLINUX_TIMEOUT to syslinux.bbclass rather
  than in separate classes since they are the same.

* Set SYSLINUX_TIMEOUT to 50 to have a unique timeout for syslinux.

[YOCTO #9161]

(From OE-Core rev: e38c94d6bf83ed3ca7f046d9503e81b927487bf2)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-02 23:08:51 +00:00
Robert Yang 07dc765cfe boot-directdisk.bbclass: drop IS_VM chechking
The IS_VM was used for making menus for vmdk, vdi and qcow2, except
hddimg, there is no reason to not make menus for hddimg, so drop it.

(From OE-Core rev: c5a402bcd0ebf0238f7f7f8bcc08a0790cba7a67)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:03 +00:00
Robert Yang a87574cd7e image-live/boot-directdisk.bbclass: remove AUTO_SYSLINUXCFG
No one uses it.

(From OE-Core rev: d2eba0a5b67936983ad85766349f7afa4bdb70e8)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-28 11:33:02 +00:00
Richard Purdie ef211a5ca1 bootimg/image-vm/image-live: Improve image dependencies
Now that image generation consists of separate tasks, we can improve
the dependencies in these classes. We can also incorporate the tasks
within do_image_complete instead of do_build so we have a specific task
for when the deploy directory is populated with images.

This fixes various expectations about do_image_completed and the way
I'd tried to use it to fix some sanity test problems.

(From OE-Core rev: 9543c4a9ce0ac7d9ced66fa14e48a1aa7401011e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19 17:24:47 +00:00
Robert Yang d3486244fa boot-directdisk.bbclass: remove HDDIMG before create
Fixed when rebuild:
mkdosfs: file /path/to/hdd.image already exists

(From OE-Core rev: 9abcd309c098558360cde2bff65be840ead25f83)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01 21:31:59 +00:00
Patrick Ohly f7056fafd2 Revert "boot-directdisk.bbclass: use rootfs UUID by default"
This reverts commit 8ca8e2e5bf4a9f01dc48300149a8e1d71d715400.

Further testing showed the kernel does not support root=UUID; it is
something typically handled by the initramfs.

Because boot-directdisk.bbclass cannot know whether it is using a
suitable initramfs, root=UUID cannot be the default. Instead, it will
have to be set in image recipes on a case-by-case basis.

(From OE-Core rev: 8478024bd25651aa866d4582dcc193d51553554a)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12 22:48:35 +01:00
Patrick Ohly 3b823fe744 boot-directdisk.bbclass: use rootfs UUID by default
This changes the default SYSLINUX_ROOTFS such that the rootfs is no
longer expected under a fixed device path. Instead, the UUID is used
to find it. This makes the resulting .hdddirect (and thus also the
vdi/vdmk/qcow2 images derived from that) more flexible.

(From OE-Core rev: 8ca8e2e5bf4a9f01dc48300149a8e1d71d715400)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:26 +01:00
Christian Ziethén 2963cc25af image: Support for qcow2
Add support for qcow2 image format. Implemented in the same way as
the previously existing vmdk and vdi solutions.

(From OE-Core rev: c1f9ed400e4b5fe5be4fac86021dea11a7546035)

Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:43 +01:00
Christian Ziethén ff037a6df6 boot-directdisk: Make kernel image inclusion conditional.
When building for qcow2 and a dummy kernel, avoid installing
a non existing bzImage.

(From OE-Core rev: 7d476f117c62e532c99abef5728e729b8001fa32)

Signed-off-by: Christian Ziethén <christian.ziethen@linaro.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-25 14:41:43 +01:00
Juro Bystricky a0b5164923 boot-direct.bbclass: Add support for VDI images
Same treatment for both  VMDK and VDI images.

(From OE-Core rev: 605dd9f8eb719d0aa278c8ec892e62214cdcfddc)

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-11 23:59:13 +01:00
Richard Purdie 6ae253c9b1 boot-directdisk: Use kernel from DEPLOY_DIR_IMAGE, not sysroot
After the recent kernel changes, this avoids failures like:

DEBUG: Executing shell function build_boot_dd
install: cannot stat '/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/build/tmp/sysroots/qemux86-64/usr/src/kernel/bzImage': No such file or directory
WARNING: exit code 1 from a shell command.

(From OE-Core rev: 40e83470ca45ae5c305609a5065278612e69a7e2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-21 12:37:55 +00:00
Robert Yang 0065258234 boot-directdisk.bbclass: use local HDDDIR
Use $HDDDIR rather than ${HDDDIR} in build_boot_dd(), otherwise may
errors:
- Set these in local.conf:
  IMAGE_FSTYPES += "live"
  IMAGE_FSTYPES += "vmdk"
  AUTO_SYSLINUXMENU = "1"
  NOHDD = "1"

$ bitbake core-image-sato
  DEBUG: Executing shell function build_boot_dd
  install: cannot create regular file
  `/path/to/core-image-sato-1.0/hddimg//vesamenu.c32': No such file or directory
  WARNING: exit code 1 from a shell command.

This because it uses the ${HDDDIR} which is set in bootimg.bbclass, use
local HDDDIR which is set in build_boot_dd() will fix the problem.

(From OE-Core rev: 1891c39a359e983bb8fd7992b7b5a1aaac11baf7)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11 10:53:05 +01:00
Nitin A Kamble bfa36a2188 code cleanup for INITRD variable handing
* Remove an unnecessary check
* Instead of ignoring, report the errors

(From OE-Core rev: 7afc6df6f0d0bbe0c5cb8ec021d430d6d9714941)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-06 10:27:00 +01:00
Nitin A Kamble 3b19f90bdf INITRD var: make it a list of filesystem images
The initrd image used by the Linux kernel is list of file system images
concatenated together and presented as a single initrd file at boot time.

So far the initrd is a single filesystem image. But in cases like to support
early microcode loading, the initrd image need to have multiple filesystem
images concatenated together.

This commit is extending the INITRD variable from a single filesystem image
to a list of filesystem images to satisfy the need mentioned above.

(From OE-Core rev: b0ac481dda99d8f4be8015964fcb2cb01afce08c)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-02 09:26:14 +01:00
Otavio Salvador 4c14b09498 Globally replace 'base_contains' calls with 'bb.utils.contains'
The base_contains is kept as a compatibility method and we ought to
not use it in OE-Core so we can remove it from base metadata in
future.

(From OE-Core rev: d83b16dbf0862be387f84228710cb165c6d2b03b)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:19 +01:00
Stefan Stanacar 9d04183cf8 bootimg/grub-efi.bbclass: allow using a different class for EFI images
Abstract away some names so one can select using EFI_PROVIDER a different
class than grub-efi for populating live images, basically allowing the use
of a different bootloader than grub-efi.

(From OE-Core rev: 14e5de3b8f4d5902d0ac683ff45fb878e88b40ef)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11 09:30:14 -07:00
Joao Henrique Ferreira de Freitas e40123a062 boot-directdisk: fix the support of vmdk
Previous change (086ce22b88f5ef5f75a83119a32c8b3fdcfa296d) broke
the creating of vmdk images. This protects shell expansion variables
and let dd generate the image to be transformed to vmdk by image-vmdk.class.

(From OE-Core rev: 2fe667afbdc6880c377657b5ff27e6db3b6cbe77)

Signed-off-by: Joao Henrique Ferreira de Freitas <joaohf@gmail.com>

[edit to change the usage of IMAGE_FSTYPE to IS_VMDK]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-23 10:17:37 +00:00
yanjun.zhu 22beb58bd8 boot-directdisk: add the support of vmdk
add the support of vmdk.

(From OE-Core rev: 086ce22b88f5ef5f75a83119a32c8b3fdcfa296d)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-09 18:01:43 +00:00
Jonathan Liu d299444adc boot-directdisk: avoid loop in MBR disk signature generation
Instead of looping until the generated signature is non-zero, just
return 'ffffffff' if it's zero. This avoids an infinite loop if the
generated signature is always zero.

(From OE-Core rev: 34c74ba45c04efc2dd998545bf7a31d7b06a0ee0)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-04 18:26:50 +01:00
Jonathan Liu df18dc084e boot-directdisk: ensure generated MBR disk signature is non-zero
A zero MBR disk signature is generally seen as no signature and
another partitioning program might install a new signature.

(From OE-Core rev: b6cafb1fcd6c168f8f4a4d2d5c74f3b425f156f3)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-30 22:11:58 +01:00
Jason Wessel 0ac89346de boot-directdisk.bbclass: Fix media generation problems with vmdk
The various populate methods need to accept a path as an argument vs
using hard expanded variables.  In the case of the boot-directdisk
class it uses a different path for HDDDIR but it gets eclipsed by the
the class definition at the point in time ${HDDDIR} gets expanded.

The logical fix is to pass the arguments to the functions as opposed
to using globally expanded variables from the class definitions.

This patch changes 3 things:
1) syslinux_hddimg_populate takes an argument for the destination
2) syslinux_iso_populate takes an argument for the destination
3) populate is changed to boot_direct_populate because there
   was a conflict with it overriding the populate in bootimg.bbclass

[YOCTO #3994]

(From OE-Core rev: 63d164b755b984021f7e3cdba7280918ded6e821)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-30 22:11:56 +01:00
João Henrique Ferreira de Freitas 707da95b4a boot-directdisk: Allow for EFI-only boot direct disk images
Condition building PCBIOS legacy images on MACHINE_FEATURES containing "pcbios"
    or not containing "efi". This ensures existing BSPs will continue to get the
    old PCBIOS legacy-only images. New BSPs can add "efi", "pcbios", or both. The
    images created likewise support one or the other or both.

(From OE-Core rev: c58aceee7dc243467dd87f07ccc61859f8d945e6)

Signed-off-by: João Henrique Ferreira de Freitas <joaohf@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-14 08:29:42 +01:00
Jonathan Liu 1d5d93101e boot-directdisk: use awk instead of echo -ne for dash compatibility
The echo command is a dash shell built-in and does not support the
-n and -e options so use awk instead.

This fixes the partition table being corrupted when writing the MBR
disk signature into the image.

[YOCTO #4859]

(From OE-Core rev: 1928f46e8e9f281e3e64f916048cc9314e125150)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-24 11:35:36 +01:00
Jonathan Liu b52d2bb46e boot-directdisk: allow specifying custom MBR disk signature
This introduces a DISK_SIGNATURE variable that allows controlling the
32-bit MBR disk signature. By default it is set to an automatically
generated disk signature but it may by overridden in the image recipe
by setting DISK_SIGNATURE to a 8 digit hex string.

This DISK_SIGNATURE variable can also be used in the image recipe to
specify the root by UUID using:
SYSLINUX_ROOT = "root=PARTUUID=${DISK_SIGNATURE}-02"

Specifying the root by UUID allows the kernel to locate the root
filesystem even if the device name changes (e.g. /dev/hda2, /dev/hdb2 or
/dev/sdb2 instead of /dev/sda2) due to differences in hardware
configuration.

(From OE-Core rev: 4382a419b4c90312d22aa55ff535b45bcf704716)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Acked-by: Darren hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-13 18:23:33 +01:00
Jonathan Liu f5b103ff47 boot-directdisk: Scope HDDDIR and HDDIMG variables to avoid conflicts
These variables should not be shared with other image classes.
The bootimg class also has an HDDDIR variable that could be overwritten
if executing concurrently in the same image recipe.

(From OE-Core rev: 94c83fa26af104d28aa4e6951bcb109bb0c82265)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:09:46 +03:00
Jonathan Liu badd718253 syslinux: Update to 4.06
Patches are now part of upstream or no longer needed.
Added new util-linux dependency for isohybrid.
Paths updated to reflect directory structure changes.
Add CFLAGS and LDFLAGS overrides.

[YOCTO #4438]

(From OE-Core rev: 17e7ac0c5e75245d17a90e5cc49ade3d18a168ba)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-16 00:09:46 +03:00
Robert Yang 843e422879 boot-directdisk/bootimg/image-vmdk: remove more nostamps for image generation
We have removed the nostamps for do_rootfs and do_build, so it seems
reasonable to remove the stamps for do_bootimg, do_bootdirectdisk and
do_vmdkimg.

The current problem is that the do_vmdkimg always re-run, but the
do_rootfs may not, so the code like below in the do_rootfs function
doesn't re-run and cause problems (the symlink exists when the
do_vmdkimg creates the symlink again):

    if d.getVar('IMAGE_LINK_NAME', True):
        cmds += "\trm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.*"

(From OE-Core rev: 45c7dab5d51065c7b24ab5292f8e9d3104eb0626)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-10 10:25:29 +01:00
Richard Purdie bfd279de32 Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 10:24:50 +01:00
Richard Purdie 99203edda6 boot-directdisk: Fix kernel location after STAGING_KERNEL_DIR change
This catches up with the STAGING_KERNEL_DIR location change
and uses the correct variable to future proof this issue.

[YOCTO #2783]

(From OE-Core rev: 28715eff6dff3415b1d7b0be8cbb465c417e307f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-18 22:50:14 +01:00
Saul Wold 394445fdf9 boot-directdisk: remove the default setting of SYSLINUXCFG and SYSLINUXMENU
These two should get setup in {S} and installed into {HDDDIR}, by
having them defined with {HDDDIR} they try to get created when the
directory does not exist yet.

(From OE-Core rev: 215ea5ea8b97270a3602b3f20469226a56442552)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-04-11 12:08:13 +01:00
Saul Wold 337fbed734 boot-directdisk: Fix Block Calcuation
This also changes the timeout to be settable

The block calcuation was not correctly rounding, see comment

Thanks to Darren Hart for fixing this.

Cc: Darren Hart <dvhart@linux.intel.com>
(From OE-Core rev: 53ae1737611e10e7fef815e8fde9e22165aa1047)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-27 13:26:36 +01:00
Saul Wold 136d9cd07d boot-directdisk: Use correct SYSLINUX_TIMEOUT and SYSLINUX_ROOT instead of APPEND
(From OE-Core rev: 1284230ad554f8607cb02b054fdd74017ae7c861)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-23 23:59:39 +00:00
Tom Zanussi a90914c60a boot-directdisk: fix bzImage source location
Fixes yocto [BUGID #876]

boot-directdisk.class looks in the wrong location for the bzImage to
install.  Make it look in the right place.

(From OE-Core rev: 173d04ea828e7f790ede40929c8ffd7340b4c077)

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-05 12:26:48 +01:00
Richard Purdie f89cd3158a bootimg/boot-directdisk.bbclass: Update afer syslinux changes, fix mbr.bin location and fix dependencies
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 14:09:06 +00:00
Richard Purdie 027c167878 boot-directdisk.bbclass: Add direct disk image creation class
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 11:44:25 +00:00