From c0b3bd68ac241d8d5e5df0e9cd7e11e8050aab66 Mon Sep 17 00:00:00 2001 From: "Carl D. Roth" Date: Thu, 27 Jul 2017 16:54:16 -0700 Subject: [PATCH] Pick the largest squashfs --- packages/base/all/initrds/loader-initrd-files/src/bin/boot | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/boot b/packages/base/all/initrds/loader-initrd-files/src/bin/boot index 9dcc1db7..c83658d7 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/boot +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/boot @@ -189,7 +189,8 @@ else set dummy $(df -k -P "$workmnt" | tail -1) tmpavail=$5 - # estimate the squashfs size + # estimate the squashfs size based on the largest one here + # (there may be more than one arch in the SWI file) squashsz=0 ifs=$IFS; IFS=$CR for line in $(unzip -ql "$swipath"); do @@ -197,7 +198,9 @@ else set dummy $line case "$5" in *.sqsh) - squashsz=$(( $squashsz + $2 )) + if [ "$2" -gt $squashsz ]; then + squashsz=$2 + fi ;; esac done