summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2022-08-14 23:45:05 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2022-08-17 06:37:00 -0400
commit35126dca7fc3200980bdd3080b575428c94e27e5 (patch)
treec4c0b325d7a4a79e7601657d4fee8dde82642056
parent8f2fd91ea09d908d1060620bab037a6e14984b8d (diff)
consolidate fdisk calls
-rwxr-xr-xinstall.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/install.sh b/install.sh
index c1e1d54..db5f58b 100755
--- a/install.sh
+++ b/install.sh
@@ -472,14 +472,15 @@ _PartitionAuto()
parted -s ${device} -- set ${root_part_n} boot on
# format partitions
- sleep 0.5 ; partprobe ;
- (echo t ; echo ${root_part_n} ; echo ${root_type_n} ; echo w) | \
- fdisk ${device} &> /dev/null
- sleep 0.5 ; partprobe ;
- (echo t ; echo ${swap_part_n} ; echo ${swap_type_n} ; echo w) | \
- fdisk ${device} &> /dev/null
- yes | mkfs.ext4 ${device}${root_part_n} &> /dev/null
- mkswap ${device}${swap_part_n} &> /dev/null
+ format() # (device part_n type_n)
+ {
+ sleep 0.5 ; partprobe ;
+ (echo t ; echo ${part_n} ; echo ${type_n} ; echo w) | fdisk ${device}
+ }
+ format ${device} ${root_part_n} ${root_type_n} &> /dev/null
+ format ${device} ${swap_part_n} ${swap_type_n} &> /dev/null
+ yes | mkfs.ext4 ${device}${root_part_n} &> /dev/null
+ mkswap ${device}${swap_part_n} &> /dev/null
}
_PartitionManual()