[Lunar-commits] <lunar-iso> Updated scripts
Stefan Wold
ratler at lunar-linux.org
Mon Mar 15 18:38:08 CET 2010
commit ba455a2683f21c96bd731f9ea8a4f6c4f4a1c2bb
Author: Stefan Wold <ratler at lunar-linux.org>
Date: Sun Feb 7 22:24:54 2010 +0100
Updated scripts
- aaa_base
- Fixed issue rmdir non directories
- Copy the correct lunar/local/optimization.* files
- initrd
- Udev fixes
- Copy only needed kernel modules
- rebuild
- sysvinit need to be rebuilt last, after removing inittab or it won't get tracked
- Changed GCC_4_2 -> GCC_4_4
---
scripts/aaa_base | 5 ++---
scripts/etc | 2 +-
scripts/initrd | 11 ++++++-----
scripts/rebuild | 12 +++++++++---
4 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/scripts/aaa_base b/scripts/aaa_base
index deec97d..63d474b 100755
--- a/scripts/aaa_base
+++ b/scripts/aaa_base
@@ -6,11 +6,10 @@ unset VERBOSE
echo "+ cleaning up (some) file structure items"
#rm -f $ISO_TARGET/etc/rc?.d/{*nfs,*xinetd,*serial,*portmap}
rm -rf $ISO_TARGET/var/cache/ccache/*
-rmdir /usr/lib/locale/*
chroot $ISO_TARGET ccache -C
chroot $ISO_TARGET ccache -M 256M
rm -rf $ISO_TARGET/etc/ssh/ssh_host_*key $ISO_TARGET/etc/ssh/ssh_host_*key.pub
-rmdir /usr/lib/locale/*
+rm -rf $ISO_TARGET/usr/lib/locale/*
sed -i 's/^MAKES=.*/MAKES=/' $ISO_TARGET/etc/lunar/local/optimizations.GNU_MAKE
# this might go wrong so force it's removal before creating it as empty file:
rm -f $ISO_TARGET/etc/mtab
@@ -53,7 +52,7 @@ find $ISO_TARGET/{bin,boot,etc,home,lib,mnt,opt,root,sbin,srv,usr,var} | sort |
# add the install logs
cat $ISO_TARGET/var/log/lunar/install/* | sort | uniq > $ISO_TARGET/.tracked
diff -U0 $ISO_TARGET/.tracked $ISO_TARGET/.present | grep '^\+[^+]' | sed 's/^+//g' > $ISO_TARGET/.aaa_base.list
-for n in /etc/lunar/local/optimizations.* ; do echo $n >> $ISO_TARGET/.aaa_base.list ; done
+for n in $ISO_TARGET/etc/lunar/local/optimizations.* ; do echo $n | sed "s;$ISO_TARGET;;" >> $ISO_TARGET/.aaa_base.list ; done
# make the tarball
chroot $ISO_TARGET tar cjf /var/cache/lunar/aaa_base.tar.bz2 -T .aaa_base.list --no-recursion
diff --git a/scripts/etc b/scripts/etc
index 0ec1765..31cb11e 100755
--- a/scripts/etc
+++ b/scripts/etc
@@ -25,7 +25,7 @@ mknod -m 666 $ISO_TARGET/dev/null c 1 3
# rerun ldconfig to make sure we're not stale
touch $ISO_TARGET/etc/ld.so.conf
-chroot $ISO_TARGET ldconfig
+chroot $ISO_TARGET /sbin/ldconfig
(
echo "+ installing moonbase"
diff --git a/scripts/initrd b/scripts/initrd
index dc03b26..5de077f 100755
--- a/scripts/initrd
+++ b/scripts/initrd
@@ -56,7 +56,8 @@ echo "+ copying and setting up udev rules"
(
cd $ISO_TARGET
cp --no-dereference -r etc/udev $ISO_SOURCE/initrd/BUILD/etc/
- for i in $ISO_SOURCE/initrd/BUILD/etc/udev/rules.d/*; do
+ cp --no-dereference -r lib/udev/rules.d $ISO_SOURCE/initrd/BUILD/lib/udev/
+ for i in $ISO_SOURCE/initrd/BUILD/lib/udev/rules.d/*; do
sed -i 's;GROUP=".*";;g' $i
done
)
@@ -107,10 +108,10 @@ for KERNEL in linux safe ; do
tar xjf $ISO_SOURCE/kernels/TAR/$KVER.tar.bz2
mkdir -p $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/drivers/
mkdir -p $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/fs/
- echo "+ cp -a --no-dereference lib/modules/$KVER/kernel/drivers/{block,md,ata,ide,scsi,usb/host} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/drivers/"
- cp -a --no-dereference lib/modules/$KVER/kernel/drivers/{block,md,ata,ide,scsi,usb/host} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/drivers/
- echo "+ cp -a --no-dereference lib/modules/$KVER/kernel/drivers/fs/{nls,fat,vfat,reiserfs,xfs,ext4} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/fs/"
- cp -a --no-dereference lib/modules/$KVER/kernel/fs/{nls,fat,vfat,reiserfs,xfs,ext4} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/fs/
+ echo "+ cp -a --no-dereference lib/modules/$KVER/kernel/drivers/{block,md,ata,scsi,usb/host} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/drivers/"
+ cp -a --no-dereference lib/modules/$KVER/kernel/drivers/{block,md,ata,scsi,usb/host} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/drivers/
+ echo "+ cp -a --no-dereference lib/modules/$KVER/kernel/drivers/fs/{nls,fat} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/fs/"
+ cp -a --no-dereference lib/modules/$KVER/kernel/fs/{nls,fat} $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/kernel/fs/
echo "+ cp lib/modules/$KVER/modules.* $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/"
cp lib/modules/$KVER/* $ISO_SOURCE/initrd/BUILD/lib/modules/$KVER/
echo "+ depmod -b $ISO_SOURCE/initrd/BUILD -a -F $ISO_SOURCE/kernels/$KERNEL.map $KVER"
diff --git a/scripts/rebuild b/scripts/rebuild
index 1080f6e..0265e30 100755
--- a/scripts/rebuild
+++ b/scripts/rebuild
@@ -3,7 +3,7 @@
export LC_ALL=C
# set gcc optimization
-echo "CPU=$ISO_GCCARCH" >> $ISO_TARGET/etc/lunar/local/optimizations.GCC_4_2
+echo "CPU=$ISO_GCCARCH" >> $ISO_TARGET/etc/lunar/local/optimizations.GCC_4_4
# do the parallel thingy?
if [ -n "$ISO_MAKES" ]; then
echo "MAKES=$ISO_MAKES" >> $ISO_TARGET/etc/lunar/local/optimizations.GNU_MAKE
@@ -67,7 +67,7 @@ chroot $ISO_TARGET lsh create_depends_cache
# glibc is special
chroot $ISO_TARGET /sbin/lin --deps --reconfigure glibc
-for mod in $(cat conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list | grep -v glibc | grep -v perl) ; do
+for mod in $(cat conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list | grep -v glibc | grep -v perl | grep -v sysvinit) ; do
yes '' | NEVER_ASK=y chroot $ISO_TARGET /sbin/lin --deps --reconfigure $mod
done
@@ -95,10 +95,13 @@ echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo ""
# perl is notoriously problematic and needs to be built before glibc
-chroot $ISO_TARGET /sbin/lin -c perl
+#chroot $ISO_TARGET /sbin/lin -c perl
chroot $ISO_TARGET /sbin/lin -c glibc
chroot $ISO_TARGET /sbin/lin -c gcc
+# Remove inittab to make sure it's tracked by sysvinit
+rm -f $ISO_TARGET/etc/inittab
+
# Compile everything but iptables (see next paragraph)
for mod in `lsh sort_by_dependency $(cat conf/base.list conf/base.list-${ISO_KSUFFIX} conf/extended.list | grep -v iptables)` ; do
if [ "$mod" == "glibc" ]; then
@@ -119,6 +122,9 @@ chroot $ISO_TARGET /sbin/lin -c openssh
chroot $ISO_TARGET /sbin/lin -c e2fsprogs
# we don't want vi linked against libX11
chroot $ISO_TARGET /sbin/lin -c vim --opts --without-x
+# We need to make sure inittab is included with sysvinit
+rm -f $ISO_TARGET/etc/inittab
+chroot $ISO_TARGET /sbin/lin -c sysvinit
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "+ REBUILD FINISHED +"
More information about the Lunar-commits
mailing list