summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorJérémy Rosen <jeremy.rosen@openwide.fr>2016-03-11 11:38:31 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-20 23:12:27 +0000
commit21916234dd972d3fcef43c96b842f797dd1947ae (patch)
tree7a5b2a92d819abf9f56552824106fdb84d53e66b /meta
parent57a525ca7271a8fe3913c61aa87cb0ba1674b4b2 (diff)
downloadpoky-21916234dd972d3fcef43c96b842f797dd1947ae.tar.gz
init-live : make it easier to add custom boot targets
When booting from the live image, the label from the bootloader is passed to init.sh. init.sh uses the label to either boot a live image or call a script to take over and install the system. It is possible to add new labels to the bootloader via the LABELS family of variables, but the names in init.sh were hardcoded to install and install-efi this patch checks if a shell script with the same name as the label is available instead of using a hardcoded list. Any recipe can add such file and this provide a new boot target to the live image (From OE-Core rev: 2c10ca0fe612818cb43931b969ad2af5502f1e84) Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/initrdscripts/files/init-live.sh18
1 files changed, 6 insertions, 12 deletions
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index d852c5737f..f698535980 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -214,11 +214,7 @@ mount_and_boot() {
214 boot_live_root 214 boot_live_root
215} 215}
216 216
217case $label in 217if [ "$label" != "boot" -a -f $label.sh ] ; then
218 boot)
219 mount_and_boot
220 ;;
221 install|install-efi)
222 if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then 218 if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
223 ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params 219 ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
224 else 220 else
@@ -226,10 +222,8 @@ case $label in
226 fi 222 fi
227 223
228 # If we're getting here, we failed... 224 # If we're getting here, we failed...
229 fatal "Installation image failed" 225 fatal "Target $label failed"
230 ;; 226fi
231 *) 227
232 # Not sure what boot label is provided. Try to boot to avoid locking up. 228mount_and_boot
233 mount_and_boot 229
234 ;;
235esac