From 6de7c608abc22d2a9026a28755b4dbfcbc8c677e Mon Sep 17 00:00:00 2001 From: villos Date: Tue, 12 Dec 2023 20:07:08 +0200 Subject: [PATCH] Update pxe-setup.sh --- pxeserver/pxe-config.sh | 28 ++++++++++++++++++++-------- pxeserver/tftp/efi/grub.cfg | 29 +++++++++++++++++------------ 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/pxeserver/pxe-config.sh b/pxeserver/pxe-config.sh index 1db5bc0..e646271 100755 --- a/pxeserver/pxe-config.sh +++ b/pxeserver/pxe-config.sh @@ -29,8 +29,8 @@ TFTP_ROOT=$mydir"/tftp" BOOT_CONF=$TFTP_ROOT"/bios/menu.cfg" HTTP_ROOT="$mydir/hiveramfs" SYS_CONF=$mydir"/configs" -OCL_VER=opencl-21.40.1.tar.xz -NV_VER=nvidia-470.86.tar.xz +OCL_VER=5.4 +NV_VER=535.129.03 #install package need_install= @@ -54,6 +54,9 @@ dpkg -s pixz > /dev/null 2>&1 #added debootstrap dpkg -s debootstrap > /dev/null 2>&1 [[ $? -ne 0 ]] && need_install="$need_install debootstrap" +#added zstd for nvidia 525+ driver compile +dpkg -s zstd > /dev/null 2>&1 +[[ $? -ne 0 ]] && need_install="$need_install zstd" if [[ ! -z $need_install ]]; then echo "Install needed package. Plese wait" @@ -182,6 +185,8 @@ echo "" >> $SERVER_CONF echo "FS_SIZE="$FS_SIZE >> $SERVER_CONF echo "" >> $SERVER_CONF echo "DEFAULT_DIST="$DEFAULT_DIST >> $SERVER_CONF +echo "OCL_VER="$OCL_VER >> $SERVER_CONF +echo "NV_VER="$NV_VER >> $SERVER_CONF echo "" >> $SERVER_CONF #Change Boot config @@ -252,14 +257,21 @@ fi ##Create Netboot directory for x86_64-efi. grub-mknetdir --net-directory="$mydir"/tftp/ --subdir=/efi/ -d /usr/lib/grub/x86_64-efi/ #making uefi -grub-mkimage -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi -o $mydir/tftp/efi/grubnetx64.efi --prefix="(tftp,$IP)/efi" efinet tftp efi_uga efi_gop http configfile normal search +#grub-mkimage -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi -o $mydir/tftp/efi/grubnetx64.efi --prefix="(tftp,$IP)/efi" efinet tftp efi_uga efi_gop http configfile normal search chmod -R 777 $mydir/ #make sed $mydir/tftp/efi/grub.cfg -sed -i "/set net_default_server=/c set net_default_server=$IP" $mydir/tftp/efi/grub.cfg -sed -i "/set fs_size=/c set fs_size=${FS_SIZE}M" $mydir/tftp/efi/grub.cfg -sed -i "/set dist=/c set dist=$DEFAULT_DIST" $mydir/tftp/efi/grub.cfg -sed -i "/set opencl_version=/c set opencl_version=$OCL_VER" $mydir/tftp/efi/grub.cfg -sed -i "/set nvidia_version=/c set nvidia_version=$NV_VER" $mydir/tftp/efi/grub.cfg +#sed -i "/set net_default_server=/c set net_default_server=$IP" $mydir/tftp/efi/grub.cfg +#sed -i "/set fs_size=/c set fs_size=${FS_SIZE}M" $mydir/tftp/efi/grub.cfg +#sed -i "/set dist=/c set dist=$DEFAULT_DIST" $mydir/tftp/efi/grub.cfg +#sed -i "/set opencl_version=/c set opencl_version=$OCL_VER" $mydir/tftp/efi/grub.cfg +#sed -i "/set nvidia_version=/c set nvidia_version=$NV_VER" $mydir/tftp/efi/grub.cfg + +echo "" > $mydir/tftp/efi/default.cfg +echo "set net_default_server=$IP" >> $mydir/tftp/efi/default.cfg +echo "set fs_size=${FS_SIZE}M" >> $mydir/tftp/efi/default.cfg +echo "set dist=$DEFAULT_DIST" >> $mydir/tftp/efi/default.cfg +echo "set opencl_version=$OCL_VER" >> $mydir/tftp/efi/default.cfg +echo "set nvidia_version=$NV_VER" >> $mydir/tftp/efi/default.cfg #finished making uefi echo [[ $res != 0 ]] && echo -e "${RED}Server install failed${NOCOLOR}" && exit 1 diff --git a/pxeserver/tftp/efi/grub.cfg b/pxeserver/tftp/efi/grub.cfg index 52acfff..3f5ef6d 100755 --- a/pxeserver/tftp/efi/grub.cfg +++ b/pxeserver/tftp/efi/grub.cfg @@ -7,22 +7,26 @@ set default=0 set timeout=3 menuentry 'HiveOS diskless' --class os { +insmod linuxefi insmod efinet insmod http insmod tftp insmod efi_gop insmod efi_uga +insmod progress ### Default settings, can be override in "custom/xx:xx:xx:xx:xx:xx.cfg" ### where xx:xx:xx:xx:xx:xx is mac address of your NIC. -set net_default_server=192.168.10.250 -set fs_size=2450M -set dist=ubuntu18 -set arch_name=${dist}.tar.xz -set opencl_version=opencl-21.40.1.tar.xz -set nvidia_version=nvidia-470.68.tar.xz +#set net_default_server=192.168.10.250 +#set fs_size=2650M +#set dist=ubuntu20 +#set arch_name=${dist}.tar.xz +#set opencl_version=amd-opencl-5.4.tar.xz +#set nvidia_version=nvidia-535.129.03.tar.xz ### End default settings - +# This is default setting file +source $prefix/default.cfg +# This is custom setting file source $prefix/custom/${net_default_mac}.cfg echo '------------------------------------------------------------------------------' @@ -35,14 +39,15 @@ source $prefix/custom/${net_default_mac}.cfg echo "RootFS size: ${fs_size}" echo '------------------------------------------------------------------------------' #sleep 1 - echo "Loading HiveOS from http://${net_default_server}/hiveramfs/boot/${dist} ..." - linux (http,${net_default_server})/hiveramfs/boot/${dist} ip=dhcp ethaddr=${net_default_mac} panic=20 boot=http \ + echo "Loading..." + #echo "Loading HiveOS from http://${net_default_server}/hiveramfs/boot/${dist} ..." + linuxefi (http,${net_default_server})/hiveramfs/boot/${dist} ip=dhcp ethaddr=${net_default_mac} panic=20 boot=http \ httproot=http://${net_default_server}/hiveramfs/ ram_fs_size=${fs_size} hive_fs_arch=${dist}.tar.xz \ - opencl_version=${opencl_version} nvidia_version=${nvidia_version} text consoleblank=0 intel_pstate=disable \ + opencl_version=amd-opencl-${opencl_version}.tar.xz nvidia_version=nvidia-${nvidia_version}.tar.xz text consoleblank=0 intel_pstate=disable \ net.ifnames=0 ipv6.disable=1 pci=noaer iommu=soft amdgpu.vm_fragment_size=9 radeon.si_support=0 radeon.cik_support=0 \ amdgpu.si_support=1 amdgpu.cik_support=1 amdgpu.ppfeaturemask=0xffff7fff amdgpu.gpu_recovery=0 amdgpu.runpm=0 - echo "Loading HiveOS initial ramdisk from http://${net_default_server}/hiveramfs/boot/${dist}.img ..." - initrd (http,${net_default_server})/hiveramfs/boot/${dist}.img + #echo "Loading HiveOS initial ramdisk from http://${net_default_server}/hiveramfs/boot/${dist}.img ..." + initrdefi (http,${net_default_server})/hiveramfs/boot/${dist}.img } menuentry "Memtest86+ " {