Drop contrib + non-free from default COMPONENTS, support --contrib + -non-free cmdlin...
authorMichael Prokop <mika@grml.org>
Wed, 3 Jun 2015 13:48:22 +0000 (15:48 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 3 Jun 2015 14:18:50 +0000 (16:18 +0200)
Let's see if firmware-linux really matters nowadays.

By default we include the 'main' component only,
to enable 'contrib' + 'non-free' either use the
new command line options --contrib + -non-free
or set COMPONENTS in grml-debootstrap's config.

Thanks to Philip Hands for raising this

chroot-script
cmdlineopts.clp
config
grml-debootstrap

index b283991..e1c183a 100755 (executable)
@@ -78,7 +78,7 @@ chrootmirror() {
   fi
 
   if [ -z "$COMPONENTS" ] ; then
-    COMPONENTS='main contrib non-free'
+    COMPONENTS='main'
   fi
   echo "Using repository components $COMPONENTS"
 
index f565598..1696d9c 100644 (file)
@@ -12,7 +12,7 @@
 # should be handled in the main script, where it belongs.
 ################################################################################
 
-CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,defaultinterfaces,interactive,nodebootstrap,nointerfaces,nokernel,nopackages,filesystem:,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,vm,vmfile,vmsize:,keep_src_list,hostname:,password:,nopassword,grmlrepos,backportrepos,bootappend:,grub:,arch:,insecure,verbose,help,version,force,debug
+CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,defaultinterfaces,interactive,nodebootstrap,nointerfaces,nokernel,nopackages,filesystem:,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,vm,vmfile,vmsize:,keep_src_list,hostname:,password:,nopassword,grmlrepos,backportrepos,bootappend:,grub:,arch:,insecure,verbose,help,version,force,debug,contrib,non-free
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
     $CMDLINE_OPTS -- "$@"`
@@ -134,6 +134,12 @@ while :; do
   --grub)              # Target for grub installation. Use grub syntax for specifying
     shift; _opt_grub="$1"
     ;;
+  --contrib)           # Add 'contrib' to list of components
+    _opt_contrib=T
+    ;;
+  --non-free)          # Add 'non-free' to list of components
+    _opt_non_free=T
+    ;;
 
   # == Other options
   --verbose|-v)        # Increase verbosity
diff --git a/config b/config
index 6d682aa..918b028 100644 (file)
--- a/config
+++ b/config
@@ -73,7 +73,7 @@
 # RELEASE='jessie'
 
 # Define components that should be used within sources.list.
-# Default: 'main contrib non-free'
+# Default: 'main'
 # COMPONENTS='main contrib non-free'
 
 # Set target architecture.
index 9b8c47d..ca4172b 100755 (executable)
@@ -144,6 +144,8 @@ Configuration options:
       --grmlrepos          Enable Grml's Debian repository (deb.grml.org).
       --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).
       --hostname <name>    Hostname of Debian system.
       --nopassword         Do not prompt for the root password.
       --password <pwd>     Use specified password as password for user root.
@@ -394,6 +396,11 @@ fi
 [ "$_opt_verbose" ]             && VERBOSE="-v"
 [ "$_opt_debug" ]               && DEBUG="true"
 
+# make sure main is always included
+[ -z "$COMPONENTS" ]            && COMPONENTS="main"
+[ "$_opt_contrib" ]             && COMPONENTS="$COMPONENTS contrib"
+[ "$_opt_non_free" ]            && COMPONENTS="$COMPONENTS non-free"
+
 if [ "$DEBUG" = "true" ] ; then
   set -x
 fi
@@ -1228,6 +1235,7 @@ preparechroot() {
   [ -n "$ARCH" ]                && echo "ARCH='$(sed "s,','\\\\'',g" <<<"${ARCH}")'"                               >> "$CHROOT_VARIABLES"
   [ -n "$BACKPORTREPOS" ]       && echo "BACKPORTREPOS='$(sed "s,','\\\\'',g" <<<"${BACKPORTREPOS}")'"             >> "$CHROOT_VARIABLES"
   [ -n "$CHROOT_SCRIPTS" ]      && echo "CHROOT_SCRIPTS='$(sed "s,','\\\\'',g" <<<"${CHROOT_SCRIPTS}")'"           >> "$CHROOT_VARIABLES"
+  [ -n "$COMPONENTS" ]          && echo "COMPONENTS='$(sed "s,','\\\\'',g" <<<"${COMPONENTS}")'"                   >> "$CHROOT_VARIABLES"
   [ -n "$CONFFILES" ]           && echo "CONFFILES='$(sed "s,','\\\\'',g" <<<"${CONFFILES}")'"                     >> "$CHROOT_VARIABLES"
   [ -n "$DEBCONF" ]             && echo "DEBCONF='$(sed "s,','\\\\'',g" <<<"${DEBCONF}")'"                         >> "$CHROOT_VARIABLES"
   [ -n "$DEBIAN_FRONTEND" ]     && echo "DEBIAN_FRONTEND='$(sed "s,','\\\\'',g" <<<"${DEBIAN_FRONTEND}")'"         >> "$CHROOT_VARIABLES"