CVS: moonbase/kernel/linux-vanilla POST_INSTALL,1.9,1.10

elaine at lunar-linux.org elaine at lunar-linux.org
Fri Oct 3 04:22:12 GMT 2003


Update of /var/cvs/lunar/moonbase/kernel/linux-vanilla
In directory dbguin.lunar-linux.org:/tmp/cvs-serv26238

Modified Files:
	POST_INSTALL 
Log Message:
Add .old kernel to lilo / grub menu defs


Index: POST_INSTALL
===================================================================
RCS file: /var/cvs/lunar/moonbase/kernel/linux-vanilla/POST_INSTALL,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- POST_INSTALL	6 Aug 2003 11:52:06 -0000	1.9
+++ POST_INSTALL	3 Oct 2003 04:22:10 -0000	1.10
@@ -3,14 +3,24 @@
   cat  <<  EOF
 
 image			=	/boot/vanilla-$VERSION
-	label		=	linux-$VERSION
+	label		=	vanilla-$VERSION
 	read-only
 	restricted
 
 EOF
-
 }
 
+lilo_old_image_entry()  {
+
+  cat  <<  EOF
+
+image			=	/boot/vanilla-$VERSION.old
+	label		=	old-vanilla-$VERSION
+	read-only
+
+
+EOF
+}
 
 grub_image_entry()  {
 
@@ -18,7 +28,7 @@
 
   cat  <<  EOF
 
-title   linux-$VERSION-vanilla
+title   vanilla-$VERSION
 kernel  $GRUB_BOOT/vanilla-$VERSION
 root    $GRUB_ROOT
 
@@ -26,9 +36,26 @@
 
 }
 
+grub_old_image_entry()  {
+
+. $DEPENDS_CONFIG/grub
+
+  cat  <<  EOF
+
+title   old-vanilla-$VERSION
+kernel  $GRUB_BOOT/vanilla-$VERSION.old
+root    $GRUB_ROOT
+
+EOF
+
+}
+
+
 
 update_lilo()  {
-  if  !  grep  -q  "vanilla-$VERSION"  /etc/lilo.conf;  then
+
+  if  ! ( grep  -q  "vanilla-$VERSION"  /etc/lilo.conf   && 
+          grep  -q  "vanilla-$VERSION.old" /etc/lilo.conf);  then
 
     IFS_OLD=$IFS
     export  IFS="
@@ -44,7 +71,12 @@
       if   echo  $LINE  |  grep  -q  "image"  ||
            echo  $LINE  |  grep  -q  "other"  ;  then
         if  (( IMAGE_COUNT  == 0  ));  then
-          echo  -e  "`lilo_image_entry`"  >>  /etc/lilo.conf.new
+	  if  !  grep  -q  "vanilla-$VERSION"  /etc/lilo.conf;  then
+            echo  -e  "`lilo_image_entry`"  >>  /etc/lilo.conf.new
+          fi
+	  if  !  grep  -q  "vanilla-$VERSION.old"  /etc/lilo.conf;  then
+            echo  -e  "`lilo_old_image_entry`"  >>  /etc/lilo.conf.new
+          fi
         fi
         ((  IMAGE_COUNT++  ))
       fi
@@ -77,7 +109,9 @@
 
 
 update_grub()  {
-  if  !  grep  -q  "vanilla-$VERSION"  /boot/grub/menu.lst;  then
+
+if  ! ( grep  -q  "vanilla-$VERSION"     /boot/grub/menu.lst && 
+        grep  -q  "vanilla-$VERSION.old" /boot/grub/menu.lst );  then
 
     IFS_OLD=$IFS
     export  IFS="
@@ -92,7 +126,12 @@
 
       if   echo  $LINE  |  grep  -q  "title";  then
         if  (( IMAGE_COUNT  == 0  ));  then
-          echo  -e  "`grub_image_entry`"  >>  /boot/grub/menu.lst.new
+          if  !  grep  -q  "vanilla-$VERSION"  /boot/grub/menu.lst;  then
+            echo  -e  "`grub_image_entry`"  >>  /boot/grub/menu.lst.new
+          fi
+          if  !  grep  -q  "vanilla-$VERSION.old"  /boot/grub/menu.lst;  then
+            echo  -e  "`grub_old_image_entry`"  >>  /boot/grub/menu.lst.new
+          fi
         fi
         ((  IMAGE_COUNT++  ))
       fi




More information about the Lunar-commits mailing list