install_raspbian_on_f2fs_root

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 21:05] – [the script] Pascal Suterinstall_raspbian_on_f2fs_root [22.12.2020 18:33] (current) Pascal Suter
Line 38: Line 38:
 fi fi
  
-if ! kpartx -l $image  | grep -q "loop.p1 : 0"; then +if ! kpartx -l $image  | grep -q "loop.\+p1 : 0"; then 
     echo "ERROR"     echo "ERROR"
     echo "image $image not readable by kpartx or kpartx not found"     echo "image $image not readable by kpartx or kpartx not found"
Line 85: Line 85:
 partprobe $card partprobe $card
 sleep 2 sleep 2
 +
 +if echo "$card" | grep -q "mmcblk"; then 
 +    partbase="${card}p"
 +else
 +    partbase=$card
 +fi
  
 echo "format boot partition" echo "format boot partition"
-mkfs.vfat ${card}1+mkfs.vfat ${partbase}1
  
 echo "format os partition with f2fs" echo "format os partition with f2fs"
-mkfs.f2fs -f ${card}2+mkfs.f2fs -f ${partbase}2
  
 echo "create mountpoints and mount boot partition" echo "create mountpoints and mount boot partition"
 mkdir -p /tmp/{sd,img} mkdir -p /tmp/{sd,img}
-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 "adjust cmdline.txt" echo "adjust cmdline.txt"
-partuuidbase=$(blkid /dev/sdb | sed -e 's/^.*PTUUID="\([^"]*\)".*$/\1/')+partuuidbase=$(blkid $card | 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
Line 145: 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 /dev/mapper/${loopdev}p2 /tmp/img mount /dev/mapper/${loopdev}p2 /tmp/img
  
  • install_raspbian_on_f2fs_root.txt
  • Last modified: 22.12.2020 18:33
  • by Pascal Suter