Remove partitioning method option

pull/8/head
Bohan Yang 5 years ago committed by GitHub
parent 093a0c0804
commit 3d5c0c35e4
  1. 5
      README.md
  2. 24
      debi.sh

@ -17,8 +17,8 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
### Original OS
* Debian 8/9/10
* Ubuntu 16.04/18.04/20.04
* CentOS 7
* Ubuntu 14.04/16.04/18.04/20.04
* CentOS 7/8
## How It Works
@ -52,7 +52,6 @@ This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
* `--timezone UTC` https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
* `--ntp 0.debian.pool.ntp.org`
* `--skip-partitioning`
* `--partitioning-method regular`
* `--disk <string>` Manually select a boot disk when more than one disk is available. e.g. `/dev/sda`
* `--force-gpt` Create a *GUID Partition Table* **(Default)**
* `--no-force-gpt`

@ -48,7 +48,6 @@ cleartext_password=false
timezone=UTC
ntp=0.debian.pool.ntp.org
skip_partitioning=false
partitioning_method=regular
disk=
force_gpt=true
efi=
@ -163,10 +162,6 @@ while [ $# -gt 0 ]; do
--skip-partitioning)
skip_partitioning=true
;;
--partitioning-method)
partitioning_method=$2
shift
;;
--disk)
disk=$2
shift
@ -419,18 +414,11 @@ if [ "$skip_partitioning" != true ]; then
# Partitioning
d-i partman-auto/method string regular
EOF
if [ -n "$disk" ]; then
echo "d-i partman-auto/disk string $disk" | $save_preseed
fi
echo "d-i partman-auto/method string $partitioning_method" | $save_preseed
[ -n "$disk" ] && echo "d-i partman-auto/disk string $disk" | $save_preseed
if [ "$partitioning_method" = regular ]; then
[ "$force_gpt" = true ] && $save_preseed << 'EOF'
d-i partman-partitioning/default_label string gpt
EOF
[ "$force_gpt" = true ] && echo 'd-i partman-partitioning/default_label string gpt' | $save_preseed
echo "d-i partman/default_filesystem string $filesystem" | $save_preseed
@ -472,7 +460,6 @@ EOF
.
EOF
echo "d-i partman-auto/choose_recipe select naive" | $save_preseed
fi
$save_preseed << 'EOF'
d-i partman-basicfilesystems/no_swap boolean false
@ -582,6 +569,7 @@ EOF
grep -vF zz_debi /etc/default/grub > "$tmp"
cat "$tmp" > /etc/default/grub
rm "$tmp"
# shellcheck disable=SC2016
echo 'zz_debi=/etc/default/grub.d/zz-debi.cfg; if [ -f "$zz_debi" ]; then . "$zz_debi"; fi' >> /etc/default/grub
grub_cfg=/boot/grub2/grub.cfg
grub2-mkconfig -o "$grub_cfg"
@ -594,9 +582,9 @@ fi
installer_directory="$boot_directory$installer"
# shellcheck disable=SC2034
mem="$(grep ^MemTotal: /proc/meminfo | { read -r x y z; echo "$y"; })"
mem="$(expr "$mem" / 1024)"
[ "$mem" -lt 483 ] && kernel_params="$kernel_params lowmem/low="
[ $((mem / 1024)) -lt 483 ] && kernel_params="$kernel_params lowmem/low="
$save_grub_cfg 1>&2 << EOF
menuentry 'Debian Installer' --id debi {

Loading…
Cancel
Save