Support new non-free repository component for Debian bookworm and newer
authorMichael Prokop <mika@grml.org>
Mon, 6 Feb 2023 15:43:40 +0000 (16:43 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 6 Feb 2023 17:22:17 +0000 (18:22 +0100)
If the --non-free option gets enabled packages like 'firmware-linux',
'firmware-linux-nonfree', 'firmware-misc-nonfree' should be available.
Starting with Debian/bookworm the firmware related packages got moved
from "non-free" to the new "non-free-firmware" component/repository though
(related to https://www.debian.org/vote/2022/vote_003).

grml-debootstrap
grml-debootstrap.8.txt

index e331a2c..71a0942 100755 (executable)
@@ -153,7 +153,7 @@ Configuration options:
       --backportrepos      Enable Debian's backports repository (backports.debian.org).
       --keep_src_list      Do not overwrite user provided apt sources.list.
       --contrib            Enable 'contrib' in COMPONENTS (defaults to 'main' only).
-      --non-free           Enable non-free in COMPONENTS (defaults to 'main' only).
+      --non-free           Enable non-free / non-free-firmware in COMPONENTS (defaults to 'main' only).
       --hostname <name>    Hostname of Debian system.
       --nopassword         Do not prompt for the root password.
       --password <pwd>     Use specified password as password for user root.
@@ -589,7 +589,15 @@ done
 # make sure main is always included
 [ -z "$COMPONENTS" ]            && COMPONENTS="main"
 [ "$_opt_contrib" ]             && COMPONENTS="$COMPONENTS contrib"
-[ "$_opt_non_free" ]            && COMPONENTS="$COMPONENTS non-free"
+
+case "${RELEASE}" in
+  lenny|squeeze|wheezy|jessie|stretch|buster|bullseye)
+    [ "$_opt_non_free" ] && COMPONENTS="$COMPONENTS non-free"
+    ;;
+  *)
+    [ "$_opt_non_free" ] && COMPONENTS="$COMPONENTS non-free-firmware non-free"
+    ;;
+esac
 
 # command line option checks
 if [ "$_opt_scripts_set" ] ; then
index b572f5c..9bd28ec 100644 (file)
@@ -168,8 +168,9 @@ Options and environment variables
 
 *--non-free*::
 
-    Enable the 'non-free' repository in COMPONENTS. By default only
-    the 'main' repository is enabled.
+    Enable the 'non-free' repository in COMPONENTS.
+    For bookworm and newer Debian releases also the 'non-free-firmware' repository gets enabled.
+    By default only the 'main' repository is enabled.
 
 *--nopackages*::