From 15a11433dd0fc15f7a16130578d1a50bd1cdcdcf Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 3 Jun 2015 15:48:22 +0200 Subject: [PATCH 1/1] Drop contrib + non-free from default COMPONENTS, support --contrib + -non-free cmdline options 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 | 2 +- cmdlineopts.clp | 8 +++++++- config | 2 +- grml-debootstrap | 8 ++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/chroot-script b/chroot-script index b283991..e1c183a 100755 --- a/chroot-script +++ b/chroot-script @@ -78,7 +78,7 @@ chrootmirror() { fi if [ -z "$COMPONENTS" ] ; then - COMPONENTS='main contrib non-free' + COMPONENTS='main' fi echo "Using repository components $COMPONENTS" diff --git a/cmdlineopts.clp b/cmdlineopts.clp index f565598..1696d9c 100644 --- a/cmdlineopts.clp +++ b/cmdlineopts.clp @@ -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 --- 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. diff --git a/grml-debootstrap b/grml-debootstrap index 9b8c47d..ca4172b 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -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 Hostname of Debian system. --nopassword Do not prompt for the root password. --password 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" -- 2.1.4