#2919 sdcard size & shrink process

This commit is contained in:
rootzoll 2022-02-06 19:05:54 +01:00
parent 332f4d0574
commit 930caca038
4 changed files with 11 additions and 7 deletions

12
FAQ.md
View File

@ -669,7 +669,8 @@ Work notes for the process of producing a new SD card image release:
* The result should say "correct signature" and the fingerprint should end with `8738 CD6B 956F 460C`
* Insert an NTFS formatted USB stick and use the file manager to move all files to the USB
* Use in file manager context on NTFS USB stick `extract here` to unzip
* Connect SD card reader with a 8GB SD card
* Download script for later with `curl https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh > pishrink.sh`
* Connect SD card reader with a SD card (16GB recommended)
* In the file manager open context on the .img-file, select `Open With Disk Image Writer` and write the image to the SD card
* In the file manager open context on `boot` drive free space `open in terminal`
* Run the commands: `touch ssh` and `exit`
@ -685,7 +686,7 @@ Work notes for the process of producing a new SD card image release:
* Disconnect WiFi/LAN on build laptop (hardware switch off) and shutdown
* Remove `Ubuntu LIVE` USB stick and cut power from the RaspberryPi
* Connect USB stick with latest `TAILS` (make it stay offline)
* Power on the Build Laptop (press F12 for boot menu)
* Boot Tails with extra setting of Admin-Passwort and remember (use later for sudo)
* Connect USB stick with GPG signing keys - decrypt drive if needed
* Open Terminal and cd into directory of USB Stick under `/media/amnesia`
* Run `gpg --import ./sub.key`, check and `exit`
@ -694,8 +695,12 @@ Work notes for the process of producing a new SD card image release:
* Click on `boot` volume once in the file manger
* Connect the NTFS USB stick, open in file manager and delete old files
* Open Terminal and cd into directory of NTFS USB stick under `/media/amnesia`
* `sahsum -a 256 ./pishrink.sh` should be `e46e1e1e3c6e3555f9fff5435e2305e99b98aaa8dc28db1814cf861fbb472a69`
* if not: review changes in latest pishrink script
* Run `df` to check on the SD card device name (`boot` - ignore last partition number)
* `dd if=/dev/[sdcarddevice] | gzip > ./raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz`
* `dd if=/dev/[sdcarddevice] of=./raspiblitz.img`
* `chmod +x ./pishrink.sh | sudo ./pishrink.sh ./raspiblitz.img`
* `gzip ./raspiblitz.img > ./raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz`
* When finished you should see that more then 7GB were copied
* Then run `shasum -a 256 *.gz > sha256.txt`
* Sign with `gpg --output raspiblitz-vX.X-YEAR-MONTH-DAY.img.gz.sig --detach-sign *.gz`
@ -707,7 +712,6 @@ Work notes for the process of producing a new SD card image release:
### How can I customize my RaspiBlitz or add other software?
The RaspiBlitz is your computer to experiment with. Feel free to add your own scripts, edit the system or install further software from the command line. Just keep in mind that after an update/recovery the RaspiBlitz starts with a fresh and clean operating system again. So all your editings and installs might be gone. To prevent this you should do the following:

View File

@ -255,7 +255,7 @@ if [ "${needsExpansion}" == "1" ] && [ "${fsexpanded}" == "0" ]; then
/home/admin/_cache.sh set message "FSEXPAND"
elif [ "${tooSmall}" == "1" ]; then
echo "!!! FAIL !!!!!!!!!!!!!!!!!!!!" >> $logFile
echo "SDCARD TOO SMALL 32GB minimum" >> $logFile
echo "SDCARD TOO SMALL 16GB minimum" >> $logFile
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> $logFile
/home/admin/_cache.sh set state "sdtoosmall"
echo "System stopped. Please cut power." >> $logFile

View File

@ -28,7 +28,7 @@ action=$1
# STATUS
# gather data on sd card
minimumSizeByte=16400000000
minimumSizeByte=8192000000
rootPartition=$(sudo mount | grep " / " | cut -d " " -f 1 | cut -d "/" -f 3)
rootPartitionBytes=$(lsblk -b -o NAME,SIZE | grep "${rootPartition}" | tr -s ' ' | cut -d " " -f 2)

View File

@ -321,7 +321,7 @@ elif [ "${eventID}" == "sdtoosmall" ]; then
# contentWords[0] --> size string (for example '16GB')
dialog --backtitle "${backtitle}" --cr-wrap --infobox "
PROBLEM: SD CARD IS TOO SMALL
Minimum of ${contentWords[0]} needed
Capacity of 32GB recommended
Cut power & create fresh sd card
" 7 40