Package: fai-server Version: 2.9.1 Severity: wishlist File: /usr/sbin/make-fai-bootfloppy Tags: patch
I wanted to add a syslinux opt for make-fai-bootfloppy but realized that many of the more meaningful letters for opts are already taken. I suggest using getopt instead of getopts because getopts can parse long options too. As an aside, I believe that with syslinux it would be easier to squize some more room out of a standard floppy. In adddition, I was able to boot with a syslinux based floppy where a grub based floppy failed. I am not sure if the reason is that grub can not handle the way make-fai-bootfloopy formats the floppy. --- /usr/sbin/make-fai-bootfloppy.orig 2006-01-15 19:24:39.000000000 +0200 +++ /usr/sbin/make-fai-bootfloppy 2006-03-03 23:16:28.000000000 +0200 @@ -279,25 +279,37 @@ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # main part -while getopts "lBgvf:s:m:hd:c:Fi:I:" opt ; do - case "$opt" in - c) cfdir=$OPTARG ;; - B) size=2880 ;; - l) lilo=1 ;; - g) grub=1 ;; - h) usage ;; - i) mkcd=1; cddev="$OPTARG" ; sd='';; - I) CLIENTINTERFACE="$OPTARG" ;; - f) mkimage=1; floppydev="$OPTARG" ;; - m) mountpoint="$OPTARG" ;; - s) TARGETHOST="$OPTARG" ;; - d) BTYPE="$OPTARG" ;; - v) verbose=1 ;; - F) flags="FAI_FLAGS=verbose,sshd,createvt,syslogd" ;; - ?) echo "Error parsing arguments"; exit 1;; +# According to /usr/share/doc/util-linux/examples/getopt-parse.bash.gz: +TEMP=`getopt -o lBgvf:s:m:hd:c:Fi:I: \ + --long cfdir:,size,lilo,grub,help,cddev:,client-interface: \ + --long floppy-dev:,mount-point:,target-host:,boot-type: \ + --long verbose,flags \ + -n make-fai-bootfloppy -- "$@"` +if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi +# Note the quotes around `$TEMP': they are essential! +eval set -- "$TEMP" +while true ; do + case "$1" in + -c|--cfdir) cfdir=$2 ; shift 2 ;; + -B|--size) size=2880 ; shift ;; + -l|--lilo) lilo=1 ; shift ;; + -g|--grub) grub=1 ; shift ;; + -h|--help) usage ; shift ;; + -i|--cddev) mkcd=1 ; cddev=$2 ; sd='' ; shift 2 ;; + -I|--client-interface) CLIENTINTERFACE=$2 ; shift 2 ;; + -f|--floppy-dev) mkimage=1 ; floppydev=$2 ; shift 2 ;; + -m|--mount-point) mountpoint=$2 ; shift 2 ;; + -s|--target-host) TARGETHOST=$2 ; shift 2 ;; + -d|--boot-type) BTYPE=$2 ; shift 2 ;; + -v|--verbose) verbose=1 ; shift ;; + -F|--flags) flags="FAI_FLAGS=verbose,sshd,createvt,syslogd" ; + shift ;; + --) shift ; break ;; + *) echo "Internal error!" ; exit 1 ;; esac done -shift `expr $OPTIND - 1` +# additional kernel parameter +params="$flags $@" case "$BTYPE" in a) lilodef=FAI-ANY ; grubdef=0 ;; b) lilodef=FAI-BOOTP ; grubdef=1 ;; @@ -313,8 +325,6 @@ [ `id -u` -eq 0 ] || die "You must be root! Or try $0 -h" trap "umount_dirs" EXIT -# additional kernel parameter -params="$flags $@" [ -z "$cfdir" ] && cfdir=/etc/fai if [ ! -d "$cfdir" ]; then -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (600, 'testing'), (50, 'unstable') Architecture: i386 (i586) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.11-1.pentium1.1 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.9 Fully Automatic Installation clien Versions of packages fai-server recommends: ii dhcp3-server 3.0.3-5 DHCP server for automatic IP addre hi fai-kernels 1.10.1 special kernels for FAI (Fully Aut ii nfs-kernel-server [nfs-server 1:1.0.7-3 Kernel NFS server support pn rsh-server <none> (no description available) ii syslinux 3.11-3 Bootloader for Linux/i386 using MS ii tftpd-hpa [tftpd] 0.40-4.1 HPA's tftp server ii wget 1.10.2-1 retrieves files from the web -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]