Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
install_raspbian_on_f2fs_root [09.08.2020 18:27]
Pascal Suter
install_raspbian_on_f2fs_root [09.08.2020 21:05] (current)
Pascal Suter [the script]
Line 70: Line 70:
     echo "​aborted"​     echo "​aborted"​
 } }
-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 "​create new partitions"​ echo "​create new partitions"​
 parted -s $card mklabel msdos parted -s $card mklabel msdos
-parted -s $card mkpart primary 0% 256MB+parted -s $card mkpart primary ​fat32 0% 256MB
 parted -s $card mkpart primary 256MB 100% parted -s $card mkpart primary 256MB 100%
 partprobe $card partprobe $card
Line 108: Line 108:
 partuuidbase=$(blkid /dev/sdb | sed -e '​s/​^.*PTUUID="​\([^"​]*\)"​.*$/​\1/'​) partuuidbase=$(blkid /dev/sdb | sed -e '​s/​^.*PTUUID="​\([^"​]*\)"​.*$/​\1/'​)
 sed -i "​s/​\(PARTUUID=\)[^ ]*\(-02 \)/​\1$partuuidbase\2/"​ /​tmp/​sd/​cmdline.txt sed -i "​s/​\(PARTUUID=\)[^ ]*\(-02 \)/​\1$partuuidbase\2/"​ /​tmp/​sd/​cmdline.txt
-sed -i '​s/​init=[^ ]* / /' /​tmp/​sd/​cmdline.txt+sed -i '​s/​init=[^ ]*//' /​tmp/​sd/​cmdline.txt 
 +sed -i '​s/​ext4/​f2fs/' /​tmp/​sd/​cmdline.txt
  
 echo echo
Line 154: Line 155:
 sed -i "​s/​\(PARTUUID=\)[^ ]*\(-0[12] \)/​\1$partuuidbase\2/"​ /​tmp/​sd/​etc/​fstab sed -i "​s/​\(PARTUUID=\)[^ ]*\(-0[12] \)/​\1$partuuidbase\2/"​ /​tmp/​sd/​etc/​fstab
 sed -i '​s/​ext4/​f2fs/'​ /​tmp/​sd/​etc/​fstab sed -i '​s/​ext4/​f2fs/'​ /​tmp/​sd/​etc/​fstab
 +rm -f /​tmp/​sd/​etc/​rc3.d/​S01resize2fs_once
  
 if [ $ssh -eq 1 ]; then if [ $ssh -eq 1 ]; then
Line 161: Line 163:
     touch {/​tmp/​sd/​root/​.ssh,/​tmp/​sd/​home/​pi/​.ssh}/​authorized_keys     touch {/​tmp/​sd/​root/​.ssh,/​tmp/​sd/​home/​pi/​.ssh}/​authorized_keys
     chmod 600 {/​tmp/​sd/​root/​.ssh,/​tmp/​sd/​home/​pi/​.ssh}/​authorized_keys     chmod 600 {/​tmp/​sd/​root/​.ssh,/​tmp/​sd/​home/​pi/​.ssh}/​authorized_keys
 +    chown -R 1000 /​tmp/​sd/​home/​pi/​.ssh
     echo "done, to add your private key, boot the raspberry pi and login as user pi with password \"​raspberry\"​ to add your public key to those files. make sure you don't forget to chagne the default password!"​     echo "done, to add your private key, boot the raspberry pi and login as user pi with password \"​raspberry\"​ to add your public key to those files. make sure you don't forget to chagne the default password!"​
 fi fi
Line 179: Line 182:
 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 189:
 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,​ as it may mess up your f2fs filesystem"+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,​ as it may mess up your f2fs filesystem'
 echo "to do that you can simply run this command:"​ echo "to do that you can simply run this command:"​
 echo " ​   gsettings set org.gnome.desktop.media-handling automount '​false'"​ echo " ​   gsettings set org.gnome.desktop.media-handling automount '​false'"​
 echo "to re-enable simply use '​true'​ as value instead"​ echo "to re-enable simply use '​true'​ as value instead"​
 +trap - EXIT
 </​code>​ </​code>​