[Fai-commit] r4314 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Tue Jun 12 14:53:01 UTC 2007


Author: lange
Date: 2007-06-12 14:53:01 +0000 (Tue, 12 Jun 2007)
New Revision: 4314

Modified:
   trunk/bin/make-fai-nfsroot
Log:
move from fai-kernels to plain Debian kernel


Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2007-06-12 14:44:49 UTC (rev 4313)
+++ trunk/bin/make-fai-nfsroot	2007-06-12 14:53:01 UTC (rev 4314)
@@ -51,6 +51,7 @@
 PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
 
 kfile="vmlinuz" # some architectures use different names
+ifile="initrd.img"
 kernelname="$kfile-install"
 merror="properly"
 sshpreserve=0
@@ -146,12 +147,7 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 install_kernel_nfsroot() {
 
-    rm -rf $NFSROOT/boot/*-$KERNELVERSION $NFSROOT/lib/modules/$KERNELVERSION
-    # since woody we can install the kernel using dpkg -i
-    echo "do_boot_enable=no" > $NFSROOT/etc/kernel-img.conf
-    dpkg -x $KERNELPACKAGE $NFSROOT
-    echo "Kernel $KERNELVERSION installed into the nfsroot."
-    chroot $NFSROOT depmod -qaF /boot/System.map-$KERNELVERSION $KERNELVERSION || true
+    $ROOTCMD update-initramfs -k all -t -u
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 setup_ssh() {
@@ -249,8 +245,8 @@
     # liloconfig, dump and raidtool2 needs these files
     echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > etc/fstab
     > etc/raidtab
-    mkdir -p lib/modules/$KERNELVERSION           # dirty trick to hoax lvm
-    >  lib/modules/$KERNELVERSION/modules.dep  # dirty trick to hoax lvm
+#    mkdir -p lib/modules/$KERNELVERSION           # dirty trick to hoax lvm
+#    >  lib/modules/$KERNELVERSION/modules.dep  # dirty trick to hoax lvm
     echo 'NTPSERVERS=""' > etc/default/ntp-servers
 
     [ -d $NFSROOT/var/state ] || mkdir $NFSROOT/var/state
@@ -341,6 +337,11 @@
     local iarch=$(dpkg --print-installation-architecture|tr /a-z/ /A-Z/)
     export FAI_ROOT=$NFSROOT
     export classes="NFSROOT $iarch"
+cat > $NFSROOT/etc/kernel-img.conf << EOF
+do_bootloader = No
+do_initrd = No
+warn_initrd = No
+EOF
     install_packages -l -p$cfdir > $NFSROOT/var/tmp/packages.nfsroot
     echo "Adding additional packages to $NFSROOT:"
     cat $NFSROOT/var/tmp/packages.nfsroot
@@ -372,8 +373,10 @@
 setup_bootp(){
 
     if [ -x "`which mkelf-linux`" ]; then
-	mkelf-linux --ip=any --output=/srv/tftp/fai/installimage \
-	  $NFSROOT/boot/$kfile-$KERNELVERSION 
+	# does not work any mork if we do not know the excatly kernel name
+:
+#	mkelf-linux --ip=any --output=/srv/tftp/fai/installimage \
+#	  $NFSROOT/boot/$kfile-$KERNELVERSION 
     else
         echo "Command mkelf-linux not found. Can not set up BOOTP booting. Please install the package mknbi and rerun fai-setup."
 	return
@@ -392,8 +395,10 @@
 
     # pxe and dhcp environment
     local pxebin=/usr/lib/syslinux/pxelinux.0
-    cp -p $NFSROOT/boot/$kfile-$KERNELVERSION /srv/tftp/fai/$kernelname
-    echo "Kernel $KERNELVERSION copied to /srv/tftp/fai/$kernelname"
+    rm -f $NFSROOT/boot/*.bak
+    cp -pv $NFSROOT/boot/$kfile-* /srv/tftp/fai/
+    cp -pv $NFSROOT/boot/$ifile-* /srv/tftp/fai/
+#    echo "Kernel $KERNELVERSION copied to /srv/tftp/fai/$kernelname"
     [ -f $pxebin ] && cp $pxebin /srv/tftp/fai
     [ -d /srv/tftp/fai/pxelinux.cfg ] || mkdir -p /srv/tftp/fai/pxelinux.cfg
     echo "DHCP environment prepared. If you want to use it, you have to enable the dhcpd and the tftp-hpa daemon."
@@ -412,7 +417,7 @@
 # Install the kernel package
 if [ -f $KERNELPACKAGE ]; then
     # determine kernel version
-    get_kernel_version $KERNELPACKAGE
+#    get_kernel_version $KERNELPACKAGE
 
     # create tftp boot images
     call_with_stamp install_kernel_nfsroot
@@ -459,7 +464,7 @@
 }
 
 echo "Creating FAI nfsroot in $NFSROOT."
-echo "By default it needs more than 250 MBytes disk space."
+echo "By default it needs more than 330 MBytes disk space."
 echo "This may take a long time."
 
 if [ $sshpreserve = 1 ]; then




More information about the Fai-commit mailing list