Package: fai-server Version: 3~beta21 Severity: normal Tags: patch
Hello, NB: Since I'm writing this bug report on a different machine than the one FAI is running on, the version numbers are wrong. Instead, the used version(s) are 3~beta21 on a 2.6.8 (sarge) kernel. The attached patches against fai-setup and make-fai-nfsroot solve the following problems: * More options to fai-setup are recognized, esp. -C <configdir>. * These options are all passed to make-fai-nfsroot. * A few syntax errors are corrected. * In make-fai-nfsroot, make the command line option -C take precedence over the environment variable and the default value. Best, --Toni++ -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (500, 'unstable') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.4.27-2-686-smp Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages fai-server depends on: ii debootstrap 0.3.3 Bootstrap a basic Debian system ii fai-client 2.10.5 Fully Automatic Installation clien Versions of packages fai-server recommends: ii atftpd [tftpd] 0.7-11 advanced TFTP server ii dhcp3-server 3.0.4-6 DHCP server for automatic IP addre ii fai-kernels 1.11.1 special kernels for FAI (Fully Aut ii nfs-kernel-server [nfs-server 1:1.0.7-6 Kernel NFS server support ii rsh-server 0.17-13 rsh servers. ii syslinux 3.11-3 Bootloader for Linux/i386 using MS ii wget 1.10.2-2 retrieves files from the web -- no debconf information
--- fai-setup 2006-09-17 22:45:04.775973580 +0200 +++ fai-setup.new 2006-09-18 23:05:53.931548783 +0200 @@ -30,15 +30,27 @@ PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin set -e -. /etc/fai/fai.conf -. /etc/fai/make-fai-nfsroot.conf + +set -xv + +cfdir=/etc/fai options=$@ # all options are also passed to make-fai-nfsroot -# look for option -e (expert mode) -case "$options" in - *-e*) expert=1 ;; -esac +### stolen from make-fai-nfsroot: + +while getopts ervC:f:kKV: opt ; do + case "$opt" in + C) cfdir=$OPTARG ;; + v) verbose=1 ; v=-v ;; + e) expert=1 ;; + esac +done + + +. ${cfdir}/fai.conf +. ${cfdir}/make-fai-nfsroot.conf + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - add_export_line() { @@ -82,7 +94,7 @@ exit 8 fi - if [ $FAI_LOGPROTO= "ssh" ]; then + if [ $FAI_LOGPROTO = "ssh" ]; then # set up ssh on the server mkdir -p -m 700 $loguserhome/.ssh @@ -119,7 +131,7 @@ chmod 0700 $sshdir/authorized_keys echo "$sshdir/authorized_keys created." fi - if [ $FAI_LOGPROTO= "rsh" -a ! -f $loguserhome/.rhosts ]; then + if [ $FAI_LOGPROTO = "rsh" -a ! -f $loguserhome/.rhosts ]; then # use .rhosts authentication echo "[EMAIL PROTECTED] root" > $loguserhome/.rhosts chmod go-rwx $loguserhome/.rhosts
--- make-fai-nfsroot.orig 2006-09-13 18:56:03.000000000 +0200 +++ make-fai-nfsroot 2006-09-18 23:09:52.017356001 +0200 @@ -42,6 +42,14 @@ exit 9 fi +### use env or default with lower prio than command line switch: +cfdir=${FAI_ETC_DIR:=/etc/fai} +cfdir=$(readlink -f $cfdir) # canonicalize path +if [ ! -d "$cfdir" ]; then + echo "$cfdir is not a directory" + exit 6 +fi + kfile="vmlinuz" # some architectures use different names kernelname="$kfile-install" merror="properly" @@ -66,12 +74,6 @@ if [ -n "$FAI_ETC_DIR" -a -z "$cfdir" ]; then echo "Using environment variable \$FAI_ETC_DIR." fi -cfdir=${FAI_ETC_DIR:=/etc/fai} -cfdir=$(readlink -f $cfdir) # canonicalize path -if [ ! -d "$cfdir" ]; then - echo "$cfdir is not a directory" - exit 6 -fi [ "$verbose" ] && echo "Using configuration files from $cfdir" . $cfdir/fai.conf