Use /live/image as default + vmlinuz/initrd.img to support new releases
authorMichael Prokop <mika@grml.org>
Tue, 11 Sep 2012 15:35:23 +0000 (17:35 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 11 Sep 2012 16:26:19 +0000 (18:26 +0200)
We don't use linux26 but vmlinuz as kernel file name
and initrd.img instead of minirt26.gz for the initramfs nowadays.

Thanks: Ulrich Dangel for helping resolve the mess

config
default_config
grml-terminalserver
grml-terminalserver-config
templates/grub-pxelinux_config

diff --git a/config b/config
index ab742c4..ea86850 100644 (file)
--- a/config
+++ b/config
 #KERNEL_VERSION_=""
 
 # this is the path where the grml image/cdrom is placed (mounted)
-# default: /cdrom
+# default: /live/image
 #MOUNT_POINT_=""
 
 # path + name of the linux kernel you would want to boot
-# default: /cdrom/boot/isolinux/linux26
+# default: /live/image/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: /cdrom/boot/isolinux/minirt26.gz
+# default: /live/image/boot/$GRML_NAME/initrd.img
 #ORIGINAL_INITRD_=""
 
 # path + name of the memtest image
-# default: /cdrom/boot/isolinux/memtest
+# default: /live/image/boot/addons/memtest
 #MEMTEST_IMAGE_=""
 
 # path to pxelinux boot message
-# default: /cdrom/boot/isolinux/boot.msg
+# default: /live/image/boot/isolinux/boot.msg
 #PXE_BOOT_MSG_=""
 
 # path to pxelinux boot logo
-# default: /cdrom/boot/isolinux/logo.16
+# default: /live/image/boot/isolinux/logo.16
 #PXE_BOOT_LOGO_=""
 
 # should the terminalserver activate snat for the clients to his default gateway?
index cc1ef4b..f643b45 100644 (file)
@@ -8,7 +8,7 @@ MODULES_PATH_="/lib/modules"
 
 KERNEL_VERSION_=`uname -r`
 
-if [ -e '/live/cow' ]; then
+if [ -e '/live/image' ]; then
   MOUNT_POINT_="/live/image"
 else
   MOUNT_POINT_="/cdrom"
@@ -39,8 +39,8 @@ if [[ $ADDONS_PATH_ == "" ]]; then
   ADDONS_PATH_="$MOUNT_POINT_"
 fi
 
-if [[ "$(find $DATA_PATH_/ -maxdepth 2 -name linux26 |head -n1)" != "" ]] ; then
-  MULTIBOOT_PATH_="$(dirname $(find $DATA_PATH_ -maxdepth 2 -name linux26 |head -n1))"
+if [[ "$(find $DATA_PATH_/ -maxdepth 2 -name vmlinuz |head -n1)" != "" ]] ; then
+  MULTIBOOT_PATH_="$(dirname $(find $DATA_PATH_ -maxdepth 2 -name vmlinuz |head -n1))"
 else
   MULTIBOOT_PATH_="$MOUNT_POINT_"
 fi
@@ -49,13 +49,13 @@ if [[ $MULTIBOOT_PATH_ == "" ]]; then
   MULTIBOOT_PATH_="$MOUNT_POINT_"
 fi
 
-KERNEL_IMAGE_="$MULTIBOOT_PATH_/linux26"
+KERNEL_IMAGE_="$MULTIBOOT_PATH_/vmlinuz"
 
 if [[ ! -f "$KERNEL_IMAGE_" ]] ; then
   KERNEL_IMAGE_="/boot/vmlinuz-$KERNEL_VERSION_"
 fi
 
-ORIGINAL_INITRD_="$MULTIBOOT_PATH_/initrd.gz"
+ORIGINAL_INITRD_="$MULTIBOOT_PATH_/initrd.img"
 
 MEMTEST_IMAGE_="$ADDONS_PATH_/memtest"
 if [ ! -f "$MEMTEST_IMAGE_" ] ; then
index b8328e8..e8a3015 100755 (executable)
@@ -210,11 +210,11 @@ 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_/minirt26.gz $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_/linux26" die
+    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
@@ -437,7 +437,7 @@ fi
 if [ $check_necessary_files_ == 'yes' ]; then
   # test for files absolutly necessary for grml-terminalserver and created from -config
   problem_=0
-  for i in $PATH_/minirt26.gz; do
+  for i in $PATH_/initrd.img; do
     isExistent $i warn || problem_=1
   done
   if [ $problem_ -eq 1 ]; then
index 698da5a..25836e5 100755 (executable)
@@ -117,11 +117,11 @@ function actionAutoconf
 # INITRD {{{
 function actionMkInitrd
 {
-  echo "Installing initrd $PATH_/minirt26.gz:"
+  echo "Installing initrd $PATH_/initrd.img:"
   # until we have a stable file location API let's use
   # an according heuristic
   initrd_=initrd.img-"$(uname -r)"
-  cp /boot/"$initrd_" "$PATH_"/minirt26.gz || die "Could not copy /boot/$initrd_"
+  cp /boot/"$initrd_" "$PATH_"/initrd.img || die "Could not copy /boot/$initrd_"
 }
 
 # }}}
@@ -248,7 +248,7 @@ function removeTmpFiles
 
 function actionClean
 {
-  for i in dhcpd.conf minirt26.gz; do
+  for i in dhcpd.conf initrd.img; do
     execute "rm -f $PATH_/$i*"
   done
 
index de1e348..1be9b18 100644 (file)
 # GLOBAL_README_END
 
 if grep -q live-media-path= /proc/cmdline 2>/dev/null ; then
-  live_media_path_="live-media-path=$(awk -F live-media-path= '{print $2}' /proc/cmdline)"
+  live_media_path_="live-media-path=$(awk -F live-media-path= '{print $2}' /proc/cmdline | awk '{print $1}')"
 fi
 if [ ! -d /live/image/boot ] ; then
   live_media_path_="live-media-path=/"
 fi
 
 # default boot arguments used for both grub and pxelinux
-if [ -e '/live/cow' ]; then
+if [ -e "$MOUNT_POINT_" ]; then
     default_boot_args_="root=/dev/nfs rw nfsroot=$IP_:$MOUNT_POINT_ \
 noprompt noeject"
 else
@@ -35,7 +35,7 @@ apm=power-off nomce"
 fi
 
 # special boot arguments required by grub
-grub_def_boot_args_="/linux26 $default_boot_args_ $live_media_path_"
+grub_def_boot_args_="/vmlinuz $default_boot_args_ $live_media_path_"
 
 # special boot arguments required by pxelinux
 pxe_def_boot_args_="$default_boot_args_"
@@ -54,7 +54,7 @@ timeout=10
 title GRML
   root (nd)
   kernel $grub_def_boot_args_ $def_fb_args_ $BOOT_ARGS_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title GRML no framebuffer
   root (nd)
@@ -63,27 +63,27 @@ title GRML no framebuffer
 title GRML small
   root (nd)
   kernel $grub_def_boot_args_ small $def_fb_args_ $BOOT_ARGS_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title GRML small nofb
   root (nd)
   kernel $grub_def_boot_args_ small $no_fb_args_ $BOOT_ARGS_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title GRML debuginit
   root (nd)
   kernel $grub_def_boot_args_ debuginitrd $def_fb_args_ $BOOT_ARGS_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title GRML debuginit nofb
   root (nd)
   kernel $grub_def_boot_args_ debuginitrd $no_fb_args_ $BOOT_ARGS_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title GRML rescue
   root (nd)
   kernel $grub_def_boot_args_ $no_fb_args_
-  initrd /minirt26.gz
+  initrd /initrd.img
 
 title memtest
   root (nd)
@@ -151,8 +151,8 @@ 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.*linux26/kernel linux26/' $config_files_
-  sed -i -e 's/\(initrd\)=[[:alnum:]/._-]*/\1=minirt26.gz/' $config_files_
+  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_