From bbf0c76739b5aa74ec2e06f78eff54b99554b4a6 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Tue, 17 Dec 2024 17:16:01 -0800 Subject: [PATCH] setup: add option to install.sh to skip resizing Use "... | bash -s norootshrink" to skip shrinking the root partition, for the case where an external drive will be used for subsequent setup. --- setup/generic/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/generic/install.sh b/setup/generic/install.sh index 22d15efc..3ff3a399 100644 --- a/setup/generic/install.sh +++ b/setup/generic/install.sh @@ -58,7 +58,7 @@ lastpart=$(sfdisk -q -l "$rootdev" | tail +2 | sort -n -k 2 | tail -1 | awk '{pr # TODO: provide a way to skip this, to support having boot+root on # eMMC or sd card, and storage elsewhere unpart=$(sfdisk -F "$rootdev" | grep -o '[0-9]* bytes' | head -1 | awk '{print $1}') -if [ "$unpart" -lt $(( (1<<30) * 32)) ] +if [ "${1:-}" != "norootshrink" ] && [ "$unpart" -lt $(( (1<<30) * 32)) ] then # This script will only shrink the root partition, and if there's another # partition following the root partition, we won't be able to grow the @@ -98,9 +98,6 @@ then EOF chmod a+x /etc/rc.local - # The user should have configured networking manually, so disable wifi setup - touch /teslausb/WIFI_ENABLED - if [ ! -e "/boot/initrd.img-$(uname -r)" ] then # This device did not boot using an initramfs. If we're running @@ -165,6 +162,9 @@ then done fi +# The user should have configured networking manually, so disable wifi setup +touch /teslausb/WIFI_ENABLED + # Copy our rc.local from github, which will allow setup to # continue using the regular "one step setup" process used # for setting up a Raspberry Pi with the prebuilt image