CVS: theedge/var/lib/lunar/functions kernel.lunar,1.3,1.4

niki at lunar-linux.org niki at lunar-linux.org
Sun Oct 5 19:29:11 GMT 2003


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv28696

Modified Files:
	kernel.lunar 
Log Message:
Changed the kernel filename format from using "-" to "_"


Index: kernel.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/kernel.lunar,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- kernel.lunar	5 Oct 2003 18:52:38 -0000	1.3
+++ kernel.lunar	5 Oct 2003 19:29:09 -0000	1.4
@@ -18,51 +18,51 @@
 #               module dirs.
 # Name        : backup_mods_krnl
 # Arg 1       : Filename of the kernel to backup (With or witout full path)
-#               With the format $MODULE_NAME-$VERSION-$EXTRAVERSION
-# Arg 2       : the number of levels we need to backup, minimu a number of 
+#               With the format $MODULENAME_$VERSION_$EXTRAVERSION
+# Arg 2       : the number of levels we need to backup, minimum a number of 
 #               "2" is required
 backup_mods_krnl()
 {
   debug_msg "backup_mods_krnl ($@)"
 
-  KERNEL_STRING=$(basename $1 | cut -d "-" -f "2-")
-  KERNEL_MODULE=$(basename $1 | cut -d "-" -f "-1")
-  KERNEL_VERSION=$(echo $KERNEL_STRING | cut -d "-" -f "1")
-  KERNEL_EXTRA=$(echo $KERNEL_STRING | cut -d "-" -f "2")
+  KERNEL_STRING=$(basename $1 | cut -d "_" -f "2-")
+  KERNEL_MODULE=$(basename $1 | cut -d "_" -f "-1")
+  KERNEL_VERSION=$(echo $KERNEL_STRING | cut -d "_" -f "1")
+  KERNEL_EXTRA=$(echo $KERNEL_STRING | cut -d "_" -f "2")
 
   BACKUP_LEVEL=$2
 
-  if [ -d /lib/modules/${KERNEL_STRING}.old_${I} ]; then
+  if [ -d /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_${I} ]; then
     verbose_msg "removing old kernel modules backup no. \"$BACKUP_LEVEL\""
-    rm -rf /lib/modules/${KERNEL_STRING}.old_${I}
+    rm -rf /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_${I}
   fi
-  if [ -f /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_${I} ]; then
+  if [ -f /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_${I} ]; then
     verbose_msg "removing old kernel backup no. \"$BACKUP_LEVEL\""
-    rm /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_${I}
+    rm /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_${I}
   fi
 
   for I in $(seq $BACKUP_LEVEL -1 1); do
-    if [ -d /lib/modules/${KERNEL_STRING}.old_$((${I} - 1)) ]; then
+    if [ -d /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_$((${I} - 1)) ]; then
       verbose_msg "moving kernel modules backup from no. \"$((${I} - 1))\" to \"${I}\""
-      mv /lib/modules/${KERNEL_STRING}.old_$((${I} - 1)) \
-         /lib/modules/${KERNEL_STRING}.old_${I}
+      mv /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_$((${I} - 1)) \
+         /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_${I}
     fi
 
-    if [ -f /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_$((${I} - 1 )) ]; then
+    if [ -f /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_$((${I} - 1 )) ]; then
       verbose_msg "moving kernel backup from no. \"$((${I} - 1))\" to \"${I}\""
-      mv /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_$((${I} - 1)) \
-         /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_${I}
+      mv /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_$((${I} - 1)) \
+         /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_${I}
     fi
   done
 
-  if [ -d /lib/modules/${KERNEL_STRING} ]; then
+  if [ -d /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA} ]; then
     verbose_msg "moving current kernel modules to first backup no. \"0\""
-    mv /lib/modules/${KERNEL_STRING}       \
-       /lib/modules/${KERNEL_STRING}.old_0
+    mv /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}       \
+       /lib/modules/${KERNEL_VERSION}-${KERNEL_EXTRA}.old_0
   fi
-  if [ -f /boot/${KERNEL_MODULE}-${KERNEL_STRING} ]; then
+  if [ -f /boot/${KERNEL_MODULE}_${KERNEL_STRING} ]; then
     verbose_msg "moving current kernel to first backup no. \"0\""
-    mv /boot/${KERNEL_MODULE}-${KERNEL_STRING}       \
-       /boot/${KERNEL_MODULE}-${KERNEL_STRING}.old_0
+    mv /boot/${KERNEL_MODULE}_${KERNEL_STRING}       \
+       /boot/${KERNEL_MODULE}_${KERNEL_STRING}.old_0
   fi
 }




More information about the Lunar-commits mailing list