[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. debian/0.11-4-g6f01a5a
Andreas B. Mundt
andi at debian.org
Fri May 24 07:54:45 UTC 2013
The following commit has been merged in the master branch:
commit 6f01a5a87e966118762e30102cb2172f24a2cfe7
Author: Andreas B. Mundt <andi at debian.org>
Date: Fri May 24 09:22:09 2013 +0200
Add roaming machine installation to the PXE-boot menu.
An unknown machine can be installed via PXE as roaming workstation.
The installation prompts for root password and hostname.
Swap mount point and bind mount point of the home directories on
roaming machines.
diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes
index 09e8ecc..8da8289 100755
--- a/fai/config/class/50-host-classes
+++ b/fai/config/class/50-host-classes
@@ -86,7 +86,8 @@ case $HOSTNAME in
## skip GRUB_PC below:
exit 0 ;;
*)
- echo "FAIBASE DEBIAN DHCPC" ;;
+ ## Unknown machines are installed as roaming workstation by default:
+ echo "FAIBASE DEBIAN DHCPC $WORKSTATION_A XORG DESKTOP ROAMING" ;;
esac
ifclass -o I386 AMD64 && echo GRUB_PC
diff --git a/fai/config/class/ROAMING.var b/fai/config/class/ROAMING.var
new file mode 100644
index 0000000..8ff9a66
--- /dev/null
+++ b/fai/config/class/ROAMING.var
@@ -0,0 +1,6 @@
+# Default values for ROAMING class.
+# Use: 'mkpasswd -Hsha-256 <PASSWORD>' to create the password hash
+# pw is "fai":
+#ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'
+# If password is empty, you are prompted during installation.
+ROOTPW=''
diff --git a/fai/config/disk_config/ROAMING b/fai/config/disk_config/ROAMING
index 9e10e97..8936627 100644
--- a/fai/config/disk_config/ROAMING
+++ b/fai/config/disk_config/ROAMING
@@ -8,4 +8,4 @@ vg vg_system disk1.5
vg_system-root / 500M-10G ext4 errors=remount-ro
vg_system-usr /usr 3G-20G ext4 defaults
vg_system-var /var 1G-30% ext4 defaults
-vg_system-lan /lan 1G-50% ext4 defaults
+vg_system-home /home 1G-50% ext4 defaults
diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER
index 5975c63..05c4926 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/etc/rc.local/FAISERVER
@@ -64,9 +64,9 @@ setup_diskless () {
echo "Creating template with $KERNEL and $INITRD."
cat > $TEMPLATE <<EOF
# template for diskless
-default fai-generated
+default Debian-LAN/FAI Live System
-label fai-generated
+label Debian-LAN/FAI Live System
kernel $KERNEL
append initrd=$INITRD ip=dhcp root=/dev/nfs nfsroot=/opt boot=live
EOF
@@ -98,9 +98,14 @@ setup_PXEinstaller () {
cp -ru $INSTALLER $TFTPROOT
if [ -d $TFTPROOT/debian-installer/i386 ] ; then
+ KERNEL=`basename $(ls $TFTPROOT/vmlinuz*)`
+ INITRD=`basename $(ls $TFTPROOT/initrd.img*)`
## add installer menu
cat >> $TFTPROOT/pxelinux.cfg/default <<EOF
-menu label Debian-LAN/FAI live system
+
+label Debian-LAN/FAI Roaming Machine
+kernel $KERNEL
+append initrd=$INITRD ip=dhcp root=/dev/nfs nfsroot=/srv/fai/nfsroot boot=live FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config FAI_ACTION=install
menu title Boot menu
menu background debian-installer/i386/boot-screens/splash.png
diff --git a/fai/config/hooks/install.DEFAULT.source b/fai/config/hooks/install.DEFAULT.source
index fb40741..0a46e17 100755
--- a/fai/config/hooks/install.DEFAULT.source
+++ b/fai/config/hooks/install.DEFAULT.source
@@ -21,3 +21,29 @@ else
unset inp1 inp2
done
fi
+
+#
+# Prompt for the hostname if $HOSTNAME is empty.
+#
+
+ValidHostnameRegex="^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$"
+
+if [ -n "$HOSTNAME" ] ; then
+ echo "Hostname is '$HOSTNAME'."
+else
+ while [ -z "$HOSTNAME" ] ; do
+ if ! { inp=$(dialog --insecure --stdout --backtitle " Hostname " --inputbox \
+ "There is no hostname available. \nPlease enter a hostname:" 10 36); } ; then
+ dialog --stdout --msgbox "Entering hostname canceled, please try again." 5 50
+ elif [[ $inp =~ $ValidHostnameRegex ]] ; then
+ HOSTNAME="$inp"
+ ## Make 'hostname' and 'hostname -d' succeed, important for sssd installation:
+ hostname "$HOSTNAME"
+ sed -i "1 a127.0.1.1 ${HOSTNAME}.intern ${HOSTNAME}" /etc/hosts
+ echo "Hostname set to '$HOSTNAME'."
+ else
+ dialog --stdout --msgbox "Hostname '$inp' invalid, please try again." 6 55
+ fi
+ unset inp
+ done
+fi
diff --git a/fai/config/scripts/ROAMING/20-sssd_fstab b/fai/config/scripts/ROAMING/20-sssd_fstab
index 26ba69d..c240d88 100755
--- a/fai/config/scripts/ROAMING/20-sssd_fstab
+++ b/fai/config/scripts/ROAMING/20-sssd_fstab
@@ -14,4 +14,4 @@ fi
## Bind mount the home directories to /home for offline use,
## when the local files are hidden by the NFS mount:
-ainsl /etc/fstab "$HOMEDIRS /home none bind 0 0"
+ainsl /etc/fstab "/home $HOMEDIRS none bind 0 0"
--
Debian-LAN development and packaging
More information about the debian-lan-devel
mailing list