Last active
July 4, 2023 09:11
-
-
Save robinsmidsrod/21a15a562bc45d4ce25dcde507fb3100 to your computer and use it in GitHub Desktop.
iPXE script entries for booting Ubuntu 18.04 in different ways
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boot-url points to an nfs URL | |
# sanboot-url points to an http URL | |
# ubuntu-version contains 18.04.3 | |
# ubuntu-release contains bionic | |
:ubuntu | |
echo Booting Ubuntu from iSCSI for ${initiator-iqn} | |
set root-path ${base-iscsi}:${hostname}.boot.ubuntu | |
sanboot ${root-path} || goto failed | |
goto start | |
:ubuntu-install-iscsi | |
echo Starting Ubuntu ${ubuntu-version} ${archl} installer for ${initiator-iqn} | |
# iBFT table not required for Ubuntu | |
#sanhook ${base-iscsi}:${hostname}.boot.ubuntu || sleep 1 | |
# The partman-iscsi/initiatorname kernel paramter is saved in | |
# /etc/iscsi/initiatorname.iscsi during the installation. | |
# Preseed help: https://help.ubuntu.com/lts/installation-guide/amd64/apbs04.html | |
set ubuntu-installer-base ubuntu-${ubuntu-version}-server-${archl} | |
set base-url ubuntu/${ubuntu-installer-base}/ | |
kernel ${base-url}install/netboot/ubuntu-installer/${archl}/linux | |
initrd ${base-url}install/netboot/ubuntu-installer/${archl}/initrd.gz | |
imgargs linux auto=true fb=false \ | |
netcfg/get_hostname=${hostname} \ | |
partman-iscsi/initiatorname=${initiator-iqn} \ | |
partman-iscsi/login/username=${username} \ | |
partman-iscsi/login/password=${password} \ | |
partman-iscsi/login/address=${iscsi-server} \ | |
partman-iscsi/login/targets=${base-iqn}:${hostname}.boot.ubuntu \ | |
DEBCONF_DEBUG=5 url=${sanboot-url}ubuntu/${ubuntu-installer-base}.preseed | |
boot || goto failed | |
goto start | |
:ubuntu-install-local | |
echo Starting Ubuntu ${ubuntu-version} ${archl} local installer for ${initiator-iqn} | |
set ubuntu-installer-base ubuntu-${ubuntu-version}-server-${archl} | |
set base-url ubuntu/${ubuntu-installer-base}/ | |
kernel ${base-url}install/netboot/ubuntu-installer/${archl}/linux | |
initrd ${base-url}install/netboot/ubuntu-installer/${archl}/initrd.gz | |
imgargs linux auto=true fb=false url=${sanboot-url}ubuntu/${ubuntu-installer-base}.preseed | |
boot || goto failed | |
goto start | |
:ubuntu-install-remote | |
echo Starting Ubuntu ${ubuntu-version} ${archl} installer for ${initiator-iqn} | |
set base-url http://no.archive.ubuntu.com/ubuntu/dists/${ubuntu-release}/main/installer-${archl}/current/ | |
kernel ${base-url}images/netboot/ubuntu-installer/${archl}/linux | |
initrd ${base-url}images/netboot/ubuntu-installer/${archl}/initrd.gz | |
boot || goto failed | |
goto start | |
:ubuntu-live | |
# See http://manpages.ubuntu.com/manpages/precise/man7/casper.7.html for casper cmdline details | |
echo Booting Ubuntu Live ${ubuntu-version} ${archl} for ${initiator-iqn} | |
set ubuntu-installer-base ubuntu-${ubuntu-version}-desktop-${archl} | |
set base-url ubuntu/${ubuntu-installer-base} | |
kernel ${base-url}/casper/vmlinuz | |
initrd ${base-url}/casper/initrd | |
imgargs vmlinuz boot=casper \ | |
root=/dev/nfs netboot=nfs nfsroot=${nfs-server}:${nfs-root}${base-url} \ | |
locale=en_US.UTF-8 \ | |
keyboard-configuration/layoutcode=no \ | |
mirror/country=NO | |
boot || goto failed | |
goto start |
Thank you, @rikka0w0!
I'm sure this will come in hand for anyone else finding this snippet.
I haven't yet updated my network boot setup to support Ubuntu 20.04 yet, so I wasn't aware of what changes were needed, but I assumed some changes would be needed.
Would it work with ubuntu 20.10 server
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To boot ubuntu-live 20.04, you need to:
ip=dhcp
toimgargs
, otherwise the initramfs won't obtain an IP address via DHCP for you. No IP no network access, and the nfs mounting cannot be done..disk
folder to your nfs server, the.disk
should be at the same folder with thecasper
folder. You only need to keep thecasper-uuid-generic
inside.disk
to make the whole thing work.My folder structure look like this:
My IPXE entry looks like:
Hopefully this will help others.
Thanks