ece0dd0ce5
Add a backup partition that has the following characteristics: - It will never be deleted (not at install, reinstall, upgrade nor B&R) - The partition will have 10G - It will be resizable at upgrades Story: 2007403 Task: 39548 Change-Id: I2ec9f70d00a38568fc00063cdaa54ec3be48dc47 Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
46 lines
1.4 KiB
INI
Executable File
46 lines
1.4 KiB
INI
Executable File
|
|
sz=$(blockdev --getsize64 $(get_disk $rootfs_device))
|
|
if [ $sz -le $((90*$gb)) ] ; then
|
|
LOG_VOL_SIZE=4000
|
|
SCRATCH_VOL_SIZE=4000
|
|
ROOTFS_SIZE=10000
|
|
else
|
|
LOG_VOL_SIZE=8000
|
|
SCRATCH_VOL_SIZE=8000
|
|
ROOTFS_SIZE=20000
|
|
fi
|
|
|
|
ROOTFS_OPTIONS="defaults"
|
|
profile_mode=`cat /proc/cmdline |xargs -n1 echo |grep security_profile= | grep extended`
|
|
if [ -n "$profile_mode" ]; then
|
|
# Enable iversion labelling for rootfs when IMA is enabled
|
|
ROOTFS_OPTIONS="${ROOTFS_OPTIONS},iversion"
|
|
fi
|
|
|
|
cat<<EOF>/tmp/part-include
|
|
clearpart --all --drives=$WIPE_HDD --initlabel
|
|
EOF
|
|
|
|
if [ -d /sys/firmware/efi ] ; then
|
|
cat<<EOF>>/tmp/part-include
|
|
part /boot/efi --fstype=efi --size=300 --ondrive=$(get_disk $boot_device)
|
|
EOF
|
|
else
|
|
cat<<EOF>>/tmp/part-include
|
|
part biosboot --asprimary --fstype=biosboot --size=1 --ondrive=$(get_disk $boot_device)
|
|
EOF
|
|
fi
|
|
|
|
cat<<EOF>>/tmp/part-include
|
|
part /boot --fstype=ext4 --asprimary --size=500 --ondrive=$(get_disk $rootfs_device) --fsoptions="$ROOTFS_OPTIONS"
|
|
part pv.253004 --grow --asprimary --size=500 --ondrive=$(get_disk $rootfs_device)
|
|
volgroup cgts-vg --pesize=32768 pv.253004
|
|
logvol /var/log --fstype=ext4 --vgname=cgts-vg --size=$LOG_VOL_SIZE --name=log-lv
|
|
logvol /scratch --fstype=ext4 --vgname=cgts-vg --size=$SCRATCH_VOL_SIZE --name=scratch-lv
|
|
part / --fstype=ext4 --asprimary --size=$ROOTFS_SIZE --ondrive=$(get_disk $rootfs_device) --fsoptions="$ROOTFS_OPTIONS"
|
|
|
|
EOF
|
|
|
|
%end
|
|
|