Package: fai-server severity: wishlist Version: 3.2.1 This patch makes fai-chboot use the TFTPROOT declared in make-fai-nfsroot.conf to figure out the pxedir to use for the pxelinux config files.
-- Anton Lundin +46702-161604
Index: bin/fai-chboot
===================================================================
--- bin/fai-chboot (revision 4599)
+++ bin/fai-chboot (working copy)
@@ -364,7 +364,6 @@
$opt_n and $opt_v = 1;
$opt_v and $verbose = 1;
-$pxedir = $opt_D || '/srv/tftp/fai/pxelinux.cfg';
$cfdir = $opt_C || $ENV{'FAI_ETC_DIR'} || '/etc/fai';
$opt_L and $opt_l = 1;
$opt_l and lsdir(@ARGV);
@@ -372,6 +371,17 @@
($opt_S and $opt_I) && die "ERROR: use only one option out of -I and -S\n";
#TODO: also -e, -r and -c can't be used together
+# read the nfsroot variable; a little bit ugly, but it works
+$nfsroot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$NFSROOT`;
+chomp $nfsroot;
+$nfsroot = '/srv/fai/nfsroot' unless $nfsroot;
+
+$tftproot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$TFTPROOT`;
+chomp $tftproot;
+$tftproot = '/srv/tftp/fai' unless $tftproot;
+
+$pxedir = $opt_D || "$tftproot/pxelinux.cfg";
+
(-d $pxedir) || die "PXE directory $pxedir does not exist.";
if ($opt_d) {
@@ -411,15 +421,6 @@
$action="FAI_ACTION=install";
}
-# read the nfsroot variable; a little bit ugly, but it works
-$nfsroot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$NFSROOT`;
-chomp $nfsroot;
-$nfsroot = '/srv/fai/nfsroot' unless $nfsroot;
-
-$tftproot = `. $cfdir/make-fai-nfsroot.conf 2>/dev/null; echo \$TFTPROOT`;
-chomp $tftproot;
-$tftproot = '/srv/tftp/fai' unless $tftproot;
-
$kernelsuffix = (glob "$tftproot/vmlinuz*$opt_s")[-1];
$kernelsuffix=~ s/.+vmlinuz-//;
pgpEtObu9zE1y.pgp
Description: PGP signature

