summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/mkefidisk.sh
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2013-03-19 15:15:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-22 16:54:38 +0000
commitd20eea783085e44f3e5c636bd945660b22495044 (patch)
tree1e4b373ce0b4e80c657fc0b8240ae5aa2f9f40a5 /scripts/contrib/mkefidisk.sh
parent24cd3ddeb70a3d3f2985ec71c87ae0108f3d2777 (diff)
downloadpoky-d20eea783085e44f3e5c636bd945660b22495044.tar.gz
mkefidisk: Always use rootwait and document kernel parameters used
Without a reliable way of knowing if the target device with be an asyncronous block device on the target (MMC or USB), err on the side of caution of always specifcy "rootwait", ensuring the kernel will wait for the device to appear and not abort if it hasn't appeared in time for mount. Document the remaining kernel parameters added by this script on the same line as rootwait. (From OE-Core rev: 5b6a6a3872fd341cf978be40c69707223e3c29df) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/mkefidisk.sh')
-rwxr-xr-xscripts/contrib/mkefidisk.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 9275ecf17c..f8c08dd204 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -132,9 +132,7 @@ ROOTFS_START=$((BOOT_SIZE))
132ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) 132ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE))
133SWAP_START=$((ROOTFS_END)) 133SWAP_START=$((ROOTFS_END))
134 134
135# MMC devices are special in a couple of ways 135# MMC devices use a partition prefix character 'p'
136# 1) they use a partition prefix character 'p'
137# 2) they are detected asynchronously (need ROOTWAIT)
138PART_PREFIX="" 136PART_PREFIX=""
139if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then 137if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then
140 PART_PREFIX="p" 138 PART_PREFIX="p"
@@ -143,11 +141,9 @@ BOOTFS=$DEVICE${PART_PREFIX}1
143ROOTFS=$DEVICE${PART_PREFIX}2 141ROOTFS=$DEVICE${PART_PREFIX}2
144SWAP=$DEVICE${PART_PREFIX}3 142SWAP=$DEVICE${PART_PREFIX}3
145 143
146ROOTWAIT=""
147TARGET_PART_PREFIX="" 144TARGET_PART_PREFIX=""
148if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then 145if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then
149 TARGET_PART_PREFIX="p" 146 TARGET_PART_PREFIX="p"
150 ROOTWAIT="rootwait"
151fi 147fi
152TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 148TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2
153TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3 149TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3
@@ -250,10 +246,14 @@ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
250sed -i "/initrd /d" $GRUBCFG 246sed -i "/initrd /d" $GRUBCFG
251# Delete any LABEL= strings 247# Delete any LABEL= strings
252sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG 248sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
253# Replace the ramdisk root (if any) with the install device and include other 249# Remove any existing root= kernel parameters and:
254# kernel parameters 250# o Add a root= parameter with the target rootfs
251# o Specify ro so fsck can be run during boot
252# o Specify rootwait in case the target media is an asyncronous block device
253# such as MMC or USB disks
254# o Specify "quiet" to minimize boot time when using slow serial consoles
255sed -i "s@ root=[^ ]*@ @" $GRUBCFG 255sed -i "s@ root=[^ ]*@ @" $GRUBCFG
256sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro $ROOTWAIT quiet @" $GRUBCFG 256sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait quiet @" $GRUBCFG
257 257
258# Provide a startup.nsh script for older firmware with non-standard boot 258# Provide a startup.nsh script for older firmware with non-standard boot
259# directories and paths. 259# directories and paths.