diff options
author | Darren Hart <dvhart@linux.intel.com> | 2013-03-19 15:15:04 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-22 16:54:38 +0000 |
commit | d20eea783085e44f3e5c636bd945660b22495044 (patch) | |
tree | 1e4b373ce0b4e80c657fc0b8240ae5aa2f9f40a5 | |
parent | 24cd3ddeb70a3d3f2985ec71c87ae0108f3d2777 (diff) | |
download | poky-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>
-rwxr-xr-x | scripts/contrib/mkefidisk.sh | 16 |
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)) | |||
132 | ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) | 132 | ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) |
133 | SWAP_START=$((ROOTFS_END)) | 133 | SWAP_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) | ||
138 | PART_PREFIX="" | 136 | PART_PREFIX="" |
139 | if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then | 137 | if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ]; then |
140 | PART_PREFIX="p" | 138 | PART_PREFIX="p" |
@@ -143,11 +141,9 @@ BOOTFS=$DEVICE${PART_PREFIX}1 | |||
143 | ROOTFS=$DEVICE${PART_PREFIX}2 | 141 | ROOTFS=$DEVICE${PART_PREFIX}2 |
144 | SWAP=$DEVICE${PART_PREFIX}3 | 142 | SWAP=$DEVICE${PART_PREFIX}3 |
145 | 143 | ||
146 | ROOTWAIT="" | ||
147 | TARGET_PART_PREFIX="" | 144 | TARGET_PART_PREFIX="" |
148 | if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then | 145 | if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then |
149 | TARGET_PART_PREFIX="p" | 146 | TARGET_PART_PREFIX="p" |
150 | ROOTWAIT="rootwait" | ||
151 | fi | 147 | fi |
152 | TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 | 148 | TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 |
153 | TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3 | 149 | TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3 |
@@ -250,10 +246,14 @@ sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG | |||
250 | sed -i "/initrd /d" $GRUBCFG | 246 | sed -i "/initrd /d" $GRUBCFG |
251 | # Delete any LABEL= strings | 247 | # Delete any LABEL= strings |
252 | sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG | 248 | sed -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 | ||
255 | sed -i "s@ root=[^ ]*@ @" $GRUBCFG | 255 | sed -i "s@ root=[^ ]*@ @" $GRUBCFG |
256 | sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro $ROOTWAIT quiet @" $GRUBCFG | 256 | sed -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. |