[oe-commits] [openembedded-core] 10/66: init-live : make it easier to add custom boot targets

git at git.openembedded.org git at git.openembedded.org
Sun Mar 20 23:13:21 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 2c10ca0fe612818cb43931b969ad2af5502f1e84
Author: Jérémy Rosen <jeremy.rosen at openwide.fr>
AuthorDate: Fri Mar 11 11:38:31 2016 +0100

    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
    
    Signed-off-by: Jérémy Rosen <jeremy.rosen at openwide.fr>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh | 18 ++++++------------
 1 file 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 d852c57..f698535 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() {
     boot_live_root
 }
 
-case $label in
-    boot)
-	mount_and_boot
-	;;
-    install|install-efi)
+if [ "$label" != "boot" -a -f $label.sh ] ; then
 	if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
 	    ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
 	else
@@ -226,10 +222,8 @@ case $label in
 	fi
 
 	# If we're getting here, we failed...
-	fatal "Installation image failed"
-	;;
-    *)
-	# Not sure what boot label is provided.  Try to boot to avoid locking up.
-	mount_and_boot
-	;;
-esac
+	fatal "Target $label failed"
+fi
+
+mount_and_boot
+

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list