summaryrefslogtreecommitdiff
path: root/recipes-core/fs-init
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-02-08 11:03:52 -0800
committerMax Krummenacher <max.krummenacher@toradex.com>2017-02-08 20:11:00 +0100
commit73070744ec7257d3ce3830a4ae3ed360871c22a1 (patch)
treeb1e679e820fb89d5e515065780ae74276b084e9b /recipes-core/fs-init
parent05faa6a4346eeb7631fe72bcbb9aa7d414bee791 (diff)
fs-init: remove duplicate resize script
The script used for all machines (e.g. T30) and the mx6 specific script are the very same scripts. Drop the mx6 specific script, with that the recipe will use the general scripts for all machines. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'recipes-core/fs-init')
-rwxr-xr-xrecipes-core/fs-init/files/mx6/resizefs.sh53
1 files changed, 0 insertions, 53 deletions
diff --git a/recipes-core/fs-init/files/mx6/resizefs.sh b/recipes-core/fs-init/files/mx6/resizefs.sh
deleted file mode 100755
index 8f066d1..0000000
--- a/recipes-core/fs-init/files/mx6/resizefs.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-# resize the rootfs ext filesystem size to its full partition size
-# usually used on first boot in a postinstall script
-# or set in an autostart file from a postinstall script
-
-DISK="mmcblk0"
-PART="mmcblk0p2"
-
-logger "resizing $PART to fill its full partition size"
-# get the disk total size
-DISK_SIZE=`cat /sys/block/$DISK/size`
-
-# get partition start and size
-PART_OFF=`cat /sys/block/$DISK/$PART/start`
-PART_SIZE=`cat /sys/block/$DISK/$PART/size`
-
-# calculate size after the partition to the end of disk
-SPARE=`expr $DISK_SIZE - $PART_OFF - $PART_SIZE`
-
-# new filesystem size, it must not overlap the secondary gpt header
-# assume 1024kB as GPT size (is 34 sectors)
-if [ $SPARE -lt 2048 ]
-then
- FSSIZE=`expr $PART_SIZE - 2048`
-else
- FSSIZE=$PART_SIZE
-fi
-
-# resize now
-
-#reduce I/O load by doing this in STEPSIZE increments
-#idea stolen from here:
-#https://codereview.chromium.org/551127
-
-#start from the current size in blocks of 512 byte, add STEPSIZE on each iteration
-STEPSIZE=`expr 64 \* 1024 \* 2`
-NEXTSIZE=`df /dev/$PART | grep /dev/root | awk '{print $2}'`
-NEXTSIZE=`expr $NEXTSIZE \* 2`
-NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE`
-while [ $NEXTSIZE -lt $FSSIZE ]; do
- FSSIZEMEG=`expr $NEXTSIZE / 2 / 1024`"M"
- resize2fs /dev/$PART $FSSIZEMEG
- sleep 1
- NEXTSIZE=`expr $NEXTSIZE + $STEPSIZE`
-done
-FSSIZEMEG=`expr $FSSIZE / 2 / 1024`"M"
-resize2fs /dev/$PART $FSSIZEMEG
-
-#job done, remove it from systemd services
-systemctl disable resizefs.service
-
-logger "resizing $PART finished, new size is $FSSIZEMEG"
-