Hi,

I was busy making a script  and  I  stumbled  upon  /sbin/installkernel.
Which does some weird stuff.

Please take a look at my patch with motivation comments.



Groetjes, Han.
-- 
http://www.xs4all.nl/~hanb/software
--- installkernel.mdk   2002-08-17 12:36:03.000000000 +0200
+++ installkernel       2002-08-17 12:55:34.000000000 +0200
@@ -26,10 +26,13 @@
     source /etc/sysconfig/installkernel
 fi
 
-function read_link () {
-    #at this time we have perl since we do kernel copy
-    [[ -x /usr/bin/perl ]] && perl -e '{print readlink shift, "\n"}' $1
-}
+# Heej why do easy when you can do it the hard way?
+# Just use readlink like this nifty little module does.
+#
+#function read_link () {
+#    #at this time we have perl since we do kernel copy
+#    [[ -x /usr/bin/perl ]] && perl -e '{print readlink shift, "\n"}' $1
+#}
 
 function copy_image () {
     local config=""
@@ -37,12 +40,13 @@
 
     if [[ -f .config ]];then
        config=.config
-    elif [[ -f ../../../.config ]];then
-       config=../../../.config
+# Is there any good reason why this should be included? If there is, please use a 
+direct instead on an indirect url.
+#    elif [[ -f ../../../.config ]];then
+#      config=../../../.config
     fi
     
     if [ -L $boot/vmlinuz ];then
-       link=$(read_link $boot/vmlinuz)
+       link=`readlink $boot/vmlinuz`
        link=${link##*/} #make it relative
        rm -f /boot/vmlinuz
        [[ "${boot}/${link}" != "${boot}/vmlinuz-${version}" && -f ${boot}/${link} ]] 
&& ln -sf ${link} /boot/vmlinuz.old

Reply via email to