mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Previous method does not work on Ubuntu
This commit is contained in:
@@ -16,11 +16,18 @@ device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)
|
||||
PARTITIONS=$(($(fdisk -l $device | grep $device | wc -l)-1))
|
||||
device="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)"p"$PARTITIONS
|
||||
N=/etc/init.d/resize2fs
|
||||
root_device=$(mountpoint -d /)
|
||||
for file in /dev/* ; do
|
||||
CURRENT_DEVICE=$(printf "%d:%d" $(stat --printf="0x%t 0x%T" $file))
|
||||
if [ $CURRENT_DEVICE = $root_device ]; then
|
||||
root_partition=$file
|
||||
break;
|
||||
fi
|
||||
done
|
||||
rootfstype=$(blkid -s TYPE -o value $root_partition)
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
root_partition=$(findmnt --target / -o SOURCE -n)
|
||||
rootfstype=$(blkid -s TYPE -o value $root_partition)
|
||||
start)
|
||||
if [[ $rootfstype == ext4 && ! -f "/root/.no_rootfs_resize" ]]; then
|
||||
echo -e "[\e[0;32m ok \x1B[0m] Resizing SD card file-system"
|
||||
/sbin/resize2fs $device >/dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user