Skip to content

Commit

Permalink
setup: add option to install.sh to skip resizing
Browse files Browse the repository at this point in the history
Use "... | bash -s norootshrink" to skip shrinking the root partition,
for the case where an external drive will be used for subsequent setup.
  • Loading branch information
marcone committed Dec 18, 2024
1 parent 00332e6 commit bbf0c76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions setup/generic/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbf0c76

Please sign in to comment.