Update imaging script.
This commit is contained in:
parent
61977a2ffe
commit
1d13602819
@ -115,8 +115,8 @@ else
|
|||||||
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
|
echo "Error: Unsupported platform $OSTYPE, sorry" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
question "Prepare baseline Raspbian:"
|
question "Prepare baseline Raspberry Pi OS Lite:"
|
||||||
echo "* Flash Raspbian Lite with Etcher"
|
echo "* Flash the OS with Raspberry Pi Imager"
|
||||||
echo "* Eject the SD card"
|
echo "* Eject the SD card"
|
||||||
echo "* Mount the card back"
|
echo "* Mount the card back"
|
||||||
echo "* Wait for your OS to mount it"
|
echo "* Wait for your OS to mount it"
|
||||||
@ -252,13 +252,10 @@ ssh "chromium-browser --version | cut -d ' ' -f 1-2" > temp
|
|||||||
VERSION_CHROMIUM="$(cat temp)"
|
VERSION_CHROMIUM="$(cat temp)"
|
||||||
rm temp
|
rm temp
|
||||||
|
|
||||||
working "Removing SSH host keys & enabling regeneration"
|
working "Disabling SSH access & restoring safe defaults & shutting down"
|
||||||
ssh "sudo rm -f -v /etc/ssh/ssh_host_*_key* && sudo systemctl enable regenerate_ssh_host_keys"
|
tempFile="$(ssh mktemp)" # need to do this via a temp file on the host, otherwise disabling SSH while using SSH ends up being problematic
|
||||||
|
|
||||||
working "Removing temporary SSH pubkey, disabling SSH & shutting down"
|
|
||||||
tempFile="$(ssh mktemp)"
|
|
||||||
ssh "chmod a+x $tempFile"
|
ssh "chmod a+x $tempFile"
|
||||||
ssh "echo 'rm .ssh/authorized_keys && systemctl disable ssh && poweroff' > $tempFile"
|
ssh "echo 'rm -f /etc/ssh/ssh_host_*_key*; systemctl enable regenerate_ssh_host_keys; rm .ssh/authorized_keys; systemctl disable ssh; poweroff' > $tempFile"
|
||||||
ssh "sudo nohup $tempFile"
|
ssh "sudo nohup $tempFile"
|
||||||
|
|
||||||
question "Eject the SD card from the Pi, and mount it back to this computer"
|
question "Eject the SD card from the Pi, and mount it back to this computer"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user