Quellcode durchsuchen

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

Toastie vor 1 Jahr
Ursprung
Commit
8617f802ed
1 geänderte Dateien mit 14 neuen und 10 gelöschten Zeilen
  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