You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.8 KiB
80 lines
1.8 KiB
# Network booting
|
|
|
|
https://documentation.ubuntu.com/server/how-to/installation/how-to-netboot-the-server-installer-on-amd64/
|
|
|
|
https://chatgpt.com/c/6765b743-ca68-800c-9a63-dd5768d20b4c
|
|
|
|
TODO: create squashfs image from live system
|
|
|
|
`apt install dnsmasq`
|
|
|
|
`mkdir -p /srv/tftp`
|
|
|
|
`vim /etc/dnsmasq.conf`
|
|
|
|
```
|
|
interface=<your interface>,lo
|
|
bind-interfaces
|
|
dhcp-range=<your interface>,192.168.0.100,192.168.0.200
|
|
dhcp-boot=pxelinux.0
|
|
dhcp-match=set:efi-x86_64,option:client-arch,7
|
|
dhcp-boot=tag:efi-x86_64,grubx64.efi
|
|
enable-tftp
|
|
tftp-root=/srv/tftp
|
|
```
|
|
|
|
~~`apt install debootstrap chroot squashfs-tools`~~
|
|
|
|
`cp /boot/vmlinuz /srv/tftp/vmlinuz`
|
|
|
|
`cp /boot/initrd.img /srv/tftp/initrd.img`
|
|
|
|
`apt download grub-efi-amd64-signed`
|
|
|
|
`dpkg-deb --fsys-tarfile grub-efi*deb | tar x ./usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed -O > /srv/tftp/grubx64.efi`
|
|
|
|
`apt download grub-common`
|
|
|
|
`dpkg-deb --fsys-tarfile grub-common*deb | tar x ./usr/share/grub/unicode.pf2 -O > /srv/tftp/unicode.pf2`
|
|
|
|
`mkdir -p /srv/tftp/grub`
|
|
|
|
`vim /srv/tftp/grub/grub.cfg`
|
|
|
|
```grub
|
|
set default=0
|
|
set timeout=5
|
|
|
|
menuentry "Boot Diskless Client" {
|
|
#linux /vmlinuz boot=live components netboot=nfs nfsroot=192.168.1.2:/opt/clients/live/ root=/dev/nfs rw ip=dhcp
|
|
linux /vmlinuz boot=live components ip=dhcp
|
|
initrd /initrd.img
|
|
}
|
|
```
|
|
|
|
|
|
`vim /etc/netplan/10-static.yaml`
|
|
|
|
```yaml
|
|
network:
|
|
version: 2
|
|
ethernets:
|
|
enp0s8:
|
|
dhcp4: false
|
|
dhcp6: false
|
|
addresses:
|
|
- 192.168.11.1/24
|
|
```
|
|
|
|
`systemctl edit dnsmasq.service`
|
|
|
|
```
|
|
[Unit]
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
```
|
|
|
|
|
|
`grub-mkimage -p /grub -o /srv/tftp/grubx64_custom.efi -O x86_64-efi part_gpt part_msdos fat ext2 ntfs iso9660 loopback linux multiboot efi_gop efi_uga usb usb_keyboard uhci ohci ehci xfs configfile normal net tftp`
|
|
|
|
Working shell, but "no network card found" |