diff options
author | Thomas Bächler <thomas@archlinux.org> | 2009-09-30 17:59:23 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2009-09-30 17:59:23 +0200 |
commit | 540664b91daf6d603e26693cc7723765b7f242ff (patch) | |
tree | b6efac0fc5ea9a95eab1781232045d6ba200fe72 | |
parent | 19613eb947f676350afdf559a79213fb319819f3 (diff) | |
download | mkinitcpio-540664b91daf6d603e26693cc7723765b7f242ff.tar.gz mkinitcpio-540664b91daf6d603e26693cc7723765b7f242ff.tar.xz |
rootdelay check: Fix compatibility with other sh implementations than dash and make it more reliable
The old implementation failed on bash and failed on both if rootdelay was not a number.
The logic is now as follows:
If "$rootdelay"="", then [ -z "${rootdelay}" ] is true
If not, then the part after the || is executed - if ${rootdelay} is not a number, or is <0, then [ ${rootdelay} -ge 0 ] fails,
and the test will return true due to the !. The previous implementation failed here, because [ ! ${rootdelay} -ge 0 ] returns false
on error, while ! [ ${rootdelay} -ge 0 ] returns true on error.
-rw-r--r-- | init | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -64,7 +64,7 @@ for m in ${MODULES}; do done # If rootdelay is empty or not a non-negative integer, set it to 10 -if [ -z "${rootdelay}" -o ! "${rootdelay}" -ge 0 ]; then +if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then export rootdelay=10 fi # We'll wait for the root device, so make sure klibc doesn't |