ISO Dateien für EFI/Legacy Systeme über PXE

Einrichten des lokalen Netzes, Verbindung zu anderen Computern und Diensten.
Antworten
Knogle
Beiträge: 465
Registriert: 06.05.2016 19:29:00
Lizenz eigener Beiträge: MIT Lizenz

ISO Dateien für EFI/Legacy Systeme über PXE

Beitrag von Knogle » 12.10.2019 14:43:06

Ich grüße euch liebe Community.
Aktuell suche ich nach einer Möglichkeit diverse Linux ISOs (Installer, PMagic, Gparted etc.) auf meinem PXE für Legacy als auch EFI Systeme zur Verfügung zu stellen damit Auflösung etc. passt.
Wie ließe sich das am besten umsetzen? Ich habe überlegt eventuell einen GRUB zu laden, und dort dann die verschiedenen ISOs als Auswahl zu machen.
Jedoch finde ich leider keine vernünftigen Guides für einen GRUB über PXE, bzw. das Laden der Isos von dort jeweils im EFI oder Legacy Modus.
Das soll dann etwa so aussehen:

Code: Alles auswählen

GRUB

PMagic (Legacy)
PMagic (EFI)
Debian 9 Netinst (Legacy)
Debian 9 Netinst (EFI)
Hat jemand da Tipps für?

Alternativ würde ich ganz klassich PXELINUX nutzen, und mit dnsmasq als TFTP Server und DHCP Proxy.
Weiß jedoch jemand wie ich bei dnsmasq die architecture-type codes detecten kann? Unter tftpd-hpa klappt das, wie folgt:

Code: Alles auswählen

server-name faiserver;
next-server faiserver;
# Check pxe boot code #93 to determine whether we are booting via BIOS 
or EFI
# 2018-07-04: jheim
option architecture-type code 93 = unsigned integer 16;
class "pxeclients" {
	match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
	if option architecture-type = 00:00 {
		filename "fai/pxelinux.0";
	} else {
		filename "fai/syslinux.efi64";
	}
}
Leider finde ich in den dnsmasq manpages nichts dazu.

Habe testweise mal folgendes aufgebaut.

Code: Alles auswählen

  GNU nano 3.2                                                                                                                        /etc/dnsmasq.conf                                                                                                                        Verändert  

dhcp-range=192.168.2.1,proxy                   # Durch das eingene Netzwerk ersetzen.
#dhcp-boot=pxelinux.0,192.168.2.65,192.168.2.1 # Durch die IP-Adresse des TFTP-Servers und des Netzwerks ersetzen.

pxe-service=x86PC,"Netzwerk Boot",pxelinux

enable-tftp
tftp-root=/var/lib/tftpboot



# Test for the architecture of a netboot client. PXE clients are
# supposed to send their architecture as option 93. (See RFC 4578)
dhcp-match=x86PC, option:client-arch, 0 #BIOS x86
dhcp-match=BC_EFI, option:client-arch, 7 #EFI x86-64

# Load different PXE boot image depending on client architecture
pxe-service=tag:x86PC,X86PC, "Install Linux on x86 legacy BIOS", pxelinux
pxe-service=tag:BC_EFI,BC_EFI, "Install Linux on x86-64 UEFI", uefi/bootx64.efi


# Set boot file name only when tag is "bios" or "uefi"
dhcp-boot=tag:x86PC,pxelinux.0  # for Legacy BIOS detected by dhcp-match above
dhcp-boot=tag:BC_EFI,uefi/bootx64.efi # for UEFI arch detected by dhcp-match above

# Enable dnsmasq's built-in TFTP server
enable-tftp

# Set the root directory for files available via FTP.
tftp-root=/usr/local/tftpboot/pxelinux

Bekomme auch bei nem Legacy System die Meldung "Install Linux on x86 legacy BIOS" so wie erwartet.
Folgendes habe ich weterhin gemacht, leider wird aber kein GRUB geladen

So sieht meine Verzeichnisstruktur aus.

Code: Alles auswählen

