argonaut-fai-client - modified to use fai live boot
Booting a client without /srv/fai/nfsroot/live/filesystem.dir didn't worked so I modified argonaut-fai-client to take it in account.
Not sure fai live boot is required or how to avoid it but it worked for me (FAI v4.0.6).
#!/bin/sh
#######################################################################
argonaut-fai-backend
pollmeier@gonicus.de
Copyright (c) 2008 by Cajus PollmeierCopyright (C) 2011-2013 FusionDirectory project
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
http://www.gnu.org/licenses/
along with this program. If not, see####################################################################### cfdir=/etc/fai . $cfdir/fai.conf . $cfdir/nfsroot.conf
msg() { echo "nfsroot-hooks/argonaut-fai-client: $1" }
if [ -d "${NFSROOT}"/live/filesystem.dir ]; then msg "Using Live config" LIVE=/live/filesystem.dir fi
echo "${NFSROOT}""${LIVE}"
Make sysconfig a real directory
if [ ! -d "${NFSROOT}""${LIVE}"/etc/sysconfig ]; then msg "creating sysconfig directory" mkdir -p "${NFSROOT}""${LIVE}"/etc/sysconfig fi
Copy some templates
for file in /etc/initramfs-tools/initramfs.conf /etc/initramfs-tools/update-initramfs.conf /etc/usplash.conf; do name=${file##*/} msg "copying $name" [ -f "/etc/fai/nfsroot-templates/$name" ] && cp /etc/fai/nfsroot-templates/$name "${NFSROOT}""${LIVE}"$file done
Copy make-fai-nfsroot.conf to allow debootstrapping later on
cp /etc/fai/make-fai-nfsroot.conf "${NFSROOT}""${LIVE}"/etc/fai
#copy argonaut.conf & ldap.conf msg "Copy argonaut.conf and ldap.conf" cp /etc/argonaut/argonaut.conf "${NFSROOT}""${LIVE}"/etc/argonaut if [ -n "$FAI_LDAP" ]; then msg "installing $FAI_LDAP into ${NFSROOT}"${LIVE}"" cp ${FAI_LDAP} ${NFSROOT}${LIVE}/etc/ldap/ldap.conf else msg "FAI_LDAP not mentionned in /etc/fai/make-fai-nfsroot.conf" msg "installation will not work please indicate the file to be copied into FAI_LDAP" fi
#copy cacert.pem to /etc/ssl/certs if [ -n "$FAI_CERTS" ]; then msg "installing ca certinto nfs root" cp ${FAI_CERTS} ${NFSROOT}${LIVE}/etc/ssl/certs fi
Set locale if needed
if [ -n "$NFSROOT_LOCALE" ]; then echo "set locales/default_environment_locale $NFSROOT_LOCALE" | chroot $NFSROOT$LIVE debconf-communicate echo "set locales/locales_to_be_generated $NFSROOT_LOCALE UTF-8" | chroot $NFSROOT$LIVE debconf-communicate chroot $NFSROOT$LIVE dpkg-reconfigure -fnoninteractive locales fi
Get newest kernel installed inside the nfsroot
version=$(echo $NFSROOT$LIVE/boot/vmlinuz-* | sort -n | head -n1 | cut -d- -f2-)
Copy as default kernel
if [ -f "$TFTPROOT/vmlinuz-$version" ]; then msg "installing vmlinuz-install" if [ -f "$TFTPROOT/vmlinuz-install" ]; then ln -s "$TFTPROOT/vmlinuz-$version" "$TFTPROOT/vmlinuz-install" else rm -f "$TFTPROOT/vmlinuz-install" ln -s "$TFTPROOT/vmlinuz-$version" "$TFTPROOT/vmlinuz-install" fi else msg "ERROR: cannot find kernel to use as vmlinuz-install!!!" fi
Copy initrd if present
if [ -f "$TFTPROOT/initrd.img-$version" ]; then msg "installing initrd.img-install" if [ -f "$TFTPROOT/initrd.img-install" ]; then ln -s "$TFTPROOT/initrd.img-$version" "$TFTPROOT/initrd.img-install" else rm -f "$TFTPROOT/initrd.img-install" ln -s "$TFTPROOT/initrd.img-$version" "$TFTPROOT/initrd.img-install" fi fi
(from redmine: issue id 2582, created on 2013-07-23, closed on 2014-02-03)
- Relations:
- relates #2475 (closed)
- Uploads: