-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Distribution independent #2
Comments
Sure, it's possible, but would require some work. The issue I see is getting copies of One thing possibly worth considering is a |
After some effort I have made a bash script that will prepare the files for the TFTP server and the webserver. #!/bin/bash
set -euo pipefail
url='https://releases.ubuntu.com/20.04/ubuntu-20.04.1-live-server-amd64.iso'
grub_url='http://archive.ubuntu.com/ubuntu/dists/focal/main/uefi/grub2-amd64/current/grubnetx64.efi.signed'
server='${pxe_default_server}'
tftp_root='/tftp'
iso=$(basename $url)
echo "Preparing for $iso"
# download the iso
if [ ! -f $iso ]; then
echo "Download ISO..."
curl -sfLo $iso $url
fi
# copy cloud-init files
mkdir -p www
echo "Copy iso and cloud-init files..."
cp -f $iso www/$iso
cp -f user-data.yaml www/user-data
# copy kernel and initramfs from iso
mkdir -p tftp
if [ ! -f tftp/initrd ] || [ ! -f tftp/vmlinuz ]; then
echo "Copy kernel and initramfs..."
mkdir mnt
sudo mount -o ro www/$iso mnt/
[ -f tftp/vmlinuz ] || cp -p mnt/casper/vmlinuz tftp/
[ -f tftp/initrd ] || cp -p mnt/casper/initrd tftp/
sudo umount mnt/
rmdir mnt
fi
# download grub image
if [ ! -f tftp/pxelinux.0 ]; then
echo "Download GRUB image..."
curl -sfLo tftp/pxelinux.0 $grub_url
fi
# copy grub configuration
echo "Copy GRUB configuration..."
mkdir -p tftp/grub
sed -e "s|{{server}}|$server|g" \
-e "s|{{root}}|$tftp_root|g" \
-e "s|{{iso}}|$iso|g" \
grub.cfg > tftp/grub/grub.cfg
echo "Done!" Not as refined as your script but this is enough for my need. Feel free to close the issue. |
I think we should keep this open because it would be nice to not have to install Ubuntu before you can install Ubuntu :) One other blocker here is that we'd need to remove the dependency on |
This is an neat script however the fact that it only runs with Ubuntu is huge constraint IMO. Would it be possible to make it independent of the underlying distribution?
The text was updated successfully, but these errors were encountered: