[Fai-commit] r4184 - in people/h01ger/live-CD: . live-include-dir

Oliver Osburg oz-guest at alioth.debian.org
Thu Nov 30 22:39:45 CET 2006


Author: oz-guest
Date: 2006-11-30 22:39:45 +0100 (Thu, 30 Nov 2006)
New Revision: 4184

Modified:
   people/h01ger/live-CD/README.txt
   people/h01ger/live-CD/live-include-dir/real-hook
   people/h01ger/live-CD/live-include-dir/run_fai
   people/h01ger/live-CD/make-live.conf
Log:
This should be an almost working version. I had trouble setting the 
correct repostiories so expect to have them, too :)



Modified: people/h01ger/live-CD/README.txt
===================================================================
--- people/h01ger/live-CD/README.txt	2006-11-30 17:00:04 UTC (rev 4183)
+++ people/h01ger/live-CD/README.txt	2006-11-30 21:39:45 UTC (rev 4184)
@@ -18,4 +18,5 @@
 - the live-cd works, but grub installation is buggy
 - install sequence runs now in softupdate-mode. 
   This should probably be change to dirinstall or install
-- base.tgz has to be taken from some FAI nfsroot.
+- FIX NEEDED: /etc/fstab has to be copied from $LOGDIR (wherever that 
+  is)

