diff options
Diffstat (limited to 'scripts/build/binary_onie')
-rwxr-xr-x | scripts/build/binary_onie | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/scripts/build/binary_onie b/scripts/build/binary_onie index 45700d4d5..7f1ba7337 100755 --- a/scripts/build/binary_onie +++ b/scripts/build/binary_onie @@ -89,22 +89,22 @@ sha1=\$(sed -e '1,/^exit_marker$/d' "\$0" | sha1sum | awk '{ print \$1 }') payload_sha1=%%IMAGE_SHA1%% if [ "\$sha1" != "\$payload_sha1" ] ; then - echo - echo "ERROR: Unable to verify archive checksum" - echo "Expected: \$payload_sha1" - echo "Found : \$sha1" - exit 1 + echo + echo "ERROR: Unable to verify archive checksum" + echo "Expected: \$payload_sha1" + echo "Found : \$sha1" + exit 1 fi echo " OK." tmp_dir= clean_up() { - if [ "\$(id -u)" = "0" ] ; then - umount \$tmp_dir > /dev/null 2>&1 - fi - rm -rf \$tmp_dir - exit \$1 + if [ "\$(id -u)" = "0" ] ; then + umount \$tmp_dir > /dev/null 2>&1 + fi + rm -rf \$tmp_dir + exit \$1 } # Untar and launch install script in a tmpfs @@ -112,7 +112,7 @@ cur_wd=\$(pwd) archive_path=\$(realpath "\$0") tmp_dir=\$(mktemp -d) if [ "\$(id -u)" = "0" ] ; then - mount -t tmpfs tmpfs-installer \$tmp_dir || clean_up 1 + mount -t tmpfs tmpfs-installer \$tmp_dir || clean_up 1 fi cd \$tmp_dir echo -n "Preparing image archive ..." @@ -123,22 +123,22 @@ cd \$cur_wd extract=no args=":x" while getopts "\$args" a ; do - case \$a in - x) - extract=yes - ;; - *) - ;; - esac + case \$a in + x) + extract=yes + ;; + *) + ;; + esac done if [ "\$extract" = "yes" ] ; then - # stop here - echo "Image extracted to: \$tmp_dir" - if [ "\$(id -u)" = "0" ] ; then - echo "To un-mount the tmpfs when finished type: umount \$tmp_dir" - fi - exit 0 + # stop here + echo "Image extracted to: \$tmp_dir" + if [ "\$(id -u)" = "0" ] ; then + echo "To un-mount the tmpfs when finished type: umount \$tmp_dir" + fi + exit 0 fi \$tmp_dir/installer/install.sh "\$@" @@ -227,14 +227,14 @@ echo -n "." KERNEL='vmlinuz' IN_KERNEL=$EXTRACTDIR/live/$KERNEL [ -r $IN_KERNEL ] || { - echo "ERROR: Unable to find kernel in ISO: $IN_KERNEL" - exit 1 + echo "ERROR: Unable to find kernel in ISO: $IN_KERNEL" + exit 1 } INITRD='initrd.img' IN_INITRD=$WORKDIR/$INITRD [ -r $IN_INITRD ] || { - echo "ERROR: Unable to find initrd in ISO: $IN_INITRD" - exit 1 + echo "ERROR: Unable to find initrd in ISO: $IN_INITRD" + exit 1 } # Note: specify kernel args you want the Debian installer to @@ -265,7 +265,7 @@ cd \$(dirname \$0) # remove old partitions for p in \$(seq 3 9) ; do - sgdisk -d \$p /dev/vda > /dev/null 2&>1 + sgdisk -d \$p /dev/vda > /dev/null 2&>1 done # bonk out on errors @@ -279,9 +279,9 @@ bits=\$(echo \$bits | grep -o [5-8]) con='' if [ -n "\$speed" ]; then - con="console=\$tty,\${speed}n\${bits}" + con="console=\$tty,\${speed}n\${bits}" else - con="console=\$tty" + con="console=\$tty" fi echo "using \$con" @@ -290,7 +290,7 @@ kcmd_console=\$(cat /proc/cmdline | grep -o 'console=.* ') kcmd_console=\$(echo \$kcmd_console | cut -d' ' -f2) # remove tty0 if [ \${kcmd_console}x != \${con}x ]; then - echo "WARNING: Detected console does not match boot console: \$kcmd_console != \$con" + echo "WARNING: Detected console does not match boot console: \$kcmd_console != \$con" fi echo "Loading new kernel ..." @@ -305,13 +305,13 @@ echo -n "." # Repackage $INSTALLDIR into a self-extracting installer image sharch="$WORKDIR/sharch.tar" tar -C $WORKDIR -cf $sharch installer || { - echo "Error: Problems creating $sharch archive" - exit 1 + echo "Error: Problems creating $sharch archive" + exit 1 } [ -f "$sharch" ] || { - echo "Error: $sharch not found" - exit 1 + echo "Error: $sharch not found" + exit 1 } echo -n "." @@ -319,8 +319,8 @@ sha1=$(cat $sharch | sha1sum | awk '{print $1}') echo -n "." cp sharch_body.sh $output_file || { - echo "Error: Problems copying sharch_body.sh" - exit 1 + echo "Error: Problems copying sharch_body.sh" + exit 1 } # Replace variables in the sharch template |