root@millenium-fbe48:/var/lib/tftpboot# tree
.
├── boot
│   └── grub
│       ├── fonts
│       │   └── unicode.pf2
│       ├── grub.cfg
│       ├── i386-pc
│       │   ├── 915resolution.mod
│       │   ├── acpi.mod
│       │   ├── adler32.mod
│       │   ├── affs.mod
│       │   ├── afs.mod
│       │   ├── ahci.mod
│       │   ├── all_video.mod
│       │   ├── aout.mod
│       │   ├── archelp.mod
│       │   ├── ata.mod
│       │   ├── at_keyboard.mod
│       │   ├── backtrace.mod
│       │   ├── bfs.mod
│       │   ├── biosdisk.mod
│       │   ├── bitmap.mod
│       │   ├── bitmap_scale.mod
│       │   ├── blocklist.mod
│       │   ├── boot.mod
│       │   ├── bsd.mod
│       │   ├── bswap_test.mod
│       │   ├── btrfs.mod
│       │   ├── bufio.mod
│       │   ├── cat.mod
│       │   ├── cbfs.mod
│       │   ├── cbls.mod
│       │   ├── cbmemc.mod
│       │   ├── cbtable.mod
│       │   ├── cbtime.mod
│       │   ├── chain.mod
│       │   ├── cmdline_cat_test.mod
│       │   ├── cmosdump.mod
│       │   ├── cmostest.mod
│       │   ├── cmp.mod
│       │   ├── cmp_test.mod
│       │   ├── command.lst
│       │   ├── configfile.mod
│       │   ├── core.0
│       │   ├── cpio_be.mod
│       │   ├── cpio.mod
│       │   ├── cpuid.mod
│       │   ├── crc64.mod
│       │   ├── cryptodisk.mod
│       │   ├── crypto.lst
│       │   ├── crypto.mod
│       │   ├── cs5536.mod
│       │   ├── ctz_test.mod
│       │   ├── datehook.mod
│       │   ├── date.mod
│       │   ├── datetime.mod
│       │   ├── diskfilter.mod
│       │   ├── disk.mod
│       │   ├── div.mod
│       │   ├── div_test.mod
│       │   ├── dm_nv.mod
│       │   ├── drivemap.mod
│       │   ├── echo.mod
│       │   ├── efiemu32.o
│       │   ├── efiemu64.o
│       │   ├── efiemu.mod
│       │   ├── ehci.mod
│       │   ├── elf.mod
│       │   ├── eval.mod
│       │   ├── exfat.mod
│       │   ├── exfctest.mod
│       │   ├── ext2.mod
│       │   ├── extcmd.mod
│       │   ├── fat.mod
│       │   ├── file.mod
│       │   ├── font.mod
│       │   ├── freedos.mod
│       │   ├── fshelp.mod
│       │   ├── fs.lst
│       │   ├── functional_test.mod
│       │   ├── gcry_arcfour.mod
│       │   ├── gcry_blowfish.mod
│       │   ├── gcry_camellia.mod
│       │   ├── gcry_cast5.mod
│       │   ├── gcry_crc.mod
│       │   ├── gcry_des.mod
│       │   ├── gcry_dsa.mod
│       │   ├── gcry_idea.mod
│       │   ├── gcry_md4.mod
│       │   ├── gcry_md5.mod
│       │   ├── gcry_rfc2268.mod
│       │   ├── gcry_rijndael.mod
│       │   ├── gcry_rmd160.mod
│       │   ├── gcry_rsa.mod
│       │   ├── gcry_seed.mod
│       │   ├── gcry_serpent.mod
│       │   ├── gcry_sha1.mod
│       │   ├── gcry_sha256.mod
│       │   ├── gcry_sha512.mod
│       │   ├── gcry_tiger.mod
│       │   ├── gcry_twofish.mod
│       │   ├── gcry_whirlpool.mod
│       │   ├── gdb.mod
│       │   ├── geli.mod
│       │   ├── gettext.mod
│       │   ├── gfxmenu.mod
│       │   ├── gfxterm_background.mod
│       │   ├── gfxterm_menu.mod
│       │   ├── gfxterm.mod
│       │   ├── gptsync.mod
│       │   ├── grub.cfg
│       │   ├── gzio.mod
│       │   ├── halt.mod
│       │   ├── hashsum.mod
│       │   ├── hdparm.mod
│       │   ├── hello.mod
│       │   ├── help.mod
│       │   ├── hexdump.mod
│       │   ├── hfs.mod
│       │   ├── hfspluscomp.mod
│       │   ├── hfsplus.mod
│       │   ├── http.mod
│       │   ├── hwmatch.mod
│       │   ├── iorw.mod
│       │   ├── iso9660.mod
│       │   ├── jfs.mod
│       │   ├── jpeg.mod
│       │   ├── keylayouts.mod
│       │   ├── keystatus.mod
│       │   ├── ldm.mod
│       │   ├── legacycfg.mod
│       │   ├── legacy_password_test.mod
│       │   ├── linux16.mod
│       │   ├── linux.mod
│       │   ├── loadenv.mod
│       │   ├── loopback.mod
│       │   ├── lsacpi.mod
│       │   ├── lsapm.mod
│       │   ├── lsmmap.mod
│       │   ├── ls.mod
│       │   ├── lspci.mod
│       │   ├── luks.mod
│       │   ├── lvm.mod
│       │   ├── lzopio.mod
│       │   ├── macbless.mod
│       │   ├── macho.mod
│       │   ├── mda_text.mod
│       │   ├── mdraid09_be.mod
│       │   ├── mdraid09.mod
│       │   ├── mdraid1x.mod
│       │   ├── memdisk.mod
│       │   ├── memrw.mod
│       │   ├── minicmd.mod
│       │   ├── minix2_be.mod
│       │   ├── minix2.mod
│       │   ├── minix3_be.mod
│       │   ├── minix3.mod
│       │   ├── minix_be.mod
│       │   ├── minix.mod
│       │   ├── mmap.mod
│       │   ├── moddep.lst
│       │   ├── modinfo.sh
│       │   ├── morse.mod
│       │   ├── mpi.mod
│       │   ├── msdospart.mod
│       │   ├── mul_test.mod
│       │   ├── multiboot2.mod
│       │   ├── multiboot.mod
│       │   ├── nativedisk.mod
│       │   ├── net.mod
│       │   ├── newc.mod
│       │   ├── nilfs2.mod
│       │   ├── normal.mod
│       │   ├── ntfscomp.mod
│       │   ├── ntfs.mod
│       │   ├── ntldr.mod
│       │   ├── odc.mod
│       │   ├── offsetio.mod
│       │   ├── ohci.mod
│       │   ├── part_acorn.mod
│       │   ├── part_amiga.mod
│       │   ├── part_apple.mod
│       │   ├── part_bsd.mod
│       │   ├── part_dfly.mod
│       │   ├── part_dvh.mod
│       │   ├── part_gpt.mod
│       │   ├── partmap.lst
│       │   ├── part_msdos.mod
│       │   ├── part_plan.mod
│       │   ├── part_sun.mod
│       │   ├── part_sunpc.mod
│       │   ├── parttool.lst
│       │   ├── parttool.mod
│       │   ├── password.mod
│       │   ├── password_pbkdf2.mod
│       │   ├── pata.mod
│       │   ├── pbkdf2.mod
│       │   ├── pbkdf2_test.mod
│       │   ├── pcidump.mod
│       │   ├── pci.mod
│       │   ├── plan9.mod
│       │   ├── play.mod
│       │   ├── png.mod
│       │   ├── priority_queue.mod
│       │   ├── probe.mod
│       │   ├── procfs.mod
│       │   ├── progress.mod
│       │   ├── pxechain.mod
│       │   ├── pxe.mod
│       │   ├── raid5rec.mod
│       │   ├── raid6rec.mod
│       │   ├── random.mod
│       │   ├── read.mod
│       │   ├── reboot.mod
│       │   ├── regexp.mod
│       │   ├── reiserfs.mod
│       │   ├── relocator.mod
│       │   ├── romfs.mod
│       │   ├── scsi.mod
│       │   ├── search_fs_file.mod
│       │   ├── search_fs_uuid.mod
│       │   ├── search_label.mod
│       │   ├── search.mod
│       │   ├── sendkey.mod
│       │   ├── serial.mod
│       │   ├── setjmp.mod
│       │   ├── setjmp_test.mod
│       │   ├── setpci.mod
│       │   ├── sfs.mod
│       │   ├── shift_test.mod
│       │   ├── signature_test.mod
│       │   ├── sleep.mod
│       │   ├── sleep_test.mod
│       │   ├── spkmodem.mod
│       │   ├── squash4.mod
│       │   ├── syslinuxcfg.mod
│       │   ├── tar.mod
│       │   ├── terminal.lst
│       │   ├── terminal.mod
│       │   ├── terminfo.mod
│       │   ├── test_blockarg.mod
│       │   ├── testload.mod
│       │   ├── test.mod
│       │   ├── testspeed.mod
│       │   ├── tftp.mod
│       │   ├── tga.mod
│       │   ├── time.mod
│       │   ├── trig.mod
│       │   ├── tr.mod
│       │   ├── truecrypt.mod
│       │   ├── true.mod
│       │   ├── udf.mod
│       │   ├── ufs1_be.mod
│       │   ├── ufs1.mod
│       │   ├── ufs2.mod
│       │   ├── uhci.mod
│       │   ├── usb_keyboard.mod
│       │   ├── usb.mod
│       │   ├── usbms.mod
│       │   ├── usbserial_common.mod
│       │   ├── usbserial_ftdi.mod
│       │   ├── usbserial_pl2303.mod
│       │   ├── usbserial_usbdebug.mod
│       │   ├── usbtest.mod
│       │   ├── vbe.mod
│       │   ├── verify.mod
│       │   ├── vga.mod
│       │   ├── vga_text.mod
│       │   ├── video_bochs.mod
│       │   ├── video_cirrus.mod
│       │   ├── video_colors.mod
│       │   ├── video_fb.mod
│       │   ├── videoinfo.mod
│       │   ├── video.lst
│       │   ├── video.mod
│       │   ├── videotest_checksum.mod
│       │   ├── videotest.mod
│       │   ├── xfs.mod
│       │   ├── xnu.mod
│       │   ├── xnu_uuid.mod
│       │   ├── xnu_uuid_test.mod
│       │   ├── xzio.mod
│       │   ├── zfscrypt.mod
│       │   ├── zfsinfo.mod
│       │   └── zfs.mod
│       ├── locale
│       │   ├── ast.mo
│       │   ├── ca.mo
│       │   ├── da.mo
│       │   ├── de_CH.mo
│       │   ├── de@hebrew.mo
│       │   ├── de.mo
│       │   ├── en@arabic.mo
│       │   ├── en@cyrillic.mo
│       │   ├── en@greek.mo
│       │   ├── en@hebrew.mo
│       │   ├── en@piglatin.mo
│       │   ├── en@quot.mo
│       │   ├── eo.mo
│       │   ├── es.mo
│       │   ├── fi.mo
│       │   ├── fr.mo
│       │   ├── gl.mo
│       │   ├── hr.mo
│       │   ├── hu.mo
│       │   ├── id.mo
│       │   ├── it.mo
│       │   ├── ja.mo
│       │   ├── ko.mo
│       │   ├── lt.mo
│       │   ├── nb.mo
│       │   ├── nl.mo
│       │   ├── pa.mo
│       │   ├── pl.mo
│       │   ├── pt_BR.mo
│       │   ├── ru.mo
│       │   ├── sl.mo
│       │   ├── sr.mo
│       │   ├── sv.mo
│       │   ├── tr.mo
│       │   ├── uk.mo
│       │   ├── vi.mo
│       │   ├── zh_CN.mo
│       │   └── zh_TW.mo
│       └── x86_64-efi
│           ├── acpi.mod
│           ├── adler32.mod
│           ├── affs.mod
│           ├── afs.mod
│           ├── ahci.mod
│           ├── all_video.mod
│           ├── aout.mod
│           ├── appleldr.mod
│           ├── archelp.mod
│           ├── ata.mod
│           ├── at_keyboard.mod
│           ├── backtrace.mod
│           ├── bfs.mod
│           ├── bitmap.mod
│           ├── bitmap_scale.mod
│           ├── blocklist.mod
│           ├── boot.mod
│           ├── bsd.mod
│           ├── bswap_test.mod
│           ├── btrfs.mod
│           ├── bufio.mod
│           ├── cat.mod
│           ├── cbfs.mod
│           ├── cbls.mod
│           ├── cbmemc.mod
│           ├── cbtable.mod
│           ├── cbtime.mod
│           ├── chain.mod
│           ├── cmdline_cat_test.mod
│           ├── cmp.mod
│           ├── cmp_test.mod
│           ├── command.lst
│           ├── configfile.mod
│           ├── core.efi
│           ├── cpio_be.mod
│           ├── cpio.mod
│           ├── cpuid.mod
│           ├── crc64.mod
│           ├── cryptodisk.mod
│           ├── crypto.lst
│           ├── crypto.mod
│           ├── cs5536.mod
│           ├── ctz_test.mod
│           ├── datehook.mod
│           ├── date.mod
│           ├── datetime.mod
│           ├── diskfilter.mod
│           ├── disk.mod
│           ├── div.mod
│           ├── div_test.mod
│           ├── dm_nv.mod
│           ├── echo.mod
│           ├── efifwsetup.mod
│           ├── efi_gop.mod
│           ├── efinet.mod
│           ├── efi_uga.mod
│           ├── ehci.mod
│           ├── elf.mod
│           ├── eval.mod
│           ├── exfat.mod
│           ├── exfctest.mod
│           ├── ext2.mod
│           ├── extcmd.mod
│           ├── fat.mod
│           ├── file.mod
│           ├── fixvideo.mod
│           ├── font.mod
│           ├── fshelp.mod
│           ├── fs.lst
│           ├── functional_test.mod
│           ├── gcry_arcfour.mod
│           ├── gcry_blowfish.mod
│           ├── gcry_camellia.mod
│           ├── gcry_cast5.mod
│           ├── gcry_crc.mod
│           ├── gcry_des.mod
│           ├── gcry_dsa.mod
│           ├── gcry_idea.mod
│           ├── gcry_md4.mod
│           ├── gcry_md5.mod
│           ├── gcry_rfc2268.mod
│           ├── gcry_rijndael.mod
│           ├── gcry_rmd160.mod
│           ├── gcry_rsa.mod
│           ├── gcry_seed.mod
│           ├── gcry_serpent.mod
│           ├── gcry_sha1.mod
│           ├── gcry_sha256.mod
│           ├── gcry_sha512.mod
│           ├── gcry_tiger.mod
│           ├── gcry_twofish.mod
│           ├── gcry_whirlpool.mod
│           ├── geli.mod
│           ├── gettext.mod
│           ├── gfxmenu.mod
│           ├── gfxterm_background.mod
│           ├── gfxterm_menu.mod
│           ├── gfxterm.mod
│           ├── gptsync.mod
│           ├── grub.cfg
│           ├── gzio.mod
│           ├── halt.mod
│           ├── hashsum.mod
│           ├── hdparm.mod
│           ├── hello.mod
│           ├── help.mod
│           ├── hexdump.mod
│           ├── hfs.mod
│           ├── hfspluscomp.mod
│           ├── hfsplus.mod
│           ├── http.mod
│           ├── iorw.mod
│           ├── iso9660.mod
│           ├── jfs.mod
│           ├── jpeg.mod
│           ├── keylayouts.mod
│           ├── keystatus.mod
│           ├── ldm.mod
│           ├── legacycfg.mod
│           ├── legacy_password_test.mod
│           ├── linux16.mod
│           ├── linuxefi.mod
│           ├── linux.mod
│           ├── loadbios.mod
│           ├── loadenv.mod
│           ├── loopback.mod
│           ├── lsacpi.mod
│           ├── lsefimmap.mod
│           ├── lsefi.mod
│           ├── lsefisystab.mod
│           ├── lsmmap.mod
│           ├── ls.mod
│           ├── lspci.mod
│           ├── lssal.mod
│           ├── luks.mod
│           ├── lvm.mod
│           ├── lzopio.mod
│           ├── macbless.mod
│           ├── macho.mod
│           ├── mdraid09_be.mod
│           ├── mdraid09.mod
│           ├── mdraid1x.mod
│           ├── memdisk.mod
│           ├── memrw.mod
│           ├── minicmd.mod
│           ├── minix2_be.mod
│           ├── minix2.mod
│           ├── minix3_be.mod
│           ├── minix3.mod
│           ├── minix_be.mod
│           ├── minix.mod
│           ├── mmap.mod
│           ├── moddep.lst
│           ├── modinfo.sh
│           ├── morse.mod
│           ├── mpi.mod
│           ├── msdospart.mod
│           ├── mul_test.mod
│           ├── multiboot2.mod
│           ├── multiboot.mod
│           ├── nativedisk.mod
│           ├── net.mod
│           ├── newc.mod
│           ├── nilfs2.mod
│           ├── normal.mod
│           ├── ntfscomp.mod
│           ├── ntfs.mod
│           ├── odc.mod
│           ├── offsetio.mod
│           ├── ohci.mod
│           ├── part_acorn.mod
│           ├── part_amiga.mod
│           ├── part_apple.mod
│           ├── part_bsd.mod
│           ├── part_dfly.mod
│           ├── part_dvh.mod
│           ├── part_gpt.mod
│           ├── partmap.lst
│           ├── part_msdos.mod
│           ├── part_plan.mod
│           ├── part_sun.mod
│           ├── part_sunpc.mod
│           ├── parttool.lst
│           ├── parttool.mod
│           ├── password.mod
│           ├── password_pbkdf2.mod
│           ├── pata.mod
│           ├── pbkdf2.mod
│           ├── pbkdf2_test.mod
│           ├── pcidump.mod
│           ├── play.mod
│           ├── png.mod
│           ├── priority_queue.mod
│           ├── probe.mod
│           ├── procfs.mod
│           ├── progress.mod
│           ├── raid5rec.mod
│           ├── raid6rec.mod
│           ├── random.mod
│           ├── read.mod
│           ├── reboot.mod
│           ├── regexp.mod
│           ├── reiserfs.mod
│           ├── relocator.mod
│           ├── romfs.mod
│           ├── scsi.mod
│           ├── search_fs_file.mod
│           ├── search_fs_uuid.mod
│           ├── search_label.mod
│           ├── search.mod
│           ├── serial.mod
│           ├── setjmp.mod
│           ├── setjmp_test.mod
│           ├── setpci.mod
│           ├── sfs.mod
│           ├── shift_test.mod
│           ├── signature_test.mod
│           ├── sleep.mod
│           ├── sleep_test.mod
│           ├── spkmodem.mod
│           ├── squash4.mod
│           ├── syslinuxcfg.mod
│           ├── tar.mod
│           ├── terminal.lst
│           ├── terminal.mod
│           ├── terminfo.mod
│           ├── test_blockarg.mod
│           ├── testload.mod
│           ├── test.mod
│           ├── testspeed.mod
│           ├── tftp.mod
│           ├── tga.mod
│           ├── time.mod
│           ├── trig.mod
│           ├── tr.mod
│           ├── true.mod
│           ├── udf.mod
│           ├── ufs1_be.mod
│           ├── ufs1.mod
│           ├── ufs2.mod
│           ├── uhci.mod
│           ├── usb_keyboard.mod
│           ├── usb.mod
│           ├── usbms.mod
│           ├── usbserial_common.mod
│           ├── usbserial_ftdi.mod
│           ├── usbserial_pl2303.mod
│           ├── usbserial_usbdebug.mod
│           ├── usbtest.mod
│           ├── verify.mod
│           ├── video_bochs.mod
│           ├── video_cirrus.mod
│           ├── video_colors.mod
│           ├── video_fb.mod
│           ├── videoinfo.mod
│           ├── video.lst
│           ├── video.mod
│           ├── videotest_checksum.mod
│           ├── videotest.mod
│           ├── xfs.mod
│           ├── xnu.mod
│           ├── xnu_uuid.mod
│           ├── xnu_uuid_test.mod
│           ├── xzio.mod
│           ├── zfscrypt.mod
│           ├── zfsinfo.mod
│           └── zfs.mod
├── booti386
└── bootx64.efi
Nachdem ich ein