Modified: people/h01ger/live-CD/live-include-dir/real-hook
===================================================================
--- people/h01ger/live-CD/live-include-dir/real-hook	2006-11-30 17:00:04 UTC (rev 4183)
+++ people/h01ger/live-CD/live-include-dir/real-hook	2006-11-30 21:39:45 UTC (rev 4184)
@@ -8,7 +8,6 @@
 #
 mkdir -p /srv/fai/config
 cp -ravx /usr/share/doc/fai-doc/examples/simple/* /srv/fai/config/
-
 # fixme: this is just a wordaround for #390504
 mkdir -p /var/lib/fai
 ln -s /srv/fai/config /var/lib/fai/config
@@ -17,8 +16,6 @@
 # fai.conf is still incomplete, but we cannot complete it yet... (see below)
 # we need from fai-nfsroot for fai-mirror:
 mv /mount2dir /usr/lib/fai/
-
-
 #
 # run fai at boot
 #
@@ -26,11 +23,6 @@
 update-rc.d run_fai start 99 2 3 4 5 . 
 
 #
-# copy base.tgz
-#
-cp base.tgz /var/tmp
-
-#
 # no autologin to casper user account
 #
 ### missing, not important atm
@@ -41,7 +33,7 @@
 ## WARNING: /srv/fai/nfsroot/var/tmp/packages.nfsroot does not exists.
 ##	minus fai-nfsroot and lilo
 ## Can't add those packages. Maybe the nfsroot is not yet created.
-cat >> /srv/fai/config/package_config/live << EOF
+cat > /srv/fai/config/package_config/live << EOF
 
 PACKAGES install
 adduser apt apt-utils aptitude base-files base-passwd bash bsdmainutils bsdutils coreutils cpio cron debconf debconf-i18n debianutils diff dmidecode dpkg dselect e2fslibs e2fsprogs ed findutils gcc-4.1-base gettext-base gnupg grep groff-base gzip hostname ifupdown initscripts iptables iputils-ping klogd laptop-detect libacl1 libattr1 libblkid1 libbz2-1.0 libc6 libcap1 libcomerr2 libconsole libdb4.2 libdb4.3 libdb4.4 libdevmapper1.02 libgcc1 libgcrypt11 libgdbm3 libgnutls13 libgpg-error0 libldap-2.3-0 libldap2 liblocale-gettext-perl liblzo1 liblzo2-2 libncurses5 libncursesw5 libnewt0.52 libopencdk8 libpam-modules libpam-runtime libpam0g libpopt0 libreadline5 libsasl2 libselinux1 libsepol1 libsigc++-1.2-5c2 libsigc++-2.0-0c2a libslang2 libss2 libssl0.9.8 libstdc++6 libtasn1-2 libtasn1-3 libtasn1-3-bin libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libusb-0.1-4 libuuid1 libwrap0 login logrotate lsb-base makedev man-db manpages mawk mktemp module-init-tools modutils mount nano ncurses-base ncurses-bin net-tools netbase netcat openbsd-inetd passwd perl-base procps readline-common sed sysklogd sysv-rc sysvinit tar tasksel tasksel-data tcpd traceroute tzdata util-linux vim-common vim-tiny wget whiptail zlib1g
@@ -75,22 +67,31 @@
 # first EOF in brackets to avoid escaping of variables
 cat > /srv/fai/config/hooks/softupdate.DEFAULT << 'EOF'
 #!/bin/bash
-swapoff /dev/hda5
+export LOGDIR=/tmp/fai/
+mkdir $LOGDIR
+export FAI=/srv/fai/config
+SWAP=`swapon -s | grep part | cut -d" " -f1`
+swapoff $SWAP
 set_disk_info
 #load_keymap_consolechars
 
-/etc/init.d/udev stop
+#/etc/init.d/udev stop
+#  
+. /usr/lib/fai/subroutines
+. /usr/lib/fai/subroutines-linux
+export do_init_tasks=1
+FAI_FLAGS="$FAI_FLAGS, createvt"
+task_setup
 task_partition
 task_mountdisks	
-task_extrbase
 
 # use debootstrap instead of task_extrbase	
-#echo start debootstrap
-#echo "target=$target"
-#df -h
-#debootstrap etch /tmp/target file:///media/mirror
+echo start debootstrap
+echo "target=$target"
+df -h
+debootstrap etch /tmp/target file:///media/mirror
 mkdir -p $target/media/mirror/debian
-#echo mounting mirror into chroot
+echo mounting mirror into chroot
 mount --bind /media/mirror $target/media/mirror/debian
 cat <<'FOE' > $target/etc/apt/apt.conf.d/10fai
 APT::Get::AllowUnauthenticated "true";
@@ -112,21 +113,60 @@
 echo "debug: softinstall!!"
 chroot $target mount -t proc proc /proc
 chroot $target mount -t sysfs sysfs /sys
+/etc/init.d/udev stop
+mkdir $target/dev/.initramfs
 chroot $target /etc/init.d/udev start
 mkdir -p $target/srv/fai/
 cp -rp /srv/fai/config $target/srv/fai/
-. /srv/fai/config/scripts/GRUB/10-setup
-task_installsoft
+for i in `cat $LOGDIR/disk_var.sh`; do export $i; done
+/srv/fai/config/scripts/GRUB/10-setup
+echo "target is: " $target
+#
+# DEBUG: what's up with LOGDIR?
+echo "cp $LOGDIR/fstab $target/etc/fstab"
+rm $target/etc/fstab
+cp /tmp/fai/fstab /tmp/target/etc/fstab
+task_configure
+/usr/lib/fai/get-boot-info
+#task_softupdate
+echo "copy fstab"
+
+if [ -f $LOGDIR/fstab ] ; then
+	echo "fstab found. OK"
+	cp $LOGDIR/fstab
+else
+        echo "fstab NOT found :-("
+fi
 EOF
+cp /srv/fai/config/hooks/softupdate.DEFAULT /srv/fai/config/hooks/dirinstall.DEFAULT
+
 #
+#
+# make mirror on cd...
+#
+mkdir -p /media/mirror
+# fixme: I386 and AMD64 only if...
+rm /etc/fai/apt/sources.list
+cp /etc/apt/sources.list /etc/fai/apt/sources.list
+fai-mirror -v -c live,DEFAULT,DEMO,FAIBASE,I386,CHROOT,AMD64,DHCPC,GRUB /media/mirror > /bla.log 2>&1
+# new sources.list for this mirror
+mv /sources.list /etc/fai/apt/
+
+# another workaround
+# during fai-mirror run, FAI_ROOT needs to be set to an existing chroot...
+echo target=/tmp/target >> /etc/fai/fai.conf
+echo FAI_ROOT=/tmp/target >> /etc/fai/fai.conf
 # fix grub install - thanks to Oliver 'oz' Osburg
 #fixme: fstab fehlt
-cat /srv/fai/config/scripts/GRUB/10-setup << 'EOF'
-#! /bin/bash
+cat > /srv/fai/config/scripts/GRUB/10-setup << 'EOF'
+#!/bin/bash
 set -a
 [ -r /var/log/fai/current/disk_var.sh ] && . /var/log/fai/current/disk_var.sh
 error=0 ; trap "error=$((error|1))" ERR
 #fcopy -Uv boot/grub/menu.lst
+rm boot/grub/menu.lst
+cp /proc/mounts /etc/mtab
+for i in `cat $LOGDIR/disk_var.sh`; do export $i; done
 mkdir -p $target/boot/grub
 grub-install --no-floppy --root-directory=$target $BOOT_DEVICE
 GROOT=$(device2grub $BOOT_PARTITION)
@@ -143,25 +183,8 @@
 #
 chmod +x /srv/fai/config/scripts/GRUB/10-setup 
 chmod +x /srv/fai/config/hooks/softupdate.DEFAULT
-
-
 #
-# make mirror on cd...
-#
-mkdir -p /media/mirror
-# fixme: I386 and AMD64 only if...
-fai-mirror -v -c live,DEFAULT,DEMO,FAIBASE,I386,CHROOT,AMD64,DHCPC,GRUB /media/mirror
-# new sources.list for this mirror
-mv /sources.list /etc/fai/apt/
-
-# another workaround
-# during fai-mirror run, FAI_ROOT needs to be set to an existing chroot...
-echo target=/tmp/target >> /etc/fai/fai.conf
-echo FAI_ROOT=/tmp/target >> /etc/fai/fai.conf
-
-#
 # cleanup make-live hooks
 #
 rm /hook
 rm /real-hook
-

Modified: people/h01ger/live-CD/live-include-dir/run_fai
===================================================================
--- people/h01ger/live-CD/live-include-dir/run_fai	2006-11-30 17:00:04 UTC (rev 4183)
+++ people/h01ger/live-CD/live-include-dir/run_fai	2006-11-30 21:39:45 UTC (rev 4184)
@@ -15,7 +15,7 @@
 	# so we go for softupdates...
 	#
 	unset LANG
-        sh -xv /usr/sbin/fai  -N softupdate
+        sh /usr/sbin/fai  -N softupdate
 	;;
   *)
   	echo doing nothing

Modified: people/h01ger/live-CD/make-live.conf
===================================================================
--- people/h01ger/live-CD/make-live.conf	2006-11-30 17:00:04 UTC (rev 4183)
+++ people/h01ger/live-CD/make-live.conf	2006-11-30 21:39:45 UTC (rev 4184)
@@ -46,16 +46,18 @@
 #LIVE_MANIFEST=""
 
 # Debian mirror			(Default: http://ftp.debian.org/debian/)
-LIVE_MIRROR="http://ftp.de.debian.org/debian/"
+#LIVE_MIRROR="http://ftp.de.debian.org/debian/"
+LIVE_MIRROR="http://127.0.0.1:9999/debian/"
 
 # Debian security mirror	(Default: http://security.debian.org/)
 #LIVE_MIRROR_SECURITY="http://security.debian.org/"
+LIVE_MIRROR_SECURITY="http://127.0.0.1:9999/security"
 
 # Packages			(Default: empty)
-LIVE_PACKAGES="fai-doc fai-client fai-server apt-move less vim"
+LIVE_PACKAGES="fai-doc fai-client fai-server apt-move less vim grub grub-doc coreutils hdparm"
 
 # Package list			(Default: standard)
-#LIVE_PACKAGE_LIST="standard"
+LIVE_PACKAGE_LIST="standard"
 
 # Chroots ftp_proxy		(Default: empty)
 #LIVE_PROXY_FTP="http://mainframe:3128/"




More information about the Fai-commit mailing list