[Lunar-commits] CVS: theedge/var/lib/lunar/functions kernel.lunar,
1.10, 1.11
Auke Kok
sofar at lunar-linux.org
Fri Nov 19 14:42:16 UTC 2004
Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory espresso.foo-projects.org:/tmp/cvs-serv6654/var/lib/lunar/functions
Modified Files:
kernel.lunar
Log Message:
Pretty format lilo config lines: empty line between images and use human-readable output abit.
Index: kernel.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/kernel.lunar,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- kernel.lunar 7 Jan 2004 05:22:25 -0000 1.10
+++ kernel.lunar 19 Nov 2004 14:42:13 -0000 1.11
@@ -60,18 +60,6 @@
IMAGE_NAME=$1
BOOT_LABEL=$2
- LILO_IMAGE_ENTRY="
-image = /boot/$IMAGE_NAME
- label = $BOOT_LABEL
- read-only
-"
-
- LILO_OLD_IMAGE_ENTRY="
-image = /boot/$IMAGE_NAME.old
- label = $BOOT_LABEL.old
- read-only
-"
-
if ! ( grep -q "$IMAGE_NAME" /etc/lilo.conf && grep -q "$IMAGE_NAME.old" /etc/lilo.conf ) ; then
IFS_OLD=$IFS
export IFS="
@@ -82,12 +70,13 @@
(( IMAGE_COUNT=0 ))
for LINE in $(cat /etc/lilo.conf) ; do
if echo $LINE | grep -q "image" || echo $LINE | grep -q "other" ; then
+ echo >> /etc/lilo.conf.new
if (( IMAGE_COUNT == 0 )) ; then
if ! grep -q "$IMAGE_NAME" /etc/lilo.conf ; then
- echo -e "$LILO_IMAGE_ENTRY" >> /etc/lilo.conf.new
+ printf "\nimage = %s\n label = %s\n read-only\n\n" "/boot/$IMAGE_NAME" "$BOOT_LABEL" >> /etc/lilo.conf.new
fi
- if [ -f /boot/"$IMAGE_NAME.old" ] && ! grep -q "$IMAGE_NAME.old" /etc/lilo.conf ; then
- echo -e "$LILO_OLD_IMAGE_ENTRY" >> /etc/lilo.conf.new
+ if [ -f "/boot/$IMAGE_NAME.old" ] && ! grep -q "$IMAGE_NAME.old" /etc/lilo.conf ; then
+ printf "\nimage = %s\n label = %s\n read-only\n\n" "/boot/$IMAGE_NAME.old" "$BOOT_LABEL.old" >> /etc/lilo.conf.new
fi
fi
(( IMAGE_COUNT++ ))
@@ -99,11 +88,12 @@
done
if (( IMAGE_COUNT == 0 )) ; then
+ echo >> /etc/lilo.conf.new
if ! grep -q "$IMAGE_NAME" /etc/lilo.conf ; then
- echo -e "$LILO_IMAGE_ENTRY" >> /etc/lilo.conf.new
+ printf "\nimage = %s\n label = %s\n read-only\n\n" "/boot/$IMAGE_NAME" "$BOOT_LABEL" >> /etc/lilo.conf.new
fi
if [ -f /boot/"$IMAGE_NAME.old" ] && ! grep -q "$IMAGE_NAME.old" /etc/lilo.conf ; then
- echo -e "$LILO_OLD_IMAGE_ENTRY" >> /etc/lilo.conf.new
+ printf "\nimage = %s\n label = %s\n read-only\n\n" "/boot/$IMAGE_NAME.old" "$BOOT_LABEL.old" >> /etc/lilo.conf.new
fi
fi
More information about the Lunar-commits
mailing list