Code: Alles auswählen

grub-mknetdir
gemacht habe.
Weiterhin habe ich folgende Images erstellt.

Code: Alles auswählen

grub-mkimage -d /usr/lib/grub/i386-pc/ -O i386-pc-pxe -o ./booti386 -p '/var/lib/tftpboot/boot/grub' pxe tftp

Code: Alles auswählen

grub-mkimage -d /usr/lib/grub/x86_64-efi/ -O x86_64-efi -o ./bootx64.efi -p '/var/lib/tftpboot/boot/grub' efinet tftp
Kann ich eigentlich mit einem grub.d arbeiten statt mit einer grub.cfg um für verschiedene ISOs ein Script zu bauen?

Benutzeravatar
florit
Beiträge: 61
Registriert: 10.01.2022 12:24:50
Lizenz eigener Beiträge: MIT Lizenz

Re: ISO Dateien für EFI/Legacy Systeme über PXE

Beitrag von florit » 17.11.2023 20:44:34

Ich habe bisher zwei Möglichkeiten für PXE-BOOT gefunden …

Die eine wäre für VM-ware oder eine beliebige andere Virtual Machine
Und das andere wäre für boot mit usb stick (500MB-4GB reichen)

Eine Anmerkung habe ich … local.ipxe und die scripte im selben Ordner zb test

