Skip to content

Commit

Permalink
Merge pull request #2738 from Flunkyball/patch-1
Browse files Browse the repository at this point in the history
Support for HTTP sources when using PXE:
There is a new config variable PXE_HTTP_URL to specify the HTTP download source for PXE.
If the variable is set the PXE config file will generate an additional 3rd boot option
(besides the unchanged standard options "rear" via TFTP and "local") namely "rear-http"
which includes the HTTP URL information to download the kernel and initrd data.
  • Loading branch information
jsmeix committed Jan 12, 2022
2 parents 48ebb13 + 3f7908d commit 0e207c3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions usr/share/rear/conf/default.conf
Expand Up @@ -1138,6 +1138,11 @@ PXE_TFTP_URL=
# prefix for PXE files, e.g. the hostname
PXE_TFTP_PREFIX=$HOSTNAME.
#
# Optional HTTP download source for PXE (URL style)
# for example PXE_HTTP_URL="http://pxe-over-http-srv:7777"
# If set an additional pxe boot option in the pxeconfig for this client is provided ('rear-http') which uses this url as base path for the kernel and initrd files.
PXE_HTTP_URL=
#
# Create pxelinux config symlinks for MAC addresses or for IP addresses ? [MAC|IP|'']
PXE_CREATE_LINKS=MAC
#
Expand Down
28 changes: 28 additions & 0 deletions usr/share/rear/lib/bootloader-functions.sh
Expand Up @@ -782,6 +782,34 @@ function make_pxelinux_config {
echo " append initrd=$PXE_INITRD root=/dev/ram0 vga=normal rw $KERNEL_CMDLINE $PXE_RECOVER_MODE"
echo "say ----------------------------------------------------------"

# start with optional rear http entry if specified
if [[ ! -z $PXE_HTTP_URL ]] ; then
case "$PXE_RECOVER_MODE" in
"automatic")
echo "say rear-automatic-http - Recover $HOSTNAME (HTTP) with auto-recover kernel option"
echo "label rear-automatic-http"
echo "MENU label ^Automatic Recover $HOSTNAME (HTTP)"
;;
"unattended")
echo "say rear-unattended-http - Recover $HOSTNAME (HTTP) with unattended kernel option"
echo "label rear-unattended-http"
echo "MENU label ^Unattended Recover $HOSTNAME (HTTP)"
;;
*)
echo "say rear-http - Recover $HOSTNAME (HTTP)"
echo "label rear-http"
echo "MENU label ^Recover $HOSTNAME (HTTP)"
;;
esac
echo "TEXT HELP"
echo "Rescue image kernel $KERNEL_VERSION ${IPADDR:+on $IPADDR} $(date -R)"
echo "${BACKUP:+BACKUP=$BACKUP} ${OUTPUT:+OUTPUT=$OUTPUT} ${BACKUP_URL:+BACKUP_URL=$BACKUP_URL}"
echo "ENDTEXT"
echo " kernel $PXE_HTTP_URL/$PXE_KERNEL"
echo " append initrd=$PXE_HTTP_URL/$PXE_INITRD root=/dev/ram0 vga=normal rw $KERNEL_CMDLINE $PXE_RECOVER_MODE"
echo "say ----------------------------------------------------------"
fi

# start the the other entries like local,...
echo "say local - Boot from next boot device"
echo "label local"
Expand Down

0 comments on commit 0e207c3

Please sign in to comment.