@@ -165,14 +165,14 @@ function expand_fs() disk=/dev/$root main_part=/dev/${root}1 swap_part=/dev/${root}2 - #part_sectors=$(sfdisk -d $disk | perl -lne 'm|^'$main_part'\b.*,\s*size\s*=\s*(\d+)\b| and print($1), exit') - #part_blocks=$((part_sectors/2)) main_part_sectors= if [ -n "$SWAP_BLOCKS" ]; then if [ -n "$EXPAND_FS" ]; then total_blocks=$(sfdisk -s $disk) main_part_blocks=$((total_blocks-SWAP_BLOCKS)) main_part_sectors=$((main_part_blocks*2)) + else + main_part_sectors=$(sfdisk -d $disk | perl -lne 'm|^'$main_part'\b.*,\s*size\s*=\s*(\d+)\b| and print($1), exit') fi fi if [ -n "$EXPAND_FS" ]; then |