User Tools

Site Tools


public:it:pxe

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:it:pxe [2021/03/02 18:01] – [FreeDOS w/ Payload] philpublic:it:pxe [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== PXE ====== 
-  * https://gist.github.com/robinsmidsrod/2234639 
-  * https://wiki.snowfrs.com/IPV4_network_boot_with_iPXE 
  
- 
-===== Autoinstall/Preseed ===== 
- 
-  * https://fai-project.org/fai-guide/#_a_id_install_a_fai_installs_your_plan 
-  * https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1887767?comments=all 
-  * https://butwt.wordpress.com/2020/06/29/pxe-booting-ubuntu-20-04-installer/ 
-  *  
- 
-==== Ubuntu Autoinstall yaml ==== 
-  * [[https://ubuntu.com/server/docs/install/autoinstall| Autoinstall.yml]] 
-  * [[https://curtin.readthedocs.io/en/latest/topics/storage.html|Storage config options]] 
- 
-https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2004AutoinstFormat 
-https://medium.com/@tlhakhan/ubuntu-server-20-04-autoinstall-2e5f772b655a 
-https://askubuntu.com/questions/1235723/automated-20-04-server-installation-using-pxe-and-live-server-image 
- 
- 
-[[https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/219| main ubuntu page for discussing autoinstall.yml]] 
- 
- 
-https://gist.github.com/s3rj1k/55b10cd20f31542046018fcce32f103e 
- 
-https://gist.github.com/Brainiarc7/76902466d8628bcf5cd79d8953edbdd8 
-===== PXE ===== 
-=== iPXE Boot Ubuntu 20.04 Desktop ISO === 
-<code> 
-:focaldesktopiso 
-kernel ${boot-url}nfs/focal/casper/vmlinuz 
-initrd ${boot-url}nfs/focal/casper/initrd 
-imgargs vmlinuz initrd=initrd boot=casper ip=dhcp url=${boot-url}ubuntu/focal/ubuntu-20.04.1-desktop-amd64.iso maybe-ubiquity 
-boot 
-</code> 
- 
-==== Auto install 20.04 and greater using ubiquiti installer (autoinstall.yml) ==== 
-ipxe menu item 
-<code> 
-:hirsuteserver 
-kernel ${boot-url}ubuntu/hirsute/iso/vmlinuz initrd=initrd autoinstall url=${boot-url}ubuntu/hirsute/iso/hirsute-live-server-amd64.iso net.ifnames=0 biosdevname=0 ip=dhcp ipv6.disable=1 ds=nocloud-net;s=${boot-url}ubuntu/hirsute/cloud-init/ 
-initrd ${boot-url}ubuntu/hirsute/iso/initrd 
-boot 
-</code> 
- 
-File structure: 
-<code> 
-tftp$ find ubuntu/hirsute/ 
-ubuntu/hirsute/ 
-ubuntu/hirsute/iso 
-ubuntu/hirsute/iso/initrd 
-ubuntu/hirsute/iso/hirsute-live-server-amd64.iso 
-ubuntu/hirsute/iso/vmlinuz 
-ubuntu/hirsute/cloud-init 
-ubuntu/hirsute/cloud-init/meta-data 
-ubuntu/hirsute/cloud-init/user-data 
-</code> 
- 
-meta-data 
-<code> 
-instance-id: hirsute-autoinstall 
-</code> 
- 
-user-data aka autoinstall.yml 
-<code> 
-#cloud-config 
-autoinstall: 
-  apt: 
-    geoip: true 
-    preserve_sources_list: false 
-    primary: 
-    - arches: [amd64] 
-      uri: http://us.archive.ubuntu.com/ubuntu 
-  identity: {hostname: autoinstall-00, password: $6$supersecretpasswdhash, realname: phil, username: phil} 
-  keyboard: {layout: us, variant: ''} 
-  locale: en_US.UTF-8 
-  network: 
-    network: 
-      ethernets: 
-        eth0: 
-          critical: true 
-          dhcp-identifier: mac 
-          dhcp4: true 
-      version: 2 
-  ssh: 
-    allow-pw: true 
-    authorized-keys: 
-      - "authkey ed25519 FTW" 
-    install-server: true 
-  storage: 
-    grub: 
-      reorder_uefi: False 
-    config: 
-    - {ptable: gpt, wwn: '0x50026b77832fae66', 
-      path: /dev/sda, wipe: superblock, preserve: false, name: '', grub_device: false, 
-      type: disk, id: disk-sda} 
-    - {device: disk-sda, size: 536870912, wipe: superblock, flag: boot, number: 1, 
-      preserve: false, grub_device: true, type: partition, id: partition-0} 
-    - {fstype: fat32, volume: partition-0, preserve: false, type: format, id: format-0} 
-    - {device: disk-sda, size: 1073741824, wipe: superblock, flag: '', number: 2, 
-      preserve: false, grub_device: false, type: partition, id: partition-1} 
-    - {fstype: ext4, volume: partition-1, preserve: false, type: format, id: format-1} 
-    - {device: disk-sda, size: 238444085248, wipe: superblock, flag: '', number: 3, 
-      preserve: false, grub_device: false, type: partition, id: partition-2} 
-    - name: ubuntu-vg 
-      devices: [partition-2] 
-      preserve: false 
-      type: lvm_volgroup 
-      id: lvm_volgroup-0 
-    - {name: ubuntu-lv, volgroup: lvm_volgroup-0, size: 119220994048B, preserve: false, 
-      type: lvm_partition, id: lvm_partition-0} 
-    - {fstype: ext4, volume: lvm_partition-0, preserve: false, type: format, id: format-2} 
-    - {device: format-2, path: /, type: mount, id: mount-2} 
-    - {device: format-1, path: /boot, type: mount, id: mount-1} 
-    - {device: format-0, path: /boot/efi, type: mount, id: mount-0} 
-  version: 1 
-  user-data: 
-    timezone: America/Chicago 
-    disable_root: false 
-  late-commands: 
-    - echo 'phil ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu 
-    - sed -ie 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 ipv6.disable=1 biosdevname=0"/' /target/etc/default/grub 
-    - curtin in-target --target /target update-grub2 
-</code> 
- 
-==== autoinstall.yml config bugs ==== 
-list of bugs 
- 
- 
-====== FreeDOS w/ Payload ====== 
-  * https://possiblelossofprecision.net/?p=2312 
-  * https://superuser.com/a/1541939 
-<code> 
-#!ipxe 
-  
-:freedos 
-:freedosfirmware 
-sanhook ${boot-url}firmware/precision_3420/payload.img || goto failed 
-sanboot --no-describe --drive 0x00 ${boot-url}firmware/freedos12.img 
-boot || goto failed 
- 
-  
-:failed 
-echo Booting failed, dropping to shell 
-goto shell 
-</code> 
- 
-<code> 
-truncate payload.img --size 32MB 
-sfdisk payload.img << EOF 
-63,,b 
-EOF 
-</code> 
- 
-<code> 
-losetup --partscan /dev/loop20 ./payload.img 
-mkfs.vfat /dev/loop20p1 
-</code> 
- 
-<code> 
-mount /dev/loop20p1 /mnt/  
-cp <necessary files> /mnt/ 
-umount /mnt 
-losetup -d /dev/loop20 
-</code> 
- 
-====== WinPE ======= 
- 
-  * [[https://ipxe.org/howto/winpe|Main README]] 
-  * [[https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-intro|WinPE]] 
- 
- 
-  - [[https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install|WinPE Install]] 
-    - [[https://go.microsoft.com/fwlink/?linkid=2120254|Download the Windows ADK for Windows 10, version 2004 (adksetup.exe)]] 
-    - [[https://go.microsoft.com/fwlink/?linkid=2120253|Download the Windows PE add-on for the ADK, version 2004 (adkwinpesetup.exe)]]  
-  - Copy WinPE into temp directory: 
-    - Open "Deployment and Imaging Tools Environment". This is a command prompt. 
-    - <code> 
-mkdir C:\temp\winpe 
-copype x86 C:\temp\winpe\x86 
-copype amd64 C:\temp\winpe\amd64 
-</code> 
-  - Inject virtio drivers into winpe 
-    - Open an elevated "Deployment and Imaging Tools Environment" prompt. 
-    - [[https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso|Download drivers]]: [[https://github.com/virtio-win/virtio-win-pkg-scripts/blob/master/README.md|Source]] 
-    - Inject drivers AMD64<code> 
-dism /mount-image /imagefile:"C:\temp\winpe\amd64\media\sources\boot.wim" /index:1 /mountdir:"C:\temp\winpe\amd64\mount" 
-dism /image:C:\temp\winpe\amd64\mount /add-driver /driver:c:\temp\winpe\drivers /recurse /forceunsigned 
-dism /unmount-image /mountdir:"C:\temp\winpe\amd64\mount" /commit 
-</code> 
-    - Inject drivers x86<code> 
-dism /mount-image /imagefile:"C:\temp\winpe\x86\media\sources\boot.wim" /index:1 /mountdir:"C:\temp\winpe\x86\mount" 
-dism /image:C:\temp\winpe\x86\mount /add-driver /driver:c:\temp\winpe\drivers /recurse /forceunsigned 
-dism /unmount-image /mountdir:"C:\temp\winpe\x86\mount" /commit 
-</code> 
public/it/pxe.1614729691.txt.gz · Last modified: 2021/03/02 18:01 by phil