Support --nokernel option to skip installation of default kernel images
authorMichael Prokop <mika@grml.org>
Fri, 18 Apr 2014 23:38:14 +0000 (01:38 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 18 Apr 2014 23:38:41 +0000 (01:38 +0200)
As needed in a $customer environment (not to be named [yet]).

chroot-script
cmdlineopts.clp
grml-debootstrap
grml-debootstrap.8.txt

index 677f319..ce3f624 100755 (executable)
@@ -311,6 +311,11 @@ get_kernel_version() {
 
 # install kernel packages {{{
 kernel() {
 
 # install kernel packages {{{
 kernel() {
+  if [ -n "$NOKERNEL" ] ; then
+    echo "Skipping installation of kernel packages as requested via --nokernel"
+    return 0
+  fi
+
   $APTUPDATE
   KVER=$(get_kernel_version)
   if [ -n "$KVER" ] ; then
   $APTUPDATE
   KVER=$(get_kernel_version)
   if [ -n "$KVER" ] ; then
index 9c6bafa..dd1e933 100644 (file)
@@ -12,7 +12,7 @@
 # should be handled in the main script, where it belongs.
 ################################################################################
 
 # should be handled in the main script, where it belongs.
 ################################################################################
 
-CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,nointerfaces,nopackages,filesystem:,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,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:,interactive,nodebootstrap,nointerfaces,nokernel,nopackages,filesystem:,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,vmfile,vmsize:,keep_src_list,hostname:,password:,nopassword,grmlrepos,backportrepos,bootappend:,grub:,arch:,insecure,verbose,help,version,force,debug
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
     $CMDLINE_OPTS -- "$@"`
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
     $CMDLINE_OPTS -- "$@"`
@@ -110,6 +110,9 @@ while :; do
   --nointerfaces)      # Skip installation of /etc/network/interfaces
     _opt_nointerfaces=T
     ;;
   --nointerfaces)      # Skip installation of /etc/network/interfaces
     _opt_nointerfaces=T
     ;;
+  --nokernel)          # Skip installation of default kernel images
+    _opt_nokernel=T
+    ;;
   --nopassword)        # Skip password dialog
     _opt_nopassword=T
     ;;
   --nopassword)        # Skip password dialog
     _opt_nopassword=T
     ;;
index 493ed7a..3cccbca 100755 (executable)
@@ -96,6 +96,7 @@ Configuration options:
       --nointerfaces       Do not copy /etc/network/interfaces from host system
                            to target system.
                            (This option is automatically enabled when using --vmfile.)
       --nointerfaces       Do not copy /etc/network/interfaces from host system
                            to target system.
                            (This option is automatically enabled when using --vmfile.)
+      --nokernel           Skip installation of default kernel images.
       --debconf <file>     Pre-seed packages using specified pre-seed db file.
       --grmlrepos          Enable Grml's Debian repository (deb.grml.org).
       --backportrepos      Enable Debian's backports repository (backports.debian.org).
       --debconf <file>     Pre-seed packages using specified pre-seed db file.
       --grmlrepos          Enable Grml's Debian repository (deb.grml.org).
       --backportrepos      Enable Debian's backports repository (backports.debian.org).
@@ -332,6 +333,7 @@ fi
 [ "$_opt_password" ]            && ROOTPASSWORD=$_opt_password
 [ "$_opt_nopassword" ]          && NOPASSWORD='yes'
 [ "$_opt_nointerfaces" ]        && NOINTERFACES="true"
 [ "$_opt_password" ]            && ROOTPASSWORD=$_opt_password
 [ "$_opt_nopassword" ]          && NOPASSWORD='yes'
 [ "$_opt_nointerfaces" ]        && NOINTERFACES="true"
+[ "$_opt_nokernel" ]            && NOKERNEL="true"
 [ "$_opt_bootappend" ]          && BOOT_APPEND=$_opt_bootappend
 [ "$_opt_grub" ]                && GRUB=$_opt_grub
 [ "$_opt_arch" ]                && ARCH=$_opt_arch
 [ "$_opt_bootappend" ]          && BOOT_APPEND=$_opt_bootappend
 [ "$_opt_grub" ]                && GRUB=$_opt_grub
 [ "$_opt_arch" ]                && ARCH=$_opt_arch
@@ -1152,6 +1154,7 @@ preparechroot() {
   [ -n "$MKFS" ]                && echo "MKFS=\"$MKFS\""                               >> $CHROOT_VARIABLES
   [ -n "$NOPASSWORD" ]          && echo "NOPASSWORD=\"true\""                          >> $CHROOT_VARIABLES
   [ -n "$NOINTERFACES" ]        && echo "NOINTERFACES=\"true\""                        >> $CHROOT_VARIABLES
   [ -n "$MKFS" ]                && echo "MKFS=\"$MKFS\""                               >> $CHROOT_VARIABLES
   [ -n "$NOPASSWORD" ]          && echo "NOPASSWORD=\"true\""                          >> $CHROOT_VARIABLES
   [ -n "$NOINTERFACES" ]        && echo "NOINTERFACES=\"true\""                        >> $CHROOT_VARIABLES
+  [ -n "$NOKERNEL" ]            && echo "NOKERNEL=\"true\""                            >> $CHROOT_VARIABLES
   [ -n "$PACKAGES" ]            && echo "PACKAGES=\"$PACKAGES\""                       >> $CHROOT_VARIABLES
   [ -n "$PRE_SCRIPTS" ]         && echo "PRE_SCRIPTS=\"$PRE_SCRIPTS\""                 >> $CHROOT_VARIABLES
   [ -n "$RECONFIGURE" ]         && echo "RECONFIGURE=\"$RECONFIGURE\""                 >> $CHROOT_VARIABLES
   [ -n "$PACKAGES" ]            && echo "PACKAGES=\"$PACKAGES\""                       >> $CHROOT_VARIABLES
   [ -n "$PRE_SCRIPTS" ]         && echo "PRE_SCRIPTS=\"$PRE_SCRIPTS\""                 >> $CHROOT_VARIABLES
   [ -n "$RECONFIGURE" ]         && echo "RECONFIGURE=\"$RECONFIGURE\""                 >> $CHROOT_VARIABLES
index 9633864..334843d 100644 (file)
@@ -137,6 +137,13 @@ Options and environment variables
     Do not copy /etc/network/interfaces from host system to the target.
     This option is automatically enabled when using --vmfile.
 
     Do not copy /etc/network/interfaces from host system to the target.
     This option is automatically enabled when using --vmfile.
 
+*--nokernel*::
+
+    Skip installation of default kernel images. This option might be
+    interesting for you if you want a Debian system which doesn't
+    need to provide regular boot, e.g. a system which provides
+    ISOs for booting via GRUB using grml-rescueboot.
+
 *--nopackages*::
 
     Skip installation of packages defined in /etc/debootstrap/packages.
 *--nopackages*::
 
     Skip installation of packages defined in /etc/debootstrap/packages.