CVS: moonbase/kernel/linux BUILD,1.13,1.14 POST_INSTALL,1.13,1.14

elaine at lunar-linux.org elaine at lunar-linux.org
Fri Oct 3 21:12:09 GMT 2003


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

Modified Files:
	BUILD POST_INSTALL 
Log Message:
Added saving of kernels (2 levels) 
Added lilo/grub edits to support .old kernels, but it seems to not work yet


Index: BUILD
===================================================================
RCS file: /var/cvs/lunar/moonbase/kernel/linux/BUILD,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- BUILD	27 Aug 2003 20:54:21 -0000	1.13
+++ BUILD	3 Oct 2003 21:12:07 -0000	1.14
@@ -27,12 +27,17 @@
   true
 done			
 
-backup_modules()  {
+backup_mods_krnl()  {
+
   if    [  -d  /lib/modules/$VERSION      ];  then
     rm   -rf   /lib/modules/$VERSION.old
     mv         /lib/modules/$VERSION      \
                /lib/modules/$VERSION.old
   fi
+
+  mv -f /boot/vmlinubz-$VERSION.old /boot/vmlinubz-$VERSION.old_2
+  cp -p /boot/vmlinubz-$VERSION /boot/vmlinubz-$VERSION.old
+
 }
 
 (
@@ -58,10 +63,10 @@
   fi                                         &&
   
   prepare_install                            &&
-  
+  touch /boot/vmlinubz-$VERSION              &&
+  backup_mods_krnl                           &&
   if grep -q "CONFIG_MODULES=y" .config
   then
-    backup_modules                           &&
     make modules_install
   fi                                         &&
   

Index: POST_INSTALL
===================================================================
RCS file: /var/cvs/lunar/moonbase/kernel/linux/POST_INSTALL,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- POST_INSTALL	6 Aug 2003 11:52:06 -0000	1.13
+++ POST_INSTALL	3 Oct 2003 21:12:07 -0000	1.14
@@ -11,6 +11,20 @@
 
 }
 
+lilo_old_image_entry()  {
+
+  cat  <<  EOF
+
+image                   =       /boot/vmlinubz-$VERSION.old
+        label           =       old-linux-$VERSION
+        read-only
+
+
+EOF
+}
+
+
+
 grub_image_entry()  {
 
 . $DEPENDS_CONFIG/grub
@@ -25,6 +39,22 @@
 
 }
 
+grub_old_image_entry()  {
+
+. $DEPENDS_CONFIG/grub
+
+  cat  <<  EOF
+
+title   old-linux-$VERSION
+kernel  $GRUB_BOOT/vmlinubz-$VERSION.old
+root    $GRUB_ROOT
+
+EOF
+
+}
+
+
+
 yaboot_image_entry()  {
 
   cat  <<  EOF
@@ -38,7 +68,9 @@
 }
 
 update_lilo()  {
-  if  !  grep  -q  "$VERSION"  /etc/lilo.conf;  then
+
+  if  ! ( grep  -q  "vmlinubz-$VERSION"  /etc/lilo.conf   &&
+          grep  -q  "vmlinubz-$VERSION.old" /etc/lilo.conf);  then
 
     IFS_OLD=$IFS
     export  IFS="
@@ -54,7 +86,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  "vmlinubz-$VERSION"  /etc/lilo.conf ; then
+            echo  -e  "`lilo_image_entry`"  >>  /etc/lilo.conf.new
+          fi
+          if  !  grep  -q  "vmlinubz-$VERSION.old"  /etc/lilo.conf;  then
+            echo  -e  "`lilo_old_image_entry`"  >>  /etc/lilo.conf.new
+          fi
         fi
         ((  IMAGE_COUNT++  ))
       fi
@@ -87,7 +124,8 @@
 
 
 update_grub()  {
-  if  !  grep  -q  "$VERSION"  /boot/grub/menu.lst;  then
+  if  ! ( grep  -q  "vmlinubz-$VERSION"  /boot/grub/menu.lst  &&
+          grep  -q  "vmlinubz-$VERSION.old" /boot/grub/menu.lst );  then
 
     IFS_OLD=$IFS
     export  IFS="
@@ -102,7 +140,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  "vmlinubz-$VERSION"  /boot/grub/menu.lst;  then
+            echo  -e  "`grub_image_entry`"  >>  /boot/grub/menu.lst.new
+          fi
+          if  !  grep  -q  "vmlinubz-$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