Get rid of code which breaks Multi-ISO boot [Testing: issue1273]
authorAndreas "Jimmy" Gredler <jimmy@grml.org>
Sun, 23 Mar 2014 04:55:04 +0000 (21:55 -0700)
committerAndreas "Jimmy" Gredler <jimmy@grml.org>
Fri, 28 Mar 2014 08:43:56 +0000 (01:43 -0700)
Removed lots of code which is not needed any longer because grml2usb
can do a lot of the work.
Did some redesign to support multiple ISOs, see also bug report #1273.
Because of this changes it's no longer possible to overwrite the used
kernel in /etc/grml/terminalserver/config. This should not be needed
nowadays, anyway.

Fixed syntax error and wrong variable assignement

In default_config the variable MULTIBOOT was assigned wrong

config
debian/README.Debian
default_config
grml-terminalserver
grml-terminalserver-config
shared_prog_vars
templates/grub-pxelinux_config

diff --git a/config b/config
index b7e07b1..31cf08b 100644 (file)
--- a/config
+++ b/config
@@ -6,38 +6,10 @@
 # this is a shellscript fragment and will be sourced from both
 # grml-terminalserver AND grml-terminalserver-config
 
-
-# should be used if paths within the modules.dep do not refere to
-# the current root (if you want to use a module dir of an other
-# linux)
-# if you want to use /mnt/other-linux/lib/modules then:
-#   MODULES_PATH_=/mnt/other-linux/lib/modules
-#   MODULES_PATH_ROOT_DIFF_=/mnt/other-linux
-# default: <none>
-#MODULES_PATH_ROOT_DIFF_=""
-
-# path to the kernel modules you would want to use to create
-# the initrd (basedir eg. like /lib/modules)
-# default: /lib/modules
-#MODULES_PATH_=""
-
-# `uname -r` would give it to you, or THIS config file
-# default: `uname -r`
-#KERNEL_VERSION_=""
-
 # this is the path where the grml image/cdrom is placed (mounted)
 # default: /lib/live/mount/medium
 #MOUNT_POINT_=""
 
-# path + name of the linux kernel you would want to boot
-# default: /lib/live/mount/medium/boot/$GRML_NAME/vmlinuz
-#KERNEL_IMAGE_=""
-
-# this is the initrd the grml-terminalserver-config edits
-# if the file is not found, default will be used
-# default: /lib/live/mount/medium/boot/$GRML_NAME/initrd.img
-#ORIGINAL_INITRD_=""
-
 # path + name of the memtest image
 # default: /lib/live/mount/medium/boot/addons/memtest
 #MEMTEST_IMAGE_=""
index 9febcd1..12889f7 100644 (file)
@@ -2,7 +2,7 @@ grml-terminalserver for Debian
 ------------------------------
 
 Because of our switch to live-initramfs and default initramfs in general it's
-unfortunately not possibel anymore to run grml-terminalserver on anything other
+unfortunately not possible anymore to run grml-terminalserver on anything other
 than the system you want to netboot.
 
 So you have to create the initrd directly within the grml system you want to
index aee7983..e5e0863 100644 (file)
@@ -2,12 +2,6 @@
 # !!! DO NOT EDIT THIS FILE !!!
 # /etc/grml/terminalserver/config is what you are searching for
 
-MODULES_PATH_ROOT_DIFF_=""
-
-MODULES_PATH_="/lib/modules"
-
-KERNEL_VERSION_=`uname -r`
-
 if [ -e /lib/live/mount/medium ] ; then
   MOUNT_POINT_="/lib/live/mount/medium" # since around December 2012
 elif [ -e '/live/image' ]; then
@@ -42,7 +36,7 @@ if [[ $ADDONS_PATH_ == "" ]]; then
 fi
 
 if [[ "$(find $DATA_PATH_/ -maxdepth 2 -name vmlinuz |head -n1)" != "" ]] ; then
-  MULTIBOOT_PATH_="$(dirname $(find $DATA_PATH_ -maxdepth 2 -name vmlinuz |head -n1))"
+  MULTIBOOT_PATH_="${DATA_PATH_}"
 else
   MULTIBOOT_PATH_="$MOUNT_POINT_"
 fi
@@ -51,14 +45,6 @@ if [[ $MULTIBOOT_PATH_ == "" ]]; then
   MULTIBOOT_PATH_="$MOUNT_POINT_"
 fi
 
-KERNEL_IMAGE_="$MULTIBOOT_PATH_/vmlinuz"
-
-if [[ ! -f "$KERNEL_IMAGE_" ]] ; then
-  KERNEL_IMAGE_="/boot/vmlinuz-$KERNEL_VERSION_"
-fi
-
-ORIGINAL_INITRD_="$MULTIBOOT_PATH_/initrd.img"
-
 MEMTEST_IMAGE_="$ADDONS_PATH_/memtest"
 if [ ! -f "$MEMTEST_IMAGE_" ] ; then
   MEMTEST_IMAGE_=$(find /boot -name memtest*.bin | head -n1)
index e8a3015..1ce20ca 100755 (executable)
@@ -210,11 +210,8 @@ function createTftpConf
 
   execute "mkdir -p $TFTPD_DATA_DIR_/pxelinux.cfg" die
   execute "install -m 644 /usr/lib/syslinux/pxelinux.0 $TFTPD_DATA_DIR_" die
-  execute "install -m 644 $PATH_/initrd.img $TFTPD_DATA_DIR_" die
   if [ -d "$MOUNT_POINT_"/boot/release ] ; then
     cp -r "$MOUNT_POINT_"/boot/release "$TFTPD_DATA_DIR_"
