local -r MODULE_SZ=20
local -r RAMDISK_SZ=8
local -r RAMDISK_RECOVERY_SZ=12
+ local -r INFORM_SZ=8
if [ $sfdisk_new == 1 ]; then
local -r EXTEND_SZ=8
else
local -r EXTEND_SZ=4
fi
- let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $RAMDISK_SZ - $RAMDISK_RECOVERY_SZ - $EXTEND_SZ"
+ let "USER_SZ = $SIZE_MB - $BOOT_SZ - $ROOTFS_SZ - $DATA_SZ - $MODULE_SZ - $RAMDISK_SZ - $RAMDISK_RECOVERY_SZ - $INFORM_SZ - $EXTEND_SZ"
local -r BOOT=boot
local -r ROOTFS=rootfs
local -r MODULE=modules
local -r RAMDISK=ramdisk
local -r RAMDISK_RECOVERY=ramdisk-recovery
+ local -r INFORM=inform
if [[ $USER_SZ -le 100 ]]
then
echo " "$MODULE" " $DISK"6 " $MODULE_SZ "MB"
echo " "$RAMDISK" " $DISK"7 " $RAMDISK_SZ "MB"
echo " "$RAMDISK_RECOVERY" " $DISK"8 " $RAMDISK_RECOVERY_SZ "MB"
+ echo " "$INFORM" " $DISK"9 " $INFORM_SZ "MB"
local MOUNT_LIST=`mount | grep $DISK | awk '{print $1}'`
for mnt in $MOUNT_LIST
,${MODULE_SZ}MiB,,-
,${RAMDISK_SZ}MiB,,-
,${RAMDISK_RECOVERY_SZ}MiB,,-
+ ,${INFORM_SZ}MiB,,-
__EOF__
else
sfdisk --in-order --Linux --unit M $DISK <<-__EOF__
,$MODULE_SZ,,-
,$RAMDISK_SZ,,-
,$RAMDISK_RECOVERY_SZ,,-
+ ,$INFORM_SZ,,-
__EOF__
fi
mkfs.ext4 -q ${DISK}6 -L $MODULE -F
mkfs.ext4 -q ${DISK}7 -L $RAMDISK -F
mkfs.ext4 -q ${DISK}8 -L $RAMDISK_RECOVERY -F
+ mkfs.ext4 -q ${DISK}9 -L $INFORM -F
+
+ # create "reboot-param.bin" file in inform partition for passing reboot parameter
+ # It should be done only once upon partition format.
+ umount ${DISK}9
+ mkdir mnt_tmp
+ mount -t ext4 ${DISK}9 ./mnt_tmp
+ touch ./mnt_tmp/reboot-param.bin
+ umount ./mnt_tmp
+ rmdir mnt_tmp
}
function show_usage () {