Code: Alles auswählen

bash script.sh ../../local.ipxe

Code: Alles auswählen

#!/bin/bash
#!/dev/tty1
ARGV="$@"
ARGC="$#"
# source from: https://superuser.com/questions/361885/how-do-i-figure-out-which-dev-is-a-usb-flash-drive

if [ "$#" -ne 1 ]; then
    echo "USAGE: sh ${0} ../../local.ipxe"
    exit 0
fi

if [ ! -f ipxe ]; then
git clone git://git.ipxe.org/ipxe.git
fi
make -C ipxe/src/ bin/ipxe.usb EMBED=${1}
cp ipxe/src/bin/ipxe.usb ./ipxe.iso
exit 0

Code: Alles auswählen

#!/bin/bash
#!/dev/tty1
ARGV="$@"
ARGC="$#"
# source from: https://superuser.com/questions/361885/how-do-i-figure-out-which-dev-is-a-usb-flash-drive

if [ "$#" -ne 1 ]; then
    echo "USAGE: sh ${0} ../../local.ipxe"
    exit 0
fi

if [ ! -f ipxe ]; then
git clone git://git.ipxe.org/ipxe.git
fi
make -C ipxe/src/ bin/ipxe.usb EMBED=${1}

REMOVABLE_DRIVES=""
    for _device in /sys/block/*/device; do
        if echo $(readlink -f "$_device")|egrep -q "usb"; then
            _disk=$(echo "$_device" | cut -f4 -d/)
            REMOVABLE_DRIVES="$REMOVABLE_DRIVES $_disk"
        fi
    done

    if [ ! -z "$REMOVABLE_DRIVES" ] ; then
    for dev in $REMOVABLE_DRIVES ; do
	if (dialog --title "Installation" --yesno "Want to do Installation of \"PXE Network Boot\" on /dev/$dev" 16 75); then
	if [ ! -z "$(sudo dd if=ipxe/src/bin/ipxe.usb of=/dev/$dev)" ] ; then
	dialog --title "Error" --msgbox "Installation on /dev/$dev Failed!" 6 55 ; 
	else
	dialog --title "Success" --msgbox "Installation on /dev/$dev Success!" 6 55 ; 
	fi
	else
	dialog --title "Bye" --msgbox "Programm Abort Success!" 6 55 ; 
	fi
    done
       else
       dialog --title "Error" --msgbox "No USB Stick found!" 6 55 ; 
	fi

exit 0
Und das boot file script:

local.ipxe

Code: Alles auswählen

#!ipxe
dhcp
chain tftp://192.168.2.100/pxelinux.0

Benutzeravatar
cosinus
Beiträge: 3423
Registriert: 08.02.2016 13:44:11
Lizenz eigener Beiträge: GNU General Public License
Wohnort: Bremen

Re: ISO Dateien für EFI/Legacy Systeme über PXE

Beitrag von cosinus » 17.11.2023 21:19:48

UEFI-PXE-Boot? @Livingston und ich hatten da mal was ausgearbeitet --> viewtopic.php?t=184415

Benutzeravatar
florit
Beiträge: 61
Registriert: 10.01.2022 12:24:50
Lizenz eigener Beiträge: MIT Lizenz

Re: ISO Dateien für EFI/Legacy Systeme über PXE

Beitrag von florit » 17.11.2023 21:30:22

Als dhcpd (isc-dhcp-server) option angeben

Siehe : https://ipxe.org/howto/dhcpd

Code: Alles auswählen

  option client-architecture code 93 = unsigned integer 16;
  if exists user-class and option user-class = "iPXE" {
      filename "http://my.web.server/real_boot_script.php";
  } elsif option client-architecture = 00:00 {
      filename "undionly.kpxe";
  } else {
      filename "ipxe.efi";
  }

Antworten