From 7b4a6eb4177f89293b003d301fe8a932e6406faa Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Tue, 12 Jul 2005 18:47:11 +0000 Subject: [PATCH] Adding --symlink to fix bug 98716 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@252 67a159dc-881f-0410-a524-ba9dfbe2cb84 --- gen_cmdline.sh | 4 ++++ gen_determineargs.sh | 7 +++++++ genkernel | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 3d8f36b..62dc673 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -384,6 +384,10 @@ parse_cmdline() { CMD_KERNNAME=`parse_opt "$*"` print_info 2 "KERNNAME: $CMD_KERNNAME" ;; + --symlink) + CMD_SYMLINK=1 + print_info 2 "CMD_SYMLINK: $CMD_SYMLINK" + ;; --no-kernel-sources) CMD_NO_KERNEL_SOURCES=1 print_info 2 "CMD_NO_KERNEL_SOURCES: $CMD_NO_KERNEL_SOURCES" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e2484fc..58628bb 100644 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -299,6 +299,13 @@ determine_real_args() { SAVE_CONFIG=0 fi + if isTrue "${CMD_SYMLINK}" + then + SYMLINK=1 + else + SYMLINK=0 + fi + if [ "${CMD_INSTALL_MOD_PATH}" != '' ] then INSTALL_MOD_PATH="${CMD_INSTALL_MOD_PATH}" diff --git a/genkernel b/genkernel index eff9f39..120a07b 100755 --- a/genkernel +++ b/genkernel @@ -364,6 +364,44 @@ else fi fi +if [ "${CMD_NOINSTALL}" != '1' -a "${SYMLINK}" = '1' ] +then + print_info 1 '' + print_info 1 'Creating symlinks' + + + print_info 1 ' creating kernel name symlink!' + if [ -e /boot/kernel-${KNAME}-${ARCH}-${KV} ] + then + /bin/rm /boot/kernel + ln -s /boot/kernel-${KNAME}-${ARCH}-${KV} /boot/kernel + ret=$? + [ ${ret} = '1' ] && print_error 1 'kernel link failed' + fi + + if [ "${PAT}" -gt '4' -a "${CMD_BOOTSPLASH}" != '1' ] + then + print_info 1 ' creating initramfs name symlink!' + if [ -e /boot/initramfs-${KNAME}-${ARCH}-${KV} ] + then + /bin/rm /boot/initramfs + ln -s /boot/initramfs-${KNAME}-${ARCH}-${KV} /boot/initramfs + ret=$? + [ ${ret} = '1' ] && print_error 1 'initramfs link failed' + fi + else + print_info 1 ' creating initrd name symlink!' + if [ -e /boot/initrd-${KNAME}-${ARCH}-${KV} ] + then + /bin/rm /boot/initrd + ln -s /boot/initrd-${KNAME}-${ARCH}-${KV} /boot/initrd + ret=$? + [ ${ret} = '1' ] && print_error 1 'initrd link failed' + fi + fi +fi + + [ "${BOOTRW}" != '' ] && mount -o remount,ro /boot print_info 1 '' -- 2.26.2