Browse Source

create partition only under condition "$partition" = "single-mbr"

Toastie 6 months ago
parent
commit
8617f802ed
1 changed files with 14 additions and 10 deletions
  1. 14 10
      bootstrap-bookworm.sh

+ 14 - 10
bootstrap-bookworm.sh

@@ -53,16 +53,20 @@ echo nameserver $netDNS2 >> /etc/resolv.conf
 }
 
 install(){
-#----------
-# Prepare disks
-# Parition disks -- pkg: parted
-parted $disk -s \
-mklabel msdos \
-mkpart primary ext4 512M 100% toggle 1 boot
-fdisk -l $disk
-
-# Format disks -- pkg: e2fsprogs dosfstools and to file system check
-mkfs.ext4 $disk1 && e2fsck $disk1
+
+if [ "$partition" = "single-mbr" ]
+then
+  #----------
+  # Prepare disks
+  # Parition disks -- pkg: parted
+  parted $disk -s \
+  mklabel msdos \
+  mkpart primary ext4 512M 100% toggle 1 boot
+  fdisk -l $disk
+
+  # Format disks -- pkg: e2fsprogs dosfstools and to file system check
+  mkfs.ext4 $disk1 && e2fsck $disk1
+fi
 
 # Prepare mount points and mount
 mkdir -p $mnt