Commit dc516598 authored by nanahira's avatar nanahira

ubuntu

parent c091442f
#!ipxe
# Ubuntu Operating System
# https://www.ubuntu.com
goto ${menu}
:ubuntu
set os Ubuntu
clear ubuntu_version
clear install_type
clear older_release
set install_type deb
menu ${os} - ${arch_a}
item --gap Latest Releases
item groovy ${space} ${os} 20.10 Groovy Gorilla
item focal ${space} ${os} 20.04 LTS Focal Fossa
item bionic ${space} ${os} 18.04 LTS Bionic Beaver
item xenial ${space} ${os} 16.04 LTS Xenial Xerus
item --gap Older Releases
item older_release ${space} Set release codename...
choose ubuntu_version || goto ubuntu_exit
iseq ${ubuntu_version} older_release && goto older_release ||
iseq ${ubuntu_version} focal && set install_type sub ||
iseq ${ubuntu_version} groovy && set install_type sub ||
iseq ${boot_type} sub && goto boot_type ||
goto mirrorcfg
:older_release
set older_release true
set ubuntu_mirror http://old-releases.ubuntu.com
echo Setting mirror to ${ubuntu_mirror}
clear ubuntu_version
echo -n Please set enter code name of release: ${} && read ubuntu_version
set dir ${ubuntu_base_dir}/dists/${ubuntu_version}-updates/main/installer-${arch_a}/current/images/netboot/
goto boot_type
:mirrorcfg
set mirrorcfg mirror/suite=${ubuntu_version}
set dir ${ubuntu_base_dir}/dists/${ubuntu_version}-updates/main/installer-${arch_a}/current/images/netboot/
:boot_type
menu ${os} [${ubuntu_version}] Installer
item --gap Install types
item install ${space} Install
item rescue ${space} Rescue Mode
item automated ${space} Specify preseed/autoinstall url...
choose --default ${type} type || goto ubuntu
echo ${cls}
goto deb_${type}
:deb_rescue
iseq ${install_type} deb && set install_params rescue/enable=true ||
iseq ${install_type} sub && set install_params systemd.unit=rescue.target ||
goto deb_install
:deb_automated
echo -n Specify preseed/autoinstall URL for ${os} ${ubuntu_version}: && read autoinstall
iseq ${install_type} deb && set install_params auto=true priority=critical preseed/url=${autoinstall} ||
iseq ${install_type} sub && set install_params autoinstall ds=nocloud-net;s=${autoinstall} ||
goto deb_install
:deb_install
iseq ${install_type} deb && goto deb_boot ||
iseq ${install_type} sub && goto ${ubuntu_version} ||
:deb_boot
echo Loading Ubuntu PXE netboot installer
set dir ${dir}${menu}-installer/${arch_a}
imgfree
kernel ${ubuntu_mirror}/${dir}/linux ${install_params} ${mirrorcfg} -- quiet initrd=initrd.gz ${cmdline}
initrd ${ubuntu_mirror}/${dir}/initrd.gz
echo
echo MD5sums:
md5sum linux initrd.gz
boot
:focal
set kernel_url http://${boot_domain}/ubuntu-squash/20.04.1-8de3099a/
set codename focal
set version_number 20.04.1
goto sub_boot
:groovy
set kernel_url http://${boot_domain}/ubuntu-squash/20.10-424a54b4/
set codename groovy
set version_number 20.10
goto sub_boot
:sub_boot
imgfree
isset ${dhcp-server} && set netboot_params ip=dhcp url=https://mirrors.aliyun.com/ubuntu-releases/${codename}/ubuntu-${version_number}-live-server-${arch_a}.iso || set netboot_params
echo Loading Ubuntu Subiquity Network Installer...
kernel ${kernel_url}vmlinuz root=/dev/ram0 ramdisk_size=1500000 ${netboot_params} ${install_params} initrd=initrd ${cmdline}
initrd ${kernel_url}initrd
echo
echo MD5sums:
md5sum vmlinuz initrd
boot
:ubuntu_exit
clear menu
exit 0
...@@ -39,9 +39,26 @@ mkdir pxe-menus ...@@ -39,9 +39,26 @@ mkdir pxe-menus
wget -O - https://github.com/netbootxyz/netboot.xyz/releases/download/${MENU_VERSION}/menus.tar.gz | tar zxf - -C ./pxe-menus/ wget -O - https://github.com/netbootxyz/netboot.xyz/releases/download/${MENU_VERSION}/menus.tar.gz | tar zxf - -C ./pxe-menus/
rm -rf pxe-menus/boot.cfg rm -rf pxe-menus/boot.cfg
cp -rf boot.netboot.xyz/ipxe/netboot.xyz* ./pxe-menus/ cp -rf boot.netboot.xyz/ipxe/netboot.xyz* ./pxe-menus/
# custom pxes
cp -rf ../files/pxe/centos.ipxe ./pxe-menus/ cp -rf ../files/pxe/centos.ipxe ./pxe-menus/
cp -rf ../files/pxe/ubuntu.ipxe ./pxe-menus/
cp -rf ../files/pxe/menu.ipxe ./pxe-menus/ cp -rf ../files/pxe/menu.ipxe ./pxe-menus/
cp -rf ../files/pxe/menu.ipxe boot.netboot.xyz/ cp -rf ../files/pxe/menu.ipxe boot.netboot.xyz/
cp -rf pxe-menus/version.ipxe boot.netboot.xyz/ cp -rf pxe-menus/version.ipxe boot.netboot.xyz/
# cp -rf ../files/pxe/nbxyz.ipxe ./pxe-menus/ # cp -rf ../files/pxe/nbxyz.ipxe ./pxe-menus/
# ubuntu-squash
_download_ubuntu_squash() {
GITHUB_RELEASE_VERSION=$1
DIR_PREFIX="boot.netboot.xyz/ubuntu-squash/$GITHUB_RELEASE_VERSION"
echo "Downloading ubuntu-squash of $GITHUB_RELEASE_VERSION"
mkdir -p "$DIR_PREFIX"
wget -O "$DIR_PREFIX/initrd" "https://github.com/netbootxyz/ubuntu-squash/releases/download/$GITHUB_RELEASE_VERSION/initrd"
wget -O "$DIR_PREFIX/vmlinuz" "https://github.com/netbootxyz/ubuntu-squash/releases/download/$GITHUB_RELEASE_VERSION/vmlinuz"
}
_download_ubuntu_squash 20.10-424a54b4
_download_ubuntu_squash 20.04.1-8de3099a
cd .. cd ..
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment