Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/bootconfig: Improve portability

Since 'stat' command and 'truncate' command are GNU extension,
use 'wc' and 'dd' commands instead.

Link: https://lore.kernel.org/all/175211424184.2591046.3523297993175066026.stgit@mhiramat.tok.corp.google.com/

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

+7 -6
+7 -6
tools/bootconfig/test-bootconfig.sh
··· 49 49 50 50 dd if=/dev/zero of=$INITRD bs=4096 count=1 51 51 echo "key = value;" > $TEMPCONF 52 - bconf_size=$(stat -c %s $TEMPCONF) 53 - initrd_size=$(stat -c %s $INITRD) 52 + bconf_size=$(wc -c < $TEMPCONF) 53 + initrd_size=$(wc -c < $INITRD) 54 54 55 55 echo "Apply command test" 56 56 xpass $BOOTCONF -a $TEMPCONF $INITRD 57 - new_size=$(stat -c %s $INITRD) 57 + new_size=$(wc -c < $INITRD) 58 58 59 59 echo "Show command test" 60 60 xpass $BOOTCONF $INITRD ··· 69 69 xpass $BOOTCONF -a $TEMPCONF $INITRD 70 70 71 71 echo "File size check" 72 - xpass test $new_size -eq $(stat -c %s $INITRD) 72 + xpass test $new_size -eq $(wc -c < $INITRD) 73 73 74 74 echo "Delete command check" 75 75 xpass $BOOTCONF -d $INITRD 76 76 77 77 echo "File size check" 78 - new_size=$(stat -c %s $INITRD) 78 + new_size=$(wc -c < $INITRD) 79 79 xpass test $new_size -eq $initrd_size 80 80 81 81 echo "No error messge while applying" ··· 108 108 echo "\"" >> $TEMPCONF 109 109 xfail $BOOTCONF -a $TEMPCONF $INITRD 110 110 111 - truncate -s 32764 $TEMPCONF 111 + dd if=$TEMPCONF of=$OUTFILE bs=1 count=32764 112 + cp $OUTFILE $TEMPCONF 112 113 echo "\"" >> $TEMPCONF # add 2 bytes + terminal ('\"\n\0') 113 114 xpass $BOOTCONF -a $TEMPCONF $INITRD 114 115