Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
install_raspbian_on_f2fs_root [09.08.2020 18:27] – Pascal Suter | install_raspbian_on_f2fs_root [22.12.2020 18:33] (current) – Pascal Suter | ||
---|---|---|---|
Line 38: | Line 38: | ||
fi | fi | ||
- | if ! kpartx -l $image | + | if ! kpartx -l $image |
echo " | echo " | ||
echo "image $image not readable by kpartx or kpartx not found" | echo "image $image not readable by kpartx or kpartx not found" | ||
Line 70: | Line 70: | ||
echo " | echo " | ||
} | } | ||
- | trap clean_up EXIT | + | trap clean_up EXIT SIGINT |
echo "make sure the card is unmounted" | echo "make sure the card is unmounted" | ||
Line 81: | Line 81: | ||
echo " | echo " | ||
parted -s $card mklabel msdos | parted -s $card mklabel msdos | ||
- | parted -s $card mkpart primary 0% 256MB | + | parted -s $card mkpart primary |
parted -s $card mkpart primary 256MB 100% | parted -s $card mkpart primary 256MB 100% | ||
partprobe $card | partprobe $card | ||
sleep 2 | sleep 2 | ||
+ | |||
+ | if echo " | ||
+ | partbase=" | ||
+ | else | ||
+ | partbase=$card | ||
+ | fi | ||
echo " | echo " | ||
- | mkfs.vfat ${card}1 | + | mkfs.vfat ${partbase}1 |
echo " | echo " | ||
- | mkfs.f2fs -f ${card}2 | + | mkfs.f2fs -f ${partbase}2 |
echo " | echo " | ||
mkdir -p / | mkdir -p / | ||
- | mount ${card}1 /tmp/sd | + | mount ${partbase}1 /tmp/sd |
echo "load image as loopback device and mount boot partition" | echo "load image as loopback device and mount boot partition" | ||
Line 106: | Line 112: | ||
echo " | echo " | ||
- | partuuidbase=$(blkid | + | partuuidbase=$(blkid |
sed -i " | sed -i " | ||
- | sed -i ' | + | sed -i ' |
+ | sed -i ' | ||
echo | echo | ||
Line 144: | Line 151: | ||
umount /tmp/sd | umount /tmp/sd | ||
umount /tmp/img | umount /tmp/img | ||
- | mount ${card}2 /tmp/sd | + | mount ${partbase}2 /tmp/sd |
mount / | mount / | ||
Line 154: | Line 161: | ||
sed -i " | sed -i " | ||
sed -i ' | sed -i ' | ||
+ | rm -f / | ||
if [ $ssh -eq 1 ]; then | if [ $ssh -eq 1 ]; then | ||
Line 161: | Line 169: | ||
touch {/ | touch {/ | ||
chmod 600 {/ | chmod 600 {/ | ||
+ | chown -R 1000 / | ||
echo "done, to add your private key, boot the raspberry pi and login as user pi with password \" | echo "done, to add your private key, boot the raspberry pi and login as user pi with password \" | ||
fi | fi | ||
Line 179: | Line 188: | ||
fi | fi | ||
echo | echo | ||
- | echo "okay, we are done, time to clean up! mind you, this can take some time as we weill have to wait for everything to be written to the SD card. do not abort!" | + | echo 'okay, we are done, time to clean up! mind you, this can take some time as we weill have to wait for everything to be written to the SD card. do not abort!' |
umount /tmp/sd | umount /tmp/sd | ||
umount /tmp/img | umount /tmp/img | ||
Line 186: | Line 195: | ||
echo | echo | ||
echo "you are all set, you can now remove the sd card and put it into your raspberry, boot it up and start using it" | echo "you are all set, you can now remove the sd card and put it into your raspberry, boot it up and start using it" | ||
- | echo "if you want to insert this card into your pc in the future to modify some things on it, I strongly recommend to disable gnomes automount temporarily, | + | echo 'if you want to insert this card into your pc in the future to modify some things on it, I strongly recommend to disable gnomes automount temporarily, |
echo "to do that you can simply run this command:" | echo "to do that you can simply run this command:" | ||
echo " | echo " | ||
echo "to re-enable simply use ' | echo "to re-enable simply use ' | ||
+ | trap - EXIT | ||
</ | </ | ||