-  else
-    execute "install -m 644 $KERNEL_IMAGE_ $TFTPD_DATA_DIR_/vmlinuz" die
   fi
   [ -f "$MEMTEST_IMAGE" ] && execute "install -m 644 $MEMTEST_IMAGE_ $TFTPD_DATA_DIR_/memtest" die
   execute "install -m 644 $PXE_BOOT_MSG_ $TFTPD_DATA_DIR_" die
@@ -396,14 +393,12 @@ isExistent $DEFAULT_CONFIG_ die
 . $CONFIG_
 # used config vars:
 # MOUNT_POINT_
-# KERNEL_IMAGE_
 # MEMTEST_IMAGE_
 # PXE_BOOT_MSG_
 # PXE_BOOT_LOGO_
-if [[ $MOUNT_POINT_ == "" || $KERNEL_IMAGE_ == "" || $MEMTEST_IMAGE_ == "" || \
+if [[ $MOUNT_POINT_ == "" || $MEMTEST_IMAGE_ == "" || \
   $PXE_BOOT_MSG_ == "" || $PXE_BOOT_MSG_ == "" ]]; then
   warn "MOUNT_POINT_=\"$MOUNT_POINT_\" \
-KERNEL_IMAGE_=\"$KERNEL_IMAGE_\" \
 MEMTEST_IMAGE_=\"$MEMTEST_IMAGE_\"
 PXE_BOOT_MSG_=\"$PXE_BOOT_MSG_\"
 PXE_BOOT_LOGO_=\"$PXE_BOOT_LOGO_\""
index 9b01239..50000b6 100755 (executable)
@@ -222,7 +222,7 @@ the internet?"
   echo -n "" >"$TMP_"
   local OPTIONS_BOOTARG_MESSAGE_="Here you can add additional boot arguments for the clients seperated by spaces:
 
-Quite usefull examples:
+Quite useful examples:
 
 ssh=<pw>              - Start ssh server and set password of user grml to pw
 services=<1,2,3>      - Execute /etc/init.d/{1,2,3} start
@@ -289,18 +289,6 @@ setExitFunction 'removeTmpFiles'
 
 . $DEFAULT_CONFIG_
 . $CONFIG_
-# used config vars:
-# MODULES_PATH_
-# MODULES_PATH_ROOT_DIFF_
-# KERNEL_VERSION_
-# ORIGINAL_INITRD_
-if [[ $MODULES_PATH_ == "" || $KERNEL_VERSION_ == "" || $ORIGINAL_INITRD_ == "" ]]; then
-  warn "MODULES_PATH_=\"$MODULES_PATH_\" \
-KERNEL_VERSION_=\"$KERNEL_VERSION_\" \
-ORIGINAL_INITRD_=\"$ORIGINAL_INITRD_\""
-  die "False configuration, please update $CONFIG_"
-fi
-
 
 case "$1" in
   interactive)  actionInteractive ;;
index d0c9f3b..9f5d29c 100644 (file)
@@ -63,18 +63,5 @@ TFTPD_PID_="/var/run/grml-tftpd.pid"
 # the dir where the templates for the configuration files are stored
 TEMPLATE_CONFIG_DIR_="$USR_SHARE_/templates"
 
-# maximum initrd size
-MAX_INITRD_SIZE_=16000
-
-# path to uclibc
-UCLIBC_PATH_="/usr/i386-uclibc-linux/lib"
-
-# this is where the terminalserver-config creates the initrd
-INITRD_="$PATH_/mini-root"
-
-# only for this cards (kernel module names of drivers) drivers are copied into
-# the initrd
-CARDS_DETECTED_BY_DISCOVER="$PATH_/discover_netcards"
-
 # as long as this pattern is in a config file, it will be overwritten every time
 CONFIG_PATTERN_="__PLEASE_UPDATE_THIS_FILE__"
index d2fb6e9..069c756 100644 (file)
@@ -157,25 +157,20 @@ EOT
 
 fi
 
+# Copy initrd.img and vmlinuz from all directories which name begins
+# with grml, e.g. grml32full and grml64full
+# This way we can boot multiple ISOs
+for filename in $(ls -d ${MULTIBOOT_PATH_}/grml*); do
+  cp -r ${filename} ${TFTPD_DATA_DIR_}/boot/
+done 
 
 config_files_=$(find "$TFTPD_DATA_DIR_/" -name "*.cfg" -type f)
 
 # cd is multi iso, grml2usb got it right ;0
 if [ -d "$MOUNT_POINT_"/boot/release ] ; then
    sed -i -e 's#\(.*\)/boot/\(.*\)#\1\2#' $config_files_
-else
-  # remove normal kernel path and use our image
-  sed -i -e 's/.*kernel.*vmlinuz/  kernel vmlinuz/' $config_files_
-  sed -i -e 's/\(initrd\)=[[:alnum:]/._-]*/\1=initrd.img/' $config_files_
-  # remove live-media-path per default
-  sed -i -e 's#live-media-path=[[:alnum:]/._-]*##' $config_files_
-
-  # append live-media-path if needed
-  if [ ! -z "$live_media_path_" ] ; then
-    sed -i -e "s#\(^.*append.*initrd.*$\)#\1 $live_media_path_#" $config_files_
-  fi
-
 fi
+
 # adjust ldbsd.com bootline
 sed -i -e 's#\(.*kernel .*/ldbsd.com\)#\1 set image /boot/addons/bsd4grml/bsd.rd`echo Type "boot" to load MirOS bsd4grml via keeppxe#' "$TFTPD_DATA_DIR_/"addon_*_bsd.cfg