[Lunar-commits] CVS: lunar-iso/scripts aaa_base, 1.4, 1.5 init, 1.1, 1.2 initrd, 1.9, 1.10 kernels, 1.11, 1.12 moonbase, 1.1, 1.2 proper, 1.7, 1.8 rebuild, 1.2, 1.3 unpack, 1.2, 1.3

Auke Kok sofar at lunar-linux.org
Sun Mar 27 16:49:34 UTC 2005


Update of /var/cvs/lunar/lunar-iso/scripts
In directory espresso.foo-projects.org:/tmp/cvs-serv27184/scripts

Modified Files:
	aaa_base init initrd kernels moonbase proper rebuild unpack 
Log Message:
Merginf in nestu's kernel-version related code, as well as some fixes and small additions to the build code


Index: aaa_base
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/aaa_base,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- aaa_base	20 Mar 2005 13:06:10 -0000	1.4
+++ aaa_base	27 Mar 2005 16:49:31 -0000	1.5
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-umount $ISO_TARGET/proc
-umount $ISO_TARGET/dev
+umount $ISO_TARGET/proc &> /dev/null
+umount $ISO_TARGET/dev &> /dev/null
 
 . /etc/lunar/config
 unset VERBOSE

Index: init
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- init	22 Nov 2004 20:43:35 -0000	1.1
+++ init	27 Mar 2005 16:49:31 -0000	1.2
@@ -1,7 +1,8 @@
 #!/bin/bash
 
-if grep -qw $ISO_TARGET/proc /proc/mounts ; then
-  umount $ISO_TARGET/proc
+if [ -e $ISO_TARGET/proc ; then
+  umount $ISO_TARGET/proc &> /dev/null
+  umount $ISO_TARGET/dev &> /dev/null
 fi
 
 if [ -d "$ISO_TARGET" ] ; then
@@ -9,6 +10,7 @@
 fi
 
 mkdir -p $ISO_TARGET
+mkdir -p $ISO_SOURCE/{spool,cache}
 
 touch $ISO_TARGET/.init
 

Index: initrd
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/initrd,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- initrd	20 Mar 2005 15:16:24 -0000	1.9
+++ initrd	27 Mar 2005 16:49:31 -0000	1.10
@@ -4,8 +4,8 @@
 
 cd $ISO_SOURCE/initrd
 
-umount $ISO_SOURCE/BUILD/dev &> /dev/null
-umount $ISO_SOURCE/BUILD/proc &> /dev/null
+umount $ISO_TARGET/dev &> /dev/null
+umount $ISO_TARGET/proc &> /dev/null
 umount template/dev &> /dev/null
 umount template/proc &> /dev/null
 
@@ -14,30 +14,50 @@
 # template first
 cp -a --no-dereference template BUILD
 find BUILD -type d -name CVS -exec rm -rf {} \;
-mkdir -p BUILD/mnt BUILD/proc BUILD/var/lib/discover
+mkdir -p BUILD/{mnt,proc,var/lib/discover}
 
 echo "+ copying binaries and required files"
 # next up are the required stuff from the BUILD
-for ITEM in $(cat initrd.list); do
-    mkdir -p "BUILD/$(dirname $ITEM)"
-    cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$(dirname $ITEM)"
+cat initrd.list initrd.list-$ISO_KSUFFIX | while read ITEM DIR; do
+	if [ -n "$DIR" ]; then
+		mkdir -p BUILD/$DIR
+		cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$DIR"
+	else
+	    mkdir -p "BUILD/$(dirname $ITEM)"
+    	cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$(dirname $ITEM)"
+	fi
 done
 echo "+ filling /dev"
 
 # bare minimum of device nodes
 mkdir -p BUILD/dev
-cp -a --no-dereference $ISO_TARGET/etc/makedev.d/* BUILD/etc/makedev.d/
-cp template/etc/makedev.d/small BUILD/etc/makedev.d/generic
-$ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev generic
-$ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev console
-$ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev tty
-( cd BUILD/dev ; rm -f tty[a-zA-Z]* hd[i-z]* s[dg][i-z]* fd[2-9]* fd[0-1][a-zA-Z]* sd[a-z][a-z]* )
-mkdir BUILD/dev/vc
-for node in BUILD/dev/tty* ; do
-  ln -s $node $(echo $node | sed 's:tty:vc/:')
-done
-# strip it down even more
-rm -rf BUILD/etc/makedev.d/
+
+if [ "${ISO_KSUFFIX}" = "2.4" ]; then
+   cp -a --no-dereference $ISO_TARGET/etc/makedev.d/* BUILD/etc/makedev.d/
+   cp template/etc/makedev.d/small BUILD/etc/makedev.d/generic
+   $ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev generic
+   $ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev console
+   $ISO_TARGET/dev/MAKEDEV -c BUILD/etc/makedev.d/ -d BUILD/dev tty
+   ( cd BUILD/dev ; rm -f tty[a-zA-Z]* hd[i-z]* s[dg][i-z]* fd[2-9]* fd[0-1][a-zA-Z]* sd[a-z][a-z]* )
+   mkdir BUILD/dev/vc
+   for node in BUILD/dev/tty* ; do
+     ln -s $node $(echo $node | sed 's:tty:vc/:')
+   done
+   # strip it down even more
+   rm -rf BUILD/etc/makedev.d/
+
+   rm -f BUILD/dev/install-devices.sh
+
+else
+  (
+      cd BUILD/dev
+      mknod -m 0600 console c 5 1
+      mknod -m 0666 null    c 1 3
+      mknod -m 0600 ram0    b 1 0
+      ln -s ram0 ram
+      mknod -m 0600 ram1    b 1 1
+  )
+fi
 
 # we also generate aaa_dev.tar.bz2 now
 mkdir -p $ISO_SOURCE/aaa_dev
@@ -50,14 +70,13 @@
 for ITEM in $(find BUILD -type d -name "CVS"); do
     rm -rf $ITEM
 done
-rm -f BUILD/dev/install-devices.sh
 chroot BUILD /sbin/ldconfig
 rm -f BUILD/etc/mtab
 ln -s /proc/mounts BUILD/etc/mtab
 
 # compile the initrd image
 for KERNEL in linux safe ; do
-  KVER=$(file -k $ISO_SOURCE/kernels/$KERNEL | sed 's/.*\(version .*\)/\1/' | cut -d' ' -f2)
+  KVER=$(grep "^$KERNEL" $ISO_SOURCE/kernels/.initrd_kernels | cut -d" " -f2)
   mkdir TMP
   (
     cd TMP
@@ -87,7 +106,7 @@
 # calculate the size of the initrd image
 SIZE=$(du -kcs BUILD | tail -1 | cut -f1)
 echo "+ estimated $SIZE"
-(( SIZE = SIZE ))
+(( SIZE = SIZE + 1 ))
 echo "+ used size $SIZE"
 dd if=/dev/zero of=initrd.raw bs=1024 count=$SIZE
 losetup /dev/loop/0 initrd.raw

Index: kernels
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/kernels,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- kernels	13 Mar 2005 16:04:22 -0000	1.11
+++ kernels	27 Mar 2005 16:49:31 -0000	1.12
@@ -14,7 +14,9 @@
     cd linux-$ISO_KVER
     mkdir patches
     cd patches
-    tar jxf /var/spool/lunar/ll-$ISO_PVER.tar.bz2
+    if [ -f /var/spool/lunar/ll-$ISO_PVER.tar.bz2 ]; then
+		tar jxf /var/spool/lunar/ll-$ISO_PVER.tar.bz2
+	fi
 }
 
 prepare_patch()
@@ -29,9 +31,9 @@
 
 prepare_options()
 {
-    cp $ISO_SOURCE/kernels/baseconfig $ISO_SOURCE/kernels/linux-$ISO_KVER/.config 
+    cp $ISO_SOURCE/kernels/baseconfig-${ISO_KSUFFIX} $ISO_SOURCE/kernels/linux-$ISO_KVER/.config 
     for OPT in $@; do
-        cat $ISO_SOURCE/kernels/config_$OPT | while read O; do 
+        cat $ISO_SOURCE/kernels/config_$OPT-${ISO_KSUFFIX} | while read O; do 
             OPT=$(echo $O|cut -d= -f1)
             VAL=$(echo $O|cut -d= -f2)
             sedit "/$OPT=/d" $ISO_SOURCE/kernels/linux-$ISO_KVER/.config
@@ -55,7 +57,9 @@
     echo "+ building $ISO_KVER$1"
     cd $ISO_SOURCE/kernels/linux-$ISO_KVER
     yes n | make oldconfig &&
-    make dep &&
+	if [ "${ISO_KSUFFIX}" = "2.4" ]; then
+		make dep
+	fi &&
     make bzImage &&
     make modules &&
     mkdir -p $ISO_SOURCE/kernels/TAR
@@ -95,38 +99,61 @@
     prepare_version $1
     build_kernel $1 $5
     echo "$ISO_KVER$1:$4" >> $ISO_SOURCE/kernels/.kernels
+	if [ -n "$5" ]; then
+		echo "$5 $ISO_KVER$1" >> $ISO_SOURCE/kernels/.initrd_kernel
+	fi
 }
 
 VERBSOSE=on
 
 > $ISO_SOURCE/kernels/.kernels
+> $ISO_SOURCE/kernels/.initrd_kernels
+
+
+if [ "${ISO_KSUFFIX}" = "2.4" ]; then
+	
+	# required
+	build -safe-i386 "i386 nosmp lowmem safe" "fix" \
+		"Very safe i386 (default is i686) minimal kernel (no ACPI, DMA, SMP)" "safe"
+	# recommended
+	build -normal "nosmp lowmem" "fix main" \
+		"Normal kernel (no SMP) (RECOMMENDED)" "linux"
+	build -smp-4gb "smp mem" "fix main" \
+		"Normal SMP kernel with large memory (4GB)"
+	# build -agr "nosmp lowmem lowlat" "fix main aggressive" \
+	# 	"Low latency patch"
+	build -agr-smp-4gb "smp mem lowlat" "fix main aggressive" \
+		"Low latency patch, SMP, 4GB"
+	# build -stb "nosmp lowmem" "fix" \
+	# 	"Minimally patched"
+	# build -stb-smp-4gb "smp mem" "fix" \
+	# 	"Minimally patched, SMP, 4GB"
+	# build -vnl "nosmp lowmem" "" \
+	# 	"Unpatched"
+	build -vnl-smp-4gb "smp mem" "" \
+		"Unpatched, SMP, 4GB"
+	# build -grs "nosmp lowmem grsec" "fix main grsecurity" \
+	# 	"Grsecurity patch"
+	build -grs-smp-4gb "smp mem grsec" "fix main grsecurity" \
+		"Grsecurity patch, SMP, 4GB"
+	# build -om "nosmp lowmem om" "fix om" \
+	# 	"OpenMosix clustering"
+	build -om-smp-4gb "smp mem om" "fix om" \
+		"OpenMosix clustering, SMP, 4GB"
+
+else
+
+	build -safe-i386 "i386 nosmp lowmem safe" "" \
+		"Very safe i386 (default is i686) minimal kernel (no ACPI, DMA, SMP)" "safe"
+	build -normal "nosmp lowmem" "" \
+		"Normal kernel (no SMP) (RECOMMENDED)" "linux"
+	build -smp-4gb "smp mem" "" \
+		"Normal SMP kernel with large memory (4GB)"
+	#build -grs "nosmp lowmem grsec" "grsec" \
+	#	"Grsecurity patch"
+	#build -grs-smp-4gb "smp mem grsec" "grsec" \
+	#	"Grsecurity patch, SMP, 4GB"
+
+fi
 
-# required
-build -safe-i386 "i386 nosmp lowmem safe" "fix" \
-	"Very safe i386 (default is i686) minimal kernel (no ACPI, DMA, SMP)" "safe"
-# recommended
-build -normal "nosmp lowmem" "fix main" \
-	"Normal kernel (no SMP) (RECOMMENDED)" "linux"
-build -smp-4gb "smp mem" "fix main" \
-	"Normal SMP kernel with large memory (4GB)"
-# build -agr "nosmp lowmem lowlat" "fix main aggressive" \
-# 	"Low latency patch"
-build -agr-smp-4gb "smp mem lowlat" "fix main aggressive" \
-	"Low latency patch, SMP, 4GB"
-# build -stb "nosmp lowmem" "fix" \
-# 	"Minimally patched"
-# build -stb-smp-4gb "smp mem" "fix" \
-# 	"Minimally patched, SMP, 4GB"
-# build -vnl "nosmp lowmem" "" \
-# 	"Unpatched"
-build -vnl-smp-4gb "smp mem" "" \
-	"Unpatched, SMP, 4GB"
-# build -grs "nosmp lowmem grsec" "fix main grsecurity" \
-# 	"Grsecurity patch"
-build -grs-smp-4gb "smp mem grsec" "fix main grsecurity" \
-	"Grsecurity patch, SMP, 4GB"
-# build -om "nosmp lowmem om" "fix om" \
-# 	"OpenMosix clustering"
-build -om-smp-4gb "smp mem om" "fix om" \
-	"OpenMosix clustering, SMP, 4GB"
 

Index: moonbase
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/moonbase,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- moonbase	23 Nov 2004 13:08:09 -0000	1.1
+++ moonbase	27 Mar 2005 16:49:31 -0000	1.2
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-cd template
+cd $ISO_SOURCE/template
 wget http://lunar-linux.org/lunar/moonbase.tar.bz2
 lin moonbase
 

Index: proper
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/proper,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- proper	13 Mar 2005 16:04:22 -0000	1.7
+++ proper	27 Mar 2005 16:49:31 -0000	1.8
@@ -10,7 +10,8 @@
 echo "Press ENTER to continue with cleanup && .iso generation"
 read
 
-umount $ISO_TARGET/proc
+umount $ISO_TARGET/proc &> /dev/null
+umount $ISO_TARGET/dev &> /dev/null
 
 . /etc/lunar/config
 unset VERBOSE
@@ -80,5 +81,5 @@
 rm -rf $ISO_TARGET/usr/src $ISO_TARGET/var/build
 mkdir -p $ISO_TARGET/usr/src $ISO_TARGET/var/build
 
-touch BUILD/.proper
+touch $ISO_TARGET/.proper
 

Index: rebuild
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/rebuild,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rebuild	2 Feb 2005 13:50:02 -0000	1.2
+++ rebuild	27 Mar 2005 16:49:31 -0000	1.3
@@ -19,11 +19,11 @@
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 echo ""
 
-for mod in $(cat conf/base.list conf/extended.list) ; do
+for mod in $(cat conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list) ; do
   chroot $ISO_TARGET /sbin/lin --deps $mod
 done
 
-umount $ISO_TARGET/proc
+umount $ISO_TARGET/proc &> /dev/null
 chroot $ISO_TARGET lin makedev
 mount -t proc proc $ISO_TARGET/proc
 
@@ -35,20 +35,24 @@
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 echo ""
 
-chroot $ISO_TARGET lin linux-2.4
-chroot $ISO_TARGET lin kernel-headers-2.4
+chroot $ISO_TARGET lin linux-${ISO_KSUFFIX}
+chroot $ISO_TARGET lin kernel-headers-${ISO_KSUFFIX}
 
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 echo "+          STARTING COMPILE PHASE OF ALL MODULES       +"
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 echo ""
 
+# perl is notoriously problematic and needs to be built before glibc
 chroot $ISO_TARGET lin perl
 
-for mod in $(cat conf/base.list conf/extended.list) ; do
+for mod in $(cat conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list) ; do
   chroot $ISO_TARGET /sbin/lin -c $mod
 done
 
+# openssh installs ssh keys so these are now tracked in the module :^(
+chroot $ISO_TARGET /sbin/lin -c openssh
+
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
 echo "+          REBUILD FINISHED                            +"
 echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"

Index: unpack
===================================================================
RCS file: /var/cvs/lunar/lunar-iso/scripts/unpack,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- unpack	2 Feb 2005 13:50:02 -0000	1.2
+++ unpack	27 Mar 2005 16:49:31 -0000	1.3
@@ -25,7 +25,7 @@
 
 # unpack all the ISO required var/cache/lunar tarballs
 # in case of file conflict preserve glibc and gcc files first!
-for mods in ${ISO_LUNAR_MODULE} $(cat conf/base.list conf/extended.list) ; do
+for mods in ${ISO_LUNAR_MODULE} $(cat conf/base.list conf/base.list-$ISO_KSUFFIX conf/extended.list) ; do
   resurrect $mods
 done
 
@@ -33,7 +33,7 @@
 cp -a /usr/include/{linux,asm} $ISO_TARGET/usr/include/
 
 # fill var/spool/lunar dir
-for mod in $(cat conf/sources.list conf/base.list conf/extended.list) ; do
+for mod in $(cat conf/sources.list conf/sources.list-${ISO_KSUFFIX} conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list) ; do
   for file in $(lvu sources $mod) ; do
     echo -n "."
     if [ -f ${ISO_SOURCE}/spool/$file ] ; then



More information about the Lunar-commits mailing list