Commit Graph

31 Commits

Author SHA1 Message Date
Richard Purdie bfd0a39bdf classes: Drop now unneeded update_data calls
Now that the datastore works dynamically we don't need the update_data calls
so we can just remove them. They're not actually done anything at all for
a while.

(From OE-Core rev: 8de0c5d3bd01919e2bf0394f9c485936d6098cec)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 09:29:55 -08:00
Ed Bartosh 75df73526a grub-efi.bbclass: use 'grub-efi-' prefix
grub-efi recipe added 'grub-efi-' prefix to the file name of
efi binary. Changed grub-efi.bbclass accordingly.

(From OE-Core rev: 860c44435ea7cbbe3517d5ab9146213cc80fd0e7)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31 14:38:32 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Ulf Magnusson 103ab2d810 grub-efi.bbclass: Use bb.fatal() instead of raising FuncFailed
This sets a good example and avoids unnecessarily contributing to
perceived complexity and cargo culting.

Motivating quote below:

< kergoth> the *original* intent was for the function/task to error via
           whatever appropriate means, bb.fatal, whatever, and
           funcfailed was what you'd catch if you were calling
           exec_func/exec_task. that is, it's what those functions
           raise, not what metadata functions should be raising
< kergoth> it didn't end up being used that way
< kergoth> but there's really never a reason to raise it yourself

FuncFailed.__init__ takes a 'name' argument rather than a 'msg'
argument, which also shows that the original purpose got lost.

(From OE-Core rev: 48c4faa1d7117732974e51428f7ed2f62ad7e7bf)

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-04 16:29:04 +01:00
Raymond Tan 14cdcbcba5 grub-efi.bbclass: Add a space between root and append parameter
Add a space between the root and append parameter, similar to
syslinux.bbclass, in creating the final grub.cfg.

Without this, the final kernel boot parameters will concatenate into
strings like root=/dev/ram0console=ttyS0...

(From OE-Core rev: a3b271ec8e1b2758e1e619e76646d22fd5777ce3)

Signed-off-by: Raymond Tan <raymond.tan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-10-01 21:45:56 +01:00
Pranav Tipnis 9e4e6b91b7 grub-efi.bbclass: Fix path in startup.nsh for iso image.
The path in startup.nsh for iso image is corrupted as follows:
fs0:\EFI\BOOT^Hootx64.efi

Using printf will emit correct path which is:
fs0:\EFI\BOOT\bootx64.efi

This happens because of echo command. Switching to printf
like the one used in efi_populate() function.

(From OE-Core rev: 7540b9e68d56e7779b478d2bc09fbbedcf28976b)

Signed-off-by: Pranav Tipnis <pranav.tipnis@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:34 +01:00
Jonathan Liu 88a3d7629c meta/classes: fix bb.build.FuncFailed typos
(From OE-Core rev: 6a8b9599945f3f57bd86a205bc107b8490518d29)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Christopher Larson dbee7aed3d grub-efi.bbclass: also write startup.nsh for non-iso
wic will be needing this for its bootimg-efi plugin.

[YOCTO #9556]

(From OE-Core rev: ec8dc34f974ddda420bddbd195fb344e3db46cab)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:12 +01:00
Richard Purdie 9094ea9fdd classes/oeqa: Update for print statements and file() -> open() for python3
Found some more syntax cleanups needed for python3.

(From OE-Core rev: 1181d86e8707c5b8e8d43d5e785d7d9cf01fa491)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-16 09:31:23 +01:00
Robert Yang 1f2f43c5b0 grub-efi.bbclass: use GRUB_ROOT rather than APPEND for root device
Use APPEND for grub's root device may cause confusion, for example, when
building efi + pcbios, there maybe be two root=/dev/ram0, one of them
would be carried to the installed target, and the target would fail to
boot. Use GRUB_ROOT to fix the problem, and remove SYSLINUX_ROOT from
APPEND will fix the problem.

[YOCTO #9354]

(From OE-Core rev: 1f46fe7d501644c83f81dc4cc3310073c804f797)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-03 15:51:35 +01:00
Robert Yang 1b1de89304 grub-efi.bbclass: make it can build vm and live together
* Make it can build vm and live (e.g., iso + vmdk) together as we did
  for syslinux.
* GRUBCFG -> GRUB_CFG as other GRUB_FOO vars

(From OE-Core rev: e38039e43f22d55a443064efa91752e2943fda79)

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 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
Khem Raj c52dcb07b8 grub-efi, gummiboot: Emit correct path in startup.nsh
when we generate hddimage and use it to prepare SD card
using scripts/contrib/mkefidisk.sh as described here

http://elinux.org/Minnowboard:MinnowMaxYoctoProject

The content of startup.nsh contains

bootx64.efi

but this file is actually not in same dir as startup.nsh
its in /EFI/BOOT so for this to work entry in startup.nsh
should be

fs0:\EFI\BOOT\bootx64.efi

Otherwise the image is D-O-A

(From OE-Core rev: 38fe481911e7c4e9f674ded8f66878dff9e12ce3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-19 17:57:58 +01:00
Patrick Ohly 6d7bcd4df5 boot loader: support root=UUID
As mentioned when introducing the VM images
(https://bugzilla.yoctoproject.org/show_bug.cgi?id=7374), the
resulting images only work when the image is mounted as a disk that
results in the hard-coded path (/dev/sda in the current
default). Using the file system UUID to find the rootfs is more
flexible.

To enable this for boot-direct.bbclass and thus image-vm.bbclass (aka
FSTYPEs vdi/vmdk/qcow2), set SYSLINUX_ROOT =
"root=UUID=<<uuid-of-rootfs>>". The rootfs image must use an ext file
system.

The special string will get replaced in the APPEND line with the
actual UUID when the boot loader (grub-efi, syslinux or gummiboot)
writes the boot loader configuration files. At that time, the rootfs
image has already been created and its UUID can be extracted using
"tune2fs -l", which also should be available because the
e2fsprogs-native tools were needed to create the image in the first
place.

(From OE-Core rev: 1e29d77d0d33ee216b43022439876863f0db39bb)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06 15:26:25 +01:00
Nicolas Guyomard ae5c24b20a grub-efi: Allow to use file name different from grub.cfg in GRUBCFG
To generate a same image both in live image type and boot-directdisk image type
and make boot-direct image boot directly on the rootfs partition without using
an initramfs we need to have the ability to generate several grub.cfg files.

(From OE-Core rev: 3630f7963a472fa11a1d52bd9782fde9a9880971)

Signed-off-by: Nicolas Guyomard <nicolas.guyomard@open.eurogiciel.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +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
Ming Liu 6d201457e6 grub-efi.bbclass: Ensure MLPREFIX is applied to depends flag
Add MLPREFIX to depends flag to ensure the correct grub-efi is
dependended upon.

(From OE-Core rev: b62bf9e1cb8670901cfc37b1cd1822703ebdc000)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-24 19:54:12 +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
Jackie Huang 40b73e4660 grub-efi: change to generate EFI image in target package
To generate the target EFI image in a native package, it requires
the host gcc have the ability to do -m32/-m64 compiling, but gcc
doesn't have that support on the 32bit version of some distributions
(e.g. rehl, suse), it would fail when build a 64bit target on these
32bit hosts.

In fact, all we need from grub-efi-native is the grub-mkimage binary,
so change the solution to:
 * grub-efi-native only install grub-mkimage
 * grub-efi compiles target modules, generates EFI image
   with grub-mkimage and deploy, but install nothing.

(From OE-Core rev: 53d3f1273983dfce2a907b39768978afe99aab1a)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-14 09:11:11 +00:00
Jason Wessel 2c99422d96 grub-efi.bbclass: Fix startup.nsh to work on more EFI revs
Some revs of the EFI firmware + shell do not automatically setup the
path in a such a way as to execute a binary without an absolute
reference like "FS0:\EFI\BOOT\bootx64.efi".  All the versions that I
have tested work properly by simply calling the binary which is in the
EFI\BOOT directory by name like "bootx64.efi".

The error you see on the console looks like the following:

startup.nsh> EFI\BOOT\bootx64.efi
'EFI\BOOT\bootx64.efi' is not recognized as an internal or external command, operable program, or batch file
Shell>

This patch simply drops the EFI\BOOT for greater compatibility.

(From OE-Core rev: 754b52ea7a3cdf8e7e939a314525d16c4dfb52cb)

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-11-01 11:09:04 +00:00
Joao Henrique Ferreira de Freitas cc0baf1835 grub-efi.bbclass: Fixes GRUB_IMAGE when using boot-directdisk class
When boot-directdisk class is used and EFI boot is set the
grub-efi-${TRANSLATED_TARGET_ARCH}-native need to be dependent.
Allowing GRUB_IMAGE to be created and bootia32.efi got from the
image directory.

(From OE-Core rev: b9778975db410b8cd01ef6854c7cd3ea22a0b5b7)

Signed-off-by: Joao 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-11-01 11:09:04 +00: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
Jason Wessel 5a2d11e845 grub-efi.bbclass: Add serial and graphics menu options
The syslinux.bbclass already has support for automatically generated
serial and graphics menu choices.  This patch adds the same concept to
the grub-efi menu.  That makes it possible to generate a single image
which can boot on a PCBIOS or EFI firmware with consistent looking
boot options.

[YOCTO #4100]

(From OE-Core rev: 8444199fb598012f54853b010b5e5cce750db89d)

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
Jason Wessel 24ffda4701 bootimage.bbclass, grub-efi.bbclass: Improve EFI & PCBIOS+EFI ISO support
Using the latest mkisofs it is possible to generate 3 different types
of ISO images, which can be used in various scenarios.

1) PCBIOS Only ISO
   - This option remains unchanged by this commit
   - Uses syslinux menus
   - Can be directly copied with dd to a USB device
   - Can be burned to optical media

2) EFI Only ISO
   - Uses grub 2 menus
   - Can be burned to optical media
   - If you want to use this image on a USB device
     extra steps must be taken in order to format the USB
     device with fat32, and copy an EFI loader which will
     in turn load the iso image

3) PCBIOS / EFI ISO
   - This is a hybrid image ISO that will work for case 1 or 2
     as above with the same restrictions and boot menu types
     depending on what type of firmware is installed on
     the hardware or depending on if EFI or "Legacy Boot" is
     enabled on some UEFI firmwares.

The syslinux.bbclass is now always required because that is where the
isohybrid dependencies come from as well as the configuration data for
the isohybrid.  The isohybrid is the secret sauce which allows the ISO
to work as optical media or as a disk image on USB or a HDD/SSD.

[YOCTO #4100]

(From OE-Core rev: a4baf911ab9d306ce5200e7d794ed6a9ccb25f30)

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
Mihai Lindner a807818544 grub-efi: fix Nothing PROVIDES 'grub-efi-x86_64-native'
"ERROR: Nothing PROVIDES 'grub-efi-x86_64-native'" is returned when
trying to build meta-intel/meta-cedartrail with DEFAULTTUNE = "core2-64"
Used TRANSLATED_TARGET_ARCH instead of TARGET_ARCH in grub-efi.bbclass

[YOCTO #3013]

(From OE-Core rev: 20e2aaacb36113604c4ea7c40dd0bbbf224b8360)

Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-25 14:47:00 +01:00
Richard Purdie 48619958d5 meta/classes: Various python whitespace fixes
It was pointed out we have a number of weird indentations in the python functions.
This patch cleans up 3, 7 and other weird indentations for the core bbclass files.

It also fixes some wierd (odd) shell function indentation which my searches picked up.

(From OE-Core rev: 8385d6d74624000d68814f4e3266d47bc8885942)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-08-21 12:15:30 +01:00
Darren Hart 64f7feb5c3 EFI: Make installer EFI aware
[YOCTO #1919]

Create a basic EFI installer script modeled after the existing installer
and add it to a new initramfs-live-install-efi recipe. Update the
init-live.sh script to distinguish between LABEL=install and
LABEL=install-efi and select the appropriate script. Add the efi
installer to core-image-minimal-initramfs.

Update grub-efi.bbclass to use "LABEL=install-efi" when it detects a
label of "install". This is clearly not ideal, but a proper fix would
involve decoupling the LABELS assignment from the image-live.bbclass
usage of SYSLINUX_LABELS. We should be able to address that in a
follow-on clean-up series.

V2: Include missing initramfs-live-install-efi_1.0.bb
V3: Rebase after Radu's console_params fix

(From OE-Core rev: 4bce3417917a3e88ba6529db394525fba82e0699)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-19 17:49:48 +01:00
Darren Hart 67cfa74744 bootimg: Use the same OS files for each boot method
Fixes [YOCTO #1951]

The do_bootimg code can generate hybrid efi+pcbios images (syslinux and
grub-efi) to boot on platforms with both EFI and legacy BIOS options. The
current implementation copies the kernel, initrd, and rootfs twice,
unnecessarily bloating the image size. This is an especially egregious bug
on -sato images.

Update the classes to use a common install of the kernel, initrd, and rootfs to
the root of the boot media. Grub-efi, syslinux, and isolinux can all reference
this location explicitly with a leading slash.

Tested with an EFI+PCBIOS image in both EFI and PCBIOS boot modes on two
platforms. No ISO image testing was performed.

(From OE-Core rev: 5209016cf4c4c8f649e37dc8857b3fbcfe8dd8c8)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-08 00:50:22 +00:00
Darren Hart 4ea37a8f6b grub-efi: Use /EFI/BOOT now that mkdosfs -d works with directories
[Yocto 1783] prevented us from using a proper /EFI/BOOT path in the live
images due to a bug in the -d patch for mkdosfs in dosfstools. With this
now fixed, we can place the efi payload where it belongs per spec and
the images will autoboot to the grub menu on EFI platforms.

(From OE-Core rev: badf0504f5ed4c5e48607922ac15c56463ad09ef)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-16 16:05:35 +00:00
Darren Hart 6a18c3b566 bootimage: Use ${S} explicitly for generated config files
The syslinux and grub-efi classes were generating config files in the current
working directory. This caused a failure due to a race in the creation of the
directories leading to cwd changing and the build failing to find the config
files. While this has been addressed in bitbake, it is better to use an
explicit path.

While ${WORKDIR} may seem a more appropriate place, the recipe
already uses ${S} for the "hdd" and "cd" construction, so we use ${S}
here to keep things consolidated and consistent and address the issue
with minimal change.

(From OE-Core rev: 2c4b1675eb3c8c599e3b7f33e459aa608c2b93f2)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-02 15:28:43 +00:00
Darren Hart eb4aa3483b bootimg: Add grub-efi support
Create a new grub-efi.bbclass and integrate it into bootimg alongside the
syslinux support. This new class uses the output from the grub-efi-native
recipe. Thanks goes to Josef Ahmad <josef.ahmad@intel.com> for the original
build_grub_cfg() routine.

The EFI features are only added to the image if MACHINE_FEATURES contains
"efi". The resulting images are therefor either legacy boot only (like they
were originally) or legacy boot and EFI boot.

A new "dummy.bbclass" was added to allow for the conditional include
of grub-efi. This makes it so if efi support is not to be built in, we
don't spend time building grub-efi-native just because the include adds
the dependency.

There is a bug in the mkdosfs tool from the dosfstools package which causes
it to crash when the directory passed with the -d parameter contains
sub-directories. An /EFI/BOOT directory is required for a proper EFI
installation. Until it is fixed, we install to the top level directory
for the hddimg.

(From OE-Core rev: be95f54495bf9e03062f86b929c66cab6e385a03)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-30 22:18:08 +00:00