diff --git a/client/Debian/etc/ltsp/update-kernels.conf b/client/Debian/etc/ltsp/update-kernels.conf index 7be6e4d8..0c65f2c3 100644 --- a/client/Debian/etc/ltsp/update-kernels.conf +++ b/client/Debian/etc/ltsp/update-kernels.conf @@ -55,3 +55,9 @@ LIST_KERNELS_32="586 486 686" # 3: both 1 & 2 # 4: Add SYSUUID= #IPAPPEND=3 + +# If enabled, will append this prefix for kernel and initrd images. +# Hostnames "server" and "boot-server" will resolved to default PXE-server +# address during the boot. +# This option requires lpxelinux.0 or syslinux.efi bootloader. +#SERVER_PREFIX=http://boot-server/ltsp/amd64/ diff --git a/client/Ubuntu/etc/ltsp/update-kernels.conf b/client/Ubuntu/etc/ltsp/update-kernels.conf index ab0b6c49..90061c08 100644 --- a/client/Ubuntu/etc/ltsp/update-kernels.conf +++ b/client/Ubuntu/etc/ltsp/update-kernels.conf @@ -55,3 +55,9 @@ LIST_KERNELS_32="lowlatency virtual generic" # 3: both 1 & 2 # 4: Add SYSUUID= #IPAPPEND=3 + +# If enabled, will append this prefix for kernel and initrd images. +# Hostnames "server" and "boot-server" will resolved to default PXE-server +# address during the boot. +# This option requires lpxelinux.0 or syslinux.efi bootloader. +#SERVER_PREFIX=http://boot-server/ltsp/amd64/ diff --git a/client/share/ltsp/update-kernels b/client/share/ltsp/update-kernels index a1f1ad61..e935a168 100755 --- a/client/share/ltsp/update-kernels +++ b/client/share/ltsp/update-kernels @@ -144,6 +144,7 @@ fi syslinux_dir=/usr/lib/syslinux pxelinux_dir=/usr/lib/PXELINUX + test -d "$pxelinux_dir" || pxelinux_dir="$syslinux_dir" syslinux_modules_dir=/usr/lib/syslinux/modules/bios test -d "$syslinux_modules_dir" || syslinux_modules_dir="$syslinux_dir" @@ -152,6 +153,11 @@ if [ -f $pxelinux_dir/pxelinux.0 ]; then PXECFG=$BOOT/pxelinux.cfg cp $pxelinux_dir/pxelinux.0 $BOOT + # copy over variant with http and ftp support + if [ -f "$pxelinux_dir/lpxelinux.0" ]; then + cp $pxelinux_dir/lpxelinux.0 $BOOT + fi + # copy over variant with extended support for gPXE if [ -f "$pxelinux_dir/gpxelinux.0" ]; then cp $pxelinux_dir/gpxelinux.0 $BOOT @@ -217,8 +223,8 @@ EOF label ltsp-$method menu label LTSP, using $method -kernel vmlinuz${version:+-"$version"} -append ro initrd=initrd.img${version:+-"$version"} $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) +kernel ${SERVER_PREFIX}vmlinuz${version:+-"$version"} +append ro initrd=${SERVER_PREFIX}initrd.img${version:+-"$version"} $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) ipappend ${IPAPPEND:-2} EOF @@ -261,8 +267,8 @@ EOF label ltsp-$method-$type menu hide menu label LTSP, using $method, with Linux $version -kernel vmlinuz-$version -append ro initrd=initrd.img-$version $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) +kernel ${SERVER_PREFIX}vmlinuz-$version +append ro initrd=${SERVER_PREFIX}initrd.img-$version $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) ipappend ${IPAPPEND:-2} EOF @@ -291,8 +297,8 @@ EOF label ltsp-$method-$version menu label LTSP, using $method, with Linux $version -kernel vmlinuz-$version -append ro initrd=initrd.img-$version $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) +kernel ${SERVER_PREFIX}vmlinuz-$version +append ro initrd=${SERVER_PREFIX}initrd.img-$version $CMDLINE_LINUX_DEFAULT $(eval echo '$CMDLINE_'$method) ipappend ${IPAPPEND:-2} EOF @@ -310,7 +316,7 @@ EOF # Do not edit, see /etc/ltsp/update-kernels.conf instead. label memtest86+.bin menu label Memory test -linux memtest86+.bin +linux ${SERVER_PREFIX}memtest86+.bin EOF fi @@ -324,6 +330,13 @@ else msg "Skipping PXE configuration. Install the syslinux package if you need it." fi +syslinux_efi_arch="$(file `readlink -f /bin/sh` | grep -o '[0-9]\+-bit' | cut -d- -f1)" +syslinux_efi_dir="/usr/lib/SYSLINUX.EFI/efi${syslinux_efi_arch}" +if [ -f $syslinux_efi_dir/syslinux.efi ]; then + cp $syslinux_efi_dir/syslinux.efi $BOOT +else + msg "Skipping EFI configuration. Install the syslinux-efi package if you need it." +fi if [ "$(detect_arch)" = "armhf" ] || [ "$(detect_arch)" = "armel" ]; then if which mkimage >/dev/null; then