Adding --symlink to fix bug 98716
authorEric Edgar <rocket@gentoo.org>
Tue, 12 Jul 2005 18:47:11 +0000 (18:47 +0000)
committerEric Edgar <rocket@gentoo.org>
Tue, 12 Jul 2005 18:47:11 +0000 (18:47 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@252 67a159dc-881f-0410-a524-ba9dfbe2cb84

gen_cmdline.sh
gen_determineargs.sh
genkernel

index 3d8f36b65649b25ba10bd2639bd4e122eb174b90..62dc67305b0521162a414c63dab8108de678c4a9 100755 (executable)
@@ -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"
index e2484fc807149e2b95cfc86e8495bab6b558d9e0..58628bb21fbed1151c9e5810ddb7cb663c86785c 100644 (file)
@@ -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}"
index eff9f391904c8cd83184d61afd4b4e551585ce34..120a07bd204800fd45fb0560cd29cec655a1af49 100755 (executable)
--- 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 ''