Advertisement
Guest User

f2fs rootfs patches for armbian

a guest
Jul 3rd, 2015
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.43 KB | None | 0 0
  1. diff --git a/common.sh b/common.sh
  2. index 46fbb26..67f0fc4 100644
  3. --- a/common.sh
  4. +++ b/common.sh
  5. @@ -460,7 +460,7 @@ mv $DEST/output/tmprootfs.raw $DEST/output/$VERSION.raw
  6.  sync
  7.  sleep 2
  8.  # let's shrint it
  9. -shrinking_raw_image "$DEST/output/$VERSION.raw"
  10. +# shrinking_raw_image "$DEST/output/$VERSION.raw"
  11.  sleep 2
  12.  cd $DEST/output/
  13.  cp $SRC/lib/bin/imagewriter.exe .
  14. diff --git a/config/boot.cmd b/config/boot.cmd
  15. index 5aaae32..b41db4f 100644
  16. --- a/config/boot.cmd
  17. +++ b/config/boot.cmd
  18. @@ -1,13 +1,13 @@
  19. -setenv bootargs console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1
  20. +setenv bootargs console=tty1 root=/dev/mmcblk0p2 rootwait rootfstype=f2fs sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1
  21.  #--------------------------------------------------------------------------------------------------------------------------------
  22.  # Boot loader script to boot with different boot methods for old and new kernel
  23.  #--------------------------------------------------------------------------------------------------------------------------------
  24. -if ext4load mmc 0 0x00000000 /boot/.next
  25. +if ext4load mmc 0 0x00000000 /.next
  26.  then
  27.  # sunxi mainline kernel
  28.  #--------------------------------------------------------------------------------------------------------------------------------
  29. -ext4load mmc 0 0x49000000 /boot/dtb/${fdtfile}
  30. -ext4load mmc 0 0x46000000 /boot/zImage
  31. +ext4load mmc 0 0x49000000 /dtb/${fdtfile}
  32. +ext4load mmc 0 0x46000000 /zImage
  33.  env set fdt_high ffffffff
  34.  bootz 0x46000000 - 0x49000000
  35.  #--------------------------------------------------------------------------------------------------------------------------------
  36. @@ -18,4 +18,4 @@ ext4load mmc 0 0x43000000 /boot/script.bin
  37.  ext4load mmc 0 0x48000000 /boot/zImage
  38.  bootz 0x48000000
  39.  #--------------------------------------------------------------------------------------------------------------------------------
  40. -fi
  41. \ No newline at end of file
  42. +fi
  43. diff --git a/configuration.sh b/configuration.sh
  44. index 5ada405..59dbac5 100644
  45. --- a/configuration.sh
  46. +++ b/configuration.sh
  47. @@ -21,9 +21,9 @@ LINUXKERNEL="https://github.com/dan-and/linux-sunxi"
  48.  LINUXSOURCE="linux-sunxi"
  49.  LINUXCONFIG="linux-sunxi"
  50.  CPUMIN="480000"
  51. -CPUMAX="1010000"
  52. +CPUMAX="1080000"
  53.  OFFSET="1" # MB (1 x 2048 = default)
  54. -BOOTSIZE="0" # Mb size of boot partition
  55. +BOOTSIZE="16" # Mb size of boot partition
  56.  DOCS=""
  57.  DOCSDIR=""
  58.  FIRMWARE="bin/ap6210.zip"
  59. diff --git a/deboostrap.sh b/deboostrap.sh
  60. index 35d9a5c..5d89635 100644
  61. --- a/deboostrap.sh
  62. +++ b/deboostrap.sh
  63. @@ -63,9 +63,9 @@ else
  64.     parted -s $LOOP -- mkpart primary fat16  $BOOTSTART"s" $BOOTEND"s"
  65.     parted -s $LOOP -- mkpart primary ext4  $ROOTSTART"s" -1s
  66.     partprobe $LOOP
  67. -   mkfs.vfat -n "$IMAGEVOLUME" $LOOP"p1" >/dev/null 2>&1
  68. -   mkfs.ext4 -q $LOOP"p2"
  69. -   mount $LOOP"p2" $DEST/output/sdcard/
  70. +   mkfs.ext4 -q $LOOP"p1" >/dev/null 2>&1
  71. +   mkfs.f2fs $LOOP"p2"
  72. +   mount -tf2fs $LOOP"p2" $DEST/output/sdcard/
  73.     mkdir -p $DEST/output/sdcard/boot
  74.     mount $LOOP"p1" $DEST/output/sdcard/boot
  75.  fi
  76. diff --git a/distributions.sh b/distributions.sh
  77. index f7445a1..72bd280 100644
  78. --- a/distributions.sh
  79. +++ b/distributions.sh
  80. @@ -102,7 +102,7 @@ chroot $DEST/output/sdcard /bin/bash -c "(echo $ROOTPWD;echo $ROOTPWD;) | passwd
  81.  chroot $DEST/output/sdcard /bin/bash -c "chage -d 0 root"
  82.  
  83.  # add noatime to root FS
  84. -echo "/dev/mmcblk0p1  /           ext4    defaults,noatime,nodiratime,data=writeback,commit=600,errors=remount-ro        0       0" >> $DEST/output/sdcard/etc/fstab
  85. +echo -e "/dev/mmcblk0p2  /           f2fs    defaults,noatime,nodiratime        0       0\n/dev/mmcblk0p1  /boot   ext4    defaults,noatime,nodiratime 0   0" >> $DEST/output/sdcard/etc/fstab
  86.  
  87.  # flash media tunning
  88.  if [ -f "$DEST/output/sdcard/etc/default/tmpfs" ]; then
  89. @@ -135,7 +135,7 @@ chmod 755 $DEST/output/rootfs/$CHOOSEN_ROOTFS/DEBIAN/postinst
  90.  # scripts for autoresize at first boot
  91.  mkdir -p $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/init.d
  92.  mkdir -p $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/default
  93. -install -m 755 $SRC/lib/scripts/resize2fs $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/init.d
  94. +# install -m 755 $SRC/lib/scripts/resize2fs $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/init.d
  95.  install -m 755 $SRC/lib/scripts/firstrun  $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/init.d
  96.  
  97.  # install custom bashrc and hardware dependent motd
  98. @@ -169,4 +169,4 @@ sed -i "s/BOARD/$BOARD/" $DEST/output/rootfs/$CHOOSEN_ROOTFS/etc/hostapd.conf-rt
  99.  # script to install to SATA
  100.  mkdir -p $DEST/output/rootfs/$CHOOSEN_ROOTFS/root
  101.  install -m 755 $SRC/lib/scripts/nand-sata-install $DEST/output/rootfs/$CHOOSEN_ROOTFS/root/nand-sata-install
  102. -}
  103. \ No newline at end of file
  104. +}
  105. diff --git a/patch/packaging-next.patch b/patch/packaging-next.patch
  106. index b1a8719..da0d9de 100644
  107. --- a/patch/packaging-next.patch
  108. +++ b/patch/packaging-next.patch
  109. @@ -83,7 +83,7 @@ index 5972624..272d558 100755
  110.  +## Create sym link to kernel image
  111.  +##
  112.  +kernel_tmp_version="${installed_image_path////\\/}"
  113. -+sed -e "s/exit 0/ln -sf \/$kernel_tmp_version \/boot\/zImage/g" -i $tmpdir/DEBIAN/postinst
  114. ++sed -e "s/exit 0/cd \/boot\/ ; ln -sf ${kernel_tmp_version##*/} zImage/g" -i $tmpdir/DEBIAN/postinst
  115.  +echo "touch /boot/.next" >> $tmpdir/DEBIAN/postinst
  116.  +echo "exit 0" >> $tmpdir/DEBIAN/postinst
  117.  +
  118. diff --git a/scripts/firstrun b/scripts/firstrun
  119. index 0b814b7..59924d0 100644
  120. --- a/scripts/firstrun
  121. +++ b/scripts/firstrun
  122. @@ -86,19 +86,6 @@ case "$1" in
  123.                         apt-get -y -qq autoremove >/dev/null 2>&1
  124.                         #apt-get -y -qq upgrade >/dev/null 2>&1
  125.                  fi
  126. -                #
  127. -                echo "Expanding rootfs..." >/dev/tty1
  128. -                if do_expand_rootfs;then
  129. -                        echo "Expanding rootfs success, rebooting automatically." >/dev/tty1
  130. -                       update-rc.d resize2fs defaults >/dev/null 2>&1
  131. -                        reboot=true
  132. -                else
  133. -                        echo "Expanding rootfs has failed, see log files." >/dev/tty1
  134. -                fi
  135. -               update-rc.d -f firstrun remove >/dev/null 2>&1
  136. -       if $reboot;then
  137. -           /sbin/reboot
  138. -       fi
  139.          ;;
  140.    *)
  141.          echo "Usage: $N {start}" >&2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement