ソースを参照

--version to supersede --suite, restrict bpo

Bohan Yang 4 年 前
コミット
24a1ff77f7
2 ファイル変更22 行追加8 行削除
  1. 2 1
      README.md
  2. 20 7
      debi.sh

+ 2 - 1
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 <string>` 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`

+ 20 - 7
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"
     }