From 9f3c78c9f78c04c4c71dd5bff4d36fd54e50cd80 Mon Sep 17 00:00:00 2001 From: AkaruiNeko Date: Mon, 18 Aug 2025 00:40:29 +0300 Subject: [PATCH] build.sh/clean.sh: added clean.sh and fixed the fat12 problem (see #6) --- build.sh | 5 +++-- clean.sh | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 clean.sh diff --git a/build.sh b/build.sh index aa1aad2..4a718d1 100755 --- a/build.sh +++ b/build.sh @@ -77,8 +77,9 @@ create_image() { echo -e "${GREEN}OK${NC}" echo -n "Creating partition table and partition... " - parted -s "$IMG_NAME" mklabel msdos - parted -s "$IMG_NAME" mkpart primary fat32 1MiB 100% + parted -s "$IMG_NAME" mklabel msdos + parted -s "$IMG_NAME" mkpart primary 1MiB 100% + echo "type=1" | sfdisk --part-type "$IMG_NAME" 1 echo -e "${GREEN}OK${NC}" echo -n "Setting up loop device with partitions... " diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..498126b --- /dev/null +++ b/clean.sh @@ -0,0 +1,17 @@ +BUILD_DIR="build" +MOUNT_POINT="img" +IMG_NAME="opendos.img" + +RED='\033[31m' +GREEN='\033[32m' +BLUE='\033[34m' +PURPLE='\033[35m' +NC='\033[0m' + +clean() { + echo -e "${BLUE}=== Cleaning ===${NC}" + sudo umount "$MOUNT_POINT" 2>/dev/null || true + rm -rf "$BUILD_DIR" "$MOUNT_POINT" "$IMG_NAME" +} + +clean