@@ -34,15 +34,15 @@ you have heavily customised your installation.\
3434}
3535
3636do_expand_rootfs () {
37- if ! [ -h /dev/root ]; then
38- whiptail --msgbox " /dev/root does not exist or is not a symlink. Don't know how to expand" 20 60 2
37+ if ! [ -h /dev/disk/by-label/ root ]; then
38+ whiptail --msgbox " /dev/disk/by-label/ root does not exist or is not a symlink. Don't know how to expand" 20 60 2
3939 return 0
4040 fi
4141
42- ROOT_PART=$( readlink /dev/root)
43- PART_NUM=${ROOT_PART# mmcblk0p}
42+ ROOT_PART=$( readlink /dev/disk/by-label/ root)
43+ PART_NUM=${ROOT_PART# .. / .. / mmcblk0p}
4444 if [ " $PART_NUM " = " $ROOT_PART " ]; then
45- whiptail --msgbox " /dev/root is not an SD card. Don't know how to expand" 20 60 2
45+ whiptail --msgbox " /dev/disk/by-label/ root is not an SD card. Don't know how to expand" 20 60 2
4646 return 0
4747 fi
4848
@@ -56,7 +56,7 @@ do_expand_rootfs() {
5656 LAST_PART_NUM=$( parted /dev/mmcblk0 -ms unit s p | tail -n 1 | cut -f 1 -d:)
5757
5858 if [ " $LAST_PART_NUM " != " $PART_NUM " ]; then
59- whiptail --msgbox " /dev/root is not the last partition. Don't know how to expand" 20 60 2
59+ whiptail --msgbox " /dev/disk/by-label/ root is not the last partition. Don't know how to expand" 20 60 2
6060 return 0
6161 fi
6262
@@ -97,7 +97,7 @@ cat <<\EOF > /etc/init.d/resize2fs_once &&
9797case "$1 " in
9898 start)
9999 log_daemon_msg "Starting resize2fs_once" &&
100- resize2fs /dev/root &&
100+ resize2fs /dev/disk/by-label/ root &&
101101 rm /etc/init.d/resize2fs_once &&
102102 update-rc.d resize2fs_once remove &&
103103 log_end_msg $?
0 commit comments