diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2014-03-06 19:59:07 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-11 09:30:14 -0700 |
commit | 5f05bdda0bf3f9fadf287a0632c2fa697380273f (patch) | |
tree | deb02d53b7f5aeaf5aa54969a60f53fba592061d /meta/recipes-core/initrdscripts | |
parent | 9d04183cf8aed9eaa2aa03058488b1198f73cea0 (diff) | |
download | poky-5f05bdda0bf3f9fadf287a0632c2fa697380273f.tar.gz |
classes: Add gummiboot class
Adds a gummiboot class similar to grub-efi class and makes the necessary
changes so it can be used for live/hddimg images as well.
One can set EFI_PROVIDER = "gummiboot" in local.conf to use gummiboot instead of grub-efi.
Gummiboot requires some kernel options that are not enabled by default, so one has to build
with KERNEL_FEATURES_append = " cfg/efi-ext".
The install scripts have been updated too, keeping the old behaviour around,
but accounting for the new boot loader config files (if they exist).
It can be argued that the installer and bootimg are a bit wierd and not necessarily correct,
but I wanted to have the exact same behviour with gummiboot.
With the default EFI_PROVIDER = "grub-efi" nothing changes, everthing should be just as before.
I've tested live boot, install and normal boot on:
- FRI2
- genericx86-64 on NUC
with:
EFI_PROVIDER = "gummiboot"
KERNEL_FEATURES_append = " cfg/efi-ext"
in local.conf.
(From OE-Core rev: b457e40fc69cc6503dc566f16495f03606e5333b)
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>
Diffstat (limited to 'meta/recipes-core/initrdscripts')
-rw-r--r-- | meta/recipes-core/initrdscripts/files/init-install-efi.sh | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh index 9846637316..ed3221b0a6 100644 --- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh | |||
@@ -104,6 +104,7 @@ parted /dev/${device} mklabel gpt | |||
104 | 104 | ||
105 | echo "Creating boot partition on $bootfs" | 105 | echo "Creating boot partition on $bootfs" |
106 | parted /dev/${device} mkpart primary 0% $boot_size | 106 | parted /dev/${device} mkpart primary 0% $boot_size |
107 | parted /dev/${device} set 1 boot on | ||
107 | 108 | ||
108 | echo "Creating rootfs partition on $rootfs" | 109 | echo "Creating rootfs partition on $rootfs" |
109 | parted /dev/${device} mkpart primary $rootfs_start $rootfs_end | 110 | parted /dev/${device} mkpart primary $rootfs_start $rootfs_end |
@@ -149,23 +150,41 @@ mount $bootfs /ssd | |||
149 | 150 | ||
150 | EFIDIR="/ssd/EFI/BOOT" | 151 | EFIDIR="/ssd/EFI/BOOT" |
151 | mkdir -p $EFIDIR | 152 | mkdir -p $EFIDIR |
152 | GRUBCFG="$EFIDIR/grub.cfg" | ||
153 | |||
154 | cp /media/$1/vmlinuz /ssd | 153 | cp /media/$1/vmlinuz /ssd |
155 | # Copy the efi loader and config (booti*.efi and grub.cfg) | 154 | # Copy the efi loader |
156 | cp /media/$1/EFI/BOOT/* $EFIDIR | 155 | cp /media/$1/EFI/BOOT/*.efi $EFIDIR |
157 | 156 | ||
158 | # Update grub config for the installed image | 157 | if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then |
159 | # Delete the install entry | 158 | GRUBCFG="$EFIDIR/grub.cfg" |
160 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG | 159 | cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG |
161 | # Delete the initrd lines | 160 | # Update grub config for the installed image |
162 | sed -i "/initrd /d" $GRUBCFG | 161 | # Delete the install entry |
163 | # Delete any LABEL= strings | 162 | sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG |
164 | sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG | 163 | # Delete the initrd lines |
165 | # Delete any root= strings | 164 | sed -i "/initrd /d" $GRUBCFG |
166 | sed -i "s/ root=[^ ]*/ /" $GRUBCFG | 165 | # Delete any LABEL= strings |
167 | # Add the root= and other standard boot options | 166 | sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG |
168 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG | 167 | # Delete any root= strings |
168 | sed -i "s/ root=[^ ]*/ /" $GRUBCFG | ||
169 | # Add the root= and other standard boot options | ||
170 | sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG | ||
171 | fi | ||
172 | |||
173 | if [ -d /media/$1/loader ]; then | ||
174 | GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf" | ||
175 | # copy config files for gummiboot | ||
176 | cp -dr /media/$1/loader /ssd | ||
177 | # delete the install entry | ||
178 | rm -f /ssd/loader/entries/install.conf | ||
179 | # delete the initrd lines | ||
180 | sed -i "/initrd /d" $GUMMIBOOT_CFGS | ||
181 | # delete any LABEL= strings | ||
182 | sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS | ||
183 | # delete any root= strings | ||
184 | sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS | ||
185 | # add the root= and other standard boot options | ||
186 | sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS | ||
187 | fi | ||
169 | 188 | ||
170 | umount /ssd | 189 | umount /ssd |
171 | sync | 190 | sync |