From 24a1ff77f7839f83cac3bbcd531422509d412973 Mon Sep 17 00:00:00 2001 From: Bohan Yang Date: Sun, 1 Aug 2021 20:17:26 +0800 Subject: [PATCH] --version to supersede --suite, restrict bpo --- README.md | 3 ++- debi.sh | 27 ++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 158a044..247c467 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,8 @@ Otherwise, you can run this command to revert all changes made by the script: * `--dns '8.8.8.8 8.8.4.4'` (Default IPv6 DNS: `2001:4860:4860::8888 2001:4860:4860::8844`) * `--hostname ` FQDN hostname (includes the domain name), e.g. `server1.example.com` * `--network-console` Enable the network console of the installer. `ssh installer@ip` to connect - * `--suite buster` Choose the version to install: `buster` or `stable` for 10, `bullseye` or `testing` for 11, `stretch` or `oldstable` for 9, `sid` or `unstable` + * `--version 10` Supports: `9`, `10`, `11`, `stretch`, `buster`, `bullseye` + * `--suite buster` **For normal cases, please use `--version` instead.** e.g. `stretch`, `buster`, `bullseye`, `sid`, `oldstable`, `stable`, `testing`, `unstable` * `--release-d-i` d-i (Debian Installer) for the released versions: 10 (buster) and 9 (stretch) * `--daily-d-i` Use latest daily build of d-i (Debian Installer) for the unreleased versions: 11 (bullseye) and sid (unstable) * `--mirror-protocol http` or `https` or `ftp` diff --git a/debi.sh b/debi.sh index 5f89c5e..930863d 100755 --- a/debi.sh +++ b/debi.sh @@ -152,13 +152,26 @@ while [ $# -gt 0 ]; do --network-console) network_console=true ;; + --version) + case $2 in + 9|stretch) + suite=stretch + ;; + 10|buster) + suite=buster + ;; + 11|bullseye) + suite=bullseye + daily_d_i=true + esac + shift + ;; --suite) suite=$2 - [ "$2" = 'bullseye' ] || - [ "$2" = 'testing' ] || - [ "$2" = 'sid' ] || - [ "$2" = 'unstable' ] && - daily_d_i=true + case $2 in + bullseye|testing|sid|unstable) + daily_d_i=true + esac shift ;; --release-d-i) @@ -326,8 +339,8 @@ done } [ "$bpo_kernel" = true ] && { - [ "$suite" = sid ] || [ "$suite" = unstable ] && - err 'Backports kernel is not available for sid/unstable distribution' + [ "$suite" != buster ] && [ "$suite" != stretch ] && + err 'Backports kernel is only available for 10 (buster) and 9 (stretch)' install="$kernel/$suite-backports $install" }