From d7b2e164160b985df90862b03318efa25fc26b70 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Tue, 30 Jul 2024 22:06:47 +0200 Subject: [PATCH] Update uPart.sh --- scripts/uPart.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/uPart.sh b/scripts/uPart.sh index 4246a571..80562858 100644 --- a/scripts/uPart.sh +++ b/scripts/uPart.sh @@ -16,12 +16,13 @@ add_fat32_partition() { dd if=/dev/zero of=fat.img bs=1M count=300 cat fat.img >> "${PREV_WORK_DIR}"/*.img rm -f fat.img - - if [[ "${OS}" == "radxa-debian-rock-cm3" ]]; then + if [[ "${OS}" == "ubuntu-x86-minimal" ]] || [[ "${OS}" == "ubuntu-x86" ]] || [[ "${OS}" == "debian-X20" ]]; then + echo "Video partition not supporte yet" + elif [[ "${OS}" == "radxa-debian-rock-cm3" ]]; then sgdisk -e "${PREV_WORK_DIR}"/*.img echo -e "n\n4\n\n\n\n0C00\nw\ny" | sudo gdisk "${PREV_WORK_DIR}"/*.img sudo parted "${PREV_WORK_DIR}"/*.img set 4 msftdata on - log "Video Partition Added" + log "Video partition added" local loop_device loop_device=$(sudo losetup -f --show -P "${PREV_WORK_DIR}"/*.img) sudo mkfs.fat -F 32 "${loop_device}p4" @@ -32,7 +33,7 @@ add_fat32_partition() { first_sec=$((first_sec + (2048 - first_sec % 2048) % 2048)) sudo parted "${PREV_WORK_DIR}"/*.img --script mkpart primary fat32 "${first_sec}s" 100% echo -e "t\n3\n0c\nw" | fdisk "${PREV_WORK_DIR}"/*.img - log "Video Partition Added" + log "Video partition added" local loop_device loop_device=$(sudo losetup -f --show -o $((first_sec * 512)) "${PREV_WORK_DIR}"/*.img) sudo mkfs.fat -F 32 "${loop_device}" @@ -41,4 +42,4 @@ add_fat32_partition() { } # Call the function to add FAT32 partition -add_fat32_partition \ No newline at end of file +add_fat32_partition