- echo "setup basic networking files"
- cp -f $CONF_FILES_DIR/hosts $CD_ROOT/etc/
-
- echo "copying sysctl.conf (fix tcp window scaling and broken routers)"
- cp -f $CONF_FILES_DIR/sysctl.conf $CD_ROOT/etc/
-
- echo "setup default network conf file"
- mkdir -p $CD_ROOT/usr/boot
- cp -f $CONF_FILES_DIR/default-net.cnf $CD_ROOT/usr/boot/
-
- echo "setup boot server configuration"
- cp -f $CURRENT_CONFIG_DIR/$PRIMARY_SERVER_CERT $CD_ROOT/usr/boot/cacert.pem
- cp -f $CURRENT_CONFIG_DIR/$PRIMARY_SERVER_GPG $CD_ROOT/usr/boot/pubring.gpg
- echo "$PRIMARY_SERVER" > $CD_ROOT/usr/boot/boot_server
- echo "$PRIMARY_SERVER_PORT" > $CD_ROOT/usr/boot/boot_server_port
- echo "$PRIMARY_SERVER_PATH" > $CD_ROOT/usr/boot/boot_server_path
-
- echo "setup backup boot server configuration"
- mkdir -p $CD_ROOT/usr/boot/backup
- cp -f $CURRENT_CONFIG_DIR/$BACKUP_SERVER_CERT \
- $CD_ROOT/usr/boot/backup/cacert.pem
- cp -f $CURRENT_CONFIG_DIR/$BACKUP_SERVER_GPG \
- $CD_ROOT/usr/boot/backup/pubring.gpg
- echo "$BACKUP_SERVER" > $CD_ROOT/usr/boot/backup/boot_server
- echo "$BACKUP_SERVER_PORT" > $CD_ROOT/usr/boot/backup/boot_server_port
- echo "$BACKUP_SERVER_PATH" > $CD_ROOT/usr/boot/backup/boot_server_path
-
- echo "copying old boot cd directory bootme (TEMPORARY)"
- cp -r bootme_old $CD_ROOT/usr/bootme
- echo "$FULL_VERSION_STRING" > $CD_ROOT/usr/bootme/ID
- echo "$PRIMARY_SERVER" > $CD_ROOT/usr/bootme/BOOTSERVER
- echo "$PRIMARY_SERVER" > $CD_ROOT/usr/bootme/BOOTSERVER_IP
- echo "$PRIMARY_SERVER_PORT" > $CD_ROOT/usr/bootme/BOOTPORT
-
- echo "forcing lvm to make lvm1 partitions (TEMPORARY)"
- cp -f $CONF_FILES_DIR/lvm.conf $CD_ROOT/etc/lvm/
-
- echo "copying isolinux configuration files"
- cp -f $CONF_FILES_DIR/isolinux.cfg $CD_ROOT/usr/isolinux/
- echo "$FULL_VERSION_STRING" > $CD_ROOT/usr/isolinux/message.txt
-
- echo "writing /etc/issue"
- echo "$FULL_VERSION_STRING" > $CD_ROOT/etc/issue
- echo "Kernel \r on an \m" >> $CD_ROOT/etc/issue
- echo "" >> $CD_ROOT/etc/issue
- echo "" >> $CD_ROOT/etc/issue
-
- if [[ ! -z "$NODE_CONFIGURATION_FILE" ]]; then
- echo "Copying node configuration file to cd"
- cp -f $CURRENT_CONFIG_DIR/$NODE_CONFIGURATION_FILE \
- $CD_ROOT/usr/boot/plnode.txt
+ # Install boot server configuration files
+ echo "* Installing boot server configuration files"
+
+ # We always intended to bring up and support backup boot servers,
+ # but never got around to it. Just install the same parameters for
+ # both for now.
+ for dir in $OVERLAY/usr/boot $OVERLAY/usr/boot/backup ; do
+ install -D -m 644 $PLC_BOOT_CA_SSL_CRT $dir/cacert.pem
+ install -D -m 644 $PLC_ROOT_GPG_KEY_PUB $dir/pubring.gpg
+ echo "$PLC_BOOT_HOST" >$dir/boot_server
+ echo "$PLC_BOOT_SSL_PORT" >$dir/boot_server_port
+ echo "/boot/" >$dir/boot_server_path
+ done
+
+ # Install old-style boot server configuration files
+ # as opposed to what a former comment suggested,
+ # this is still required, somewhere in the bootmanager apparently
+ install -D -m 644 $PLC_BOOT_CA_SSL_CRT $OVERLAY/usr/bootme/cacert/$PLC_BOOT_HOST/cacert.pem
+ echo "$FULL_VERSION_STRING" >$OVERLAY/usr/bootme/ID
+ echo "$PLC_BOOT_HOST" >$OVERLAY/usr/bootme/BOOTSERVER
+ echo "$PLC_BOOT_HOST" >$OVERLAY/usr/bootme/BOOTSERVER_IP
+ echo "$PLC_BOOT_SSL_PORT" >$OVERLAY/usr/bootme/BOOTPORT
+
+ # Generate /etc/issue
+ echo "* Generating /etc/issue"
+
+ if [ "$PLC_WWW_PORT" = "443" ] ; then
+ PLC_WWW_URL="https://$PLC_WWW_HOST/"
+ elif [ "$PLC_WWW_PORT" != "80" ] ; then
+ PLC_WWW_URL="http://$PLC_WWW_HOST:$PLC_WWW_PORT/"
+ else
+ PLC_WWW_URL="http://$PLC_WWW_HOST/"