summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initrdscripts/initramfs-framework/init
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/initrdscripts/initramfs-framework/init')
-rwxr-xr-xmeta/recipes-core/initrdscripts/initramfs-framework/init20
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
index 37527a840a..567694aff7 100755
--- a/meta/recipes-core/initrdscripts/initramfs-framework/init
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -72,6 +72,7 @@ ROOTFS_DIR="/rootfs" # where to do the switch root
MODULE_PRE_HOOKS="" # functions to call before running each module
MODULE_POST_HOOKS="" # functions to call after running each module
MODULES_DIR=/init.d # place to look for modules
+EFI_DIR=/sys/firmware/efi # place to store device firmware information
# make mount stop complaining about missing /etc/fstab
touch /etc/fstab
@@ -81,14 +82,31 @@ mkdir -p /proc /sys /run/lock /var/lock
mount -t proc proc /proc
mount -t sysfs sysfs /sys
+if [ -d $EFI_DIR ];then
+ mount -t efivarfs none /sys/firmware/efi/efivars
+fi
+
# populate bootparam environment
for p in `cat /proc/cmdline`; do
+ if [ -n "$quoted" ]; then
+ value="$value $p"
+ if [ "`echo $p | sed -e 's/\"$//'`" != "$p" ]; then
+ eval "bootparam_${quoted}=${value}"
+ unset quoted
+ fi
+ continue
+ fi
+
opt=`echo $p | cut -d'=' -f1`
- opt=`echo $opt | tr '.-' '__'`
+ opt=`echo $opt | sed -e 'y/.-/__/'`
if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
eval "bootparam_${opt}=true"
else
value="`echo $p | cut -d'=' -f2-`"
+ if [ "`echo $value | sed -e 's/^\"//'`" != "$value" ]; then
+ quoted=${opt}
+ continue
+ fi
eval "bootparam_${opt}=\"${value}\""
fi
done