I was able to do the install through pxe and although it took me some time to work out all the details I got it working
Initially wanted to use proxmox-start-auto-installer but hit some roadblocks:
- Need to use POST for obtaining config meant running a new server just to answer with the config file, instead of my current infrastructure which is a simple file server which support HTTP/S Get, NFS, TFTP.
- Requirement to insert iso into initmfs
- Worked on bios but was giving me problems with uefi, not sure what the exact problem wasnt able to debug it that much, but was mainly due to its size and possibly the vm i was doing dev work on.
- Required some extra customizations as i needed to double encrypt my drives and that is not possible during the regular install
What i did was:
- Based on https://github.com/morph027/pve-iso-2-pxe extracted initrd and linux26 from the iso
- Tried to add network drivers to linux26 from the ones in squashedfs (installer/base) but for some reason couldnt load them, so ended up needing to add both squahsedfs to the initial initrd. (Wanted to create nfs mountpoint or http download instead of including them on the inital initrd)
- Modify init from initrd to mount the included squashedfs instead of looking for an iso, and modify the initial script that was called from init, to my own to start the install.
- Added one parameter to the cmdline with a kickstart script, (based on my experience with centos/rocky kickstart), which i download and execute to enable customization while keeping a common initrd/linux26 for any install.
- Then looked through the low level install script that is written in perl and wrote the custom kickstart script to do the same without the need to handle all options as it doesn't need to be interactive anymore.
- Create partitions
- Create FS
- Create chroot environment and mounts
- chroot into target install and install proxmox packages
- Install additional packages not included with proxmox that i needed (cryptsetup in my case)
- set config options as the original proxmox script does.
- make my own custom changes to fit my config
- generate initramfs, i dont use grub only systemd-boot to support encryption on root level, due to grub complaining with zfs encryption about not recognizing the filesystem.
- Leave chroot, unmount fs, set correct mountpoints for my zfs fs and export them.
- reboot
Upon boot i get the password prompts, system unlocks and proxmox runs. Honestly the thing that took me the longest was understanding how initrd worked and how to append to it correctly. And going through the perl script and making sure i didnt miss any steps. Grub was a pain but it was that in my cases it doesnt support zfs encryption and i didnt know that by the error it was raising.