Skip to content

Commit

Permalink
Merge pull request #54 from Itxaka/arm_lvm_default
Browse files Browse the repository at this point in the history
  • Loading branch information
Itxaka committed May 23, 2023
2 parents 6e4b4c9 + e95f84f commit 83f58e3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tools-image/build-arm-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -ex
load_vars() {

model=${MODEL:-odroid_c2}
use_lvm=${USE_LVM:-false}
disable_lvm=${DISABLE_LVM:-false}
directory=${DIRECTORY:-}
output_image="${OUTPUT_IMAGE:-arm.img}"
# Img creation options. Size is in MB for all of the vars below
Expand Down Expand Up @@ -102,7 +102,7 @@ usage()
echo " --directory: (optional) A directory which will be used for active/passive/recovery system"
echo " --model: (optional) The board model"
echo " --efi-dir: (optional) A directory with files which will be added to the efi partition"
echo " --use-lvm: (optional- no arguments) LVM will be used for the recovery and oem partitions and COS_OEM is enabled"
echo " --disable-lvm: (optional- no arguments) LVM for the recovery and oem partitions will be disabled"
exit 1
}

Expand Down Expand Up @@ -189,8 +189,8 @@ while [ "$#" -gt 0 ]; do
shift 1
repo_type=$1
;;
--use-lvm)
use_lvm=true
--disable-lvm)
disable_lvm=true
;;
-h)
usage
Expand Down Expand Up @@ -336,7 +336,7 @@ else
sgdisk -n 1:8192:+16M -c 1:EFI -t 1:0700 ${output_image}
fi
sgdisk -n 2:0:+${state_size}M -c 2:state -t 2:8300 ${output_image}
if [ "$use_lvm" == 'false' ]; then
if [ "$disable_lvm" == 'true' ]; then
sgdisk -n 3:0:+${recovery_size}M -c 3:recovery -t 3:8300 ${output_image}
else
sgdisk -n 3:0:+$(( ${recovery_size} + ${oem_size} ))M -c 3:lvm -t 3:8e00 ${output_image}
Expand Down Expand Up @@ -382,7 +382,7 @@ recovery_lv=/dev/mapper/KairosVG-recovery
mkfs.vfat -F 32 ${efi}
fatlabel ${efi} COS_GRUB

if [ "$use_lvm" == 'false' ]; then
if [ "$disable_lvm" == 'true' ]; then
mkfs.ext4 -F -L ${RECOVERY_LABEL} $recovery
else
pvcreate $recovery
Expand All @@ -401,7 +401,7 @@ mkdir $WORKDIR/state
mkdir $WORKDIR/recovery
mkdir $WORKDIR/efi

if [ "$use_lvm" == 'false' ]; then
if [ "$disable_lvm" == 'true' ]; then
mount $recovery $WORKDIR/recovery
else
mount $recovery_lv $WORKDIR/recovery
Expand Down Expand Up @@ -433,7 +433,7 @@ umount $WORKDIR/recovery
umount $WORKDIR/state
umount $WORKDIR/efi

if [ "$use_lvm" == 'true' ]; then
if [ "$disable_lvm" == 'false' ]; then
vgchange -an
fi
sync
Expand Down

0 comments on commit 83f58e3

Please sign in to comment.