Skip to content

Commit

Permalink
Use /live/image as default + vmlinuz/initrd.img to support new releases
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mika committed Sep 11, 2012
1 parent 1b5bc3a commit 17edea1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions config
Expand Up @@ -26,28 +26,28 @@
#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?
Expand Down
10 changes: 5 additions & 5 deletions default_config
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions grml-terminalserver
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions grml-terminalserver-config
Expand Up @@ -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_"
}

# }}}
Expand Down Expand Up @@ -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

Expand Down
22 changes: 11 additions & 11 deletions templates/grub-pxelinux_config
Expand Up @@ -18,14 +18,14 @@
# 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
Expand All @@ -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_"
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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_

Expand Down

0 comments on commit 17edea1

Please sign in to comment.