Quantcast
Viewing all 1484 articles
Browse latest View live

script for UEFI iPXE

Hello

please do not throw tomatoes for my English Image may be NSFW.
Clik here to view.
Big Grin


for legacy BIOS, I made a USB stick with iPXE and corrected the menu, as a result, the need to configure DHCP server disappeared. The default was exit, which was applied after 5 seconds. And two more points - shell PXE and download the desired file from the tftp server. Over time, the need arose to alter the fact in the UEFI I did the flash and all it does it accesses the DHCP server, while UEFI already knows this. How can I implement the same functionality for UEFI as on legacy

how do I display the serial and mac address on ipxe main menu?

I'd like to display the computer serial and mac address. This is because when we recieve new machines, typically 40 at a time, I use ipxe to boot and then enter these details into a new machine database.

I must enter the ipxe shell to type show net0/mac and show serial. To be easier it would be useful to be displayed on the ipxe menu itself, or have a submenu to show this info.

Preferably if it could be displayed underneath the menu title directly, psedo code below, as I do not know the correct way to display undefined variables.

menu iPXE Boot Menu
text serial: $(serial)
text MAC: $(net0/mac)

iPXE won't boot on old Pentium

Hi,
I'm trying to load iPXE on an old P233MMX but the boot process gets stuck after.
Code:
Loading ipxe.krn.......ready.
No Ctrl-alt-del, I've to hard reset.

I've tried :
- the official iso (isolinux loads but no iPXE)
- build on WSL (Ubuntu 18.04)
- build on Debian 9 i386
With the same result, with floppy image and iso.

I've tested a build with debug enabled :
make bin/rhine.iso DEBUG=libprefix,dskprefix

Code:
iPXE ISO boot image
Loading rhine.krn... ok

install_prealloc: 00009C88 00009D0C 00000000 00000000 FFFFFFFF
   .text16.early  00010DF0 0009C080 000000F8 000000F8
   access_highmem
   open_payload   00000000 00000EE0
   .text16.late   00100000 0009C980 00000712 00000712
   .datal6        00100570 0009D0C0 000000C0 000000C0
   .textdata      001005C0 04052000 0001BB10 0009DD68
   init_librm     00009C88 00009D0C 04052000

If the boot process worked, the next message should be
Code:
close_payload

From the source I understand that it has to do with switching to protected mode. So I tried to build a kir with
Code:
make -f arch/i386/kir-Makefile
but failed : https://gist.github.com/vanmachin/180a73...297a3a005d

What can I do next?

What is the default iPXE script?

What are the default commands that are run when iPXE starts?

Compiling Errors

I can't figure out why I'm getting compiling errors when I try to build:
make bin-i386-efi/ncm–-ecm–-axge.usb
I haven't changed any of the default config. I have even tried re-cloning ipxe from git. Any ideas?

Code:
.....
[BUILD] bin-i386-efi/ath9k.ids.o
  [AR] bin-i386-efi/blib.a
ar: creating bin-i386-efi/blib.a
  [HOSTCC] util/elf2efi32
  [VERSION] bin-i386-efi/version.ncm–-ecm–-axge.efi.o
  [LD] bin-i386-efi/ncm–-ecm–-axge.efi.tmp
ld:--defsym:2: ignoring invalid character `\342' in expression
ld:--defsym:2: ignoring invalid character `\200' in expression
ld:--defsym:2: ignoring invalid character `\223' in expression
ld:--defsym:2: syntax error
Makefile.housekeeping:1187: recipe for target 'bin-i386-efi/ncm–-ecm–-axge.efi.tmp' failed
make: *** [bin-i386-efi/ncm–-ecm–-axge.efi.tmp] Error 1
rm bin-i386-efi/version.ncm–-ecm–-axge.efi.o

iSCSI read errors during iPXE boot

I've had iPXE and iSCSI environments in place for years now, but for the first time I'm attempting to do an iSCSI boot and the iPXE is having a problem with the conversation with the iSCSI target.

The storage server
Code:
Linux san1srvp01.********.net 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
zfs-0.7.12-1.el7_6.x86_64

The backing block instance
Code:
Disk /dev/zpool1/jane: 8422 MB, 8422687232 bytes, 16450561 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa9a554b4

           Device Boot      Start         End      Blocks   Id  System
/dev/zpool1/jane1              63       80324       40131   12  Compaq diagnostics
/dev/zpool1/jane2   *       80325    16434494     8177085    7  HPFS/NTFS/exFAT

The backing fileio instance
Code:
Disk /zpool1/nas1/Media/c0d0.img: 8422 MB, 8422686720 bytes, 16450560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa9a554b4

                      Device Boot      Start         End      Blocks   Id  System
/zpool1/nas1/Media/c0d0.img1              63       80324       40131   12  Compaq diagnostics
/zpool1/nas1/Media/c0d0.img2   *       80325    16434494     8177085    7  HPFS/NTFS/exFAT

Simplified iSCSI Target configuration. This is an example of block using ZFS zvol, and I've also tried fileio which behaves no differently.
Code:
{
  "fabric_modules": [
    {
      "discovery_enable_auth": true,
      "discovery_password": "********************************",
      "discovery_userid": "san1srvp01",
      "name": "iscsi"
    }
  ],
  "storage_objects": [
    {
      "alua_tpgs": [
        {
          "alua_access_state": 0,
          "alua_access_status": 0,
          "alua_access_type": 3,
          "alua_support_active_nonoptimized": 1,
          "alua_support_active_optimized": 1,
          "alua_support_offline": 1,
          "alua_support_standby": 1,
          "alua_support_transitioning": 1,
          "alua_support_unavailable": 1,
          "alua_write_metadata": 0,
          "implicit_trans_secs": 0,
          "name": "default_tg_pt_gp",
          "nonop_delay_msecs": 100,
          "preferred": 0,
          "tg_pt_gp_id": 0,
          "trans_delay_msecs": 0
        }
      ],
      "attributes": {
        "block_size": 512,
        "emulate_3pc": 1,
        "emulate_caw": 1,
        "emulate_dpo": 1,
        "emulate_fua_read": 1,
        "emulate_fua_write": 1,
        "emulate_model_alias": 1,
        "emulate_rest_reord": 0,
        "emulate_tas": 1,
        "emulate_tpu": 0,
        "emulate_tpws": 0,
        "emulate_ua_intlck_ctrl": 0,
        "emulate_write_cache": 0,
        "enforce_pr_isids": 1,
        "force_pr_aptpl": 0,
        "is_nonrot": 1,
        "max_unmap_block_desc_count": 1,
        "max_unmap_lba_count": 262144,
        "max_write_same_len": 65535,
        "optimal_sectors": 32768,
        "pi_prot_format": 0,
        "pi_prot_type": 0,
        "queue_depth": 128,
        "unmap_granularity": 16,
        "unmap_granularity_alignment": 0,
        "unmap_zeroes_data": 0
      },
      "dev": "/dev/zpool1/jane",
      "name": "jane",
      "plugin": "block",
      "readonly": false,
      "write_back": false,
      "wwn": "8688850f-7200-48a0-ad32-0f4f9397a836"
    }
  ],
  "targets": [
    {
      "fabric": "iscsi",
      "tpgs": [
        {
          "attributes": {
            "authentication": 0,
            "cache_dynamic_acls": 0,
            "default_cmdsn_depth": 64,
            "default_erl": 0,
            "demo_mode_discovery": 1,
            "demo_mode_write_protect": 1,
            "fabric_prot_type": 0,
            "generate_node_acls": 0,
            "login_timeout": 15,
            "netif_timeout": 2,
            "prod_mode_write_protect": 0,
            "t10_pi": 0,
            "tpg_enabled_sendtargets": 1
          },
          "enable": true,
          "luns": [
            {
              "alias": "414d07d6b4",
              "alua_tg_pt_gp_name": "default_tg_pt_gp",
              "index": 2,
              "storage_object": "/backstores/block/jane"
            }
          ],
          "node_acls": [
            {
              "attributes": {
                "dataout_timeout": 3,
                "dataout_timeout_retries": 5,
                "default_erl": 0,
                "nopin_response_timeout": 30,
                "nopin_timeout": 15,
                "random_datain_pdu_offsets": 0,
                "random_datain_seq_offsets": 0,
                "random_r2t_offsets": 0
              },
              "chap_mutual_password": "****************",
              "chap_mutual_userid": "san1srvp01",
              "chap_password": "****************",
              "chap_userid": "jane",
              "mapped_luns": [
                {
                  "alias": "c8ce872be3",
                  "index": 2,
                  "tpg_lun": 2,
                  "write_protect": false
                }
              ],
              "node_wwn": "iqn.1999-10.net.********:jane"
            }
          ],
          "parameters": {
            "AuthMethod": "CHAP,None",
            "DataDigest": "CRC32C,None",
            "DataPDUInOrder": "Yes",
            "DataSequenceInOrder": "Yes",
            "DefaultTime2Retain": "20",
            "DefaultTime2Wait": "2",
            "ErrorRecoveryLevel": "0",
            "FirstBurstLength": "65536",
            "HeaderDigest": "CRC32C,None",
            "IFMarkInt": "2048~65535",
            "IFMarker": "No",
            "ImmediateData": "Yes",
            "InitialR2T": "Yes",
            "MaxBurstLength": "262144",
            "MaxConnections": "1",
            "MaxOutstandingR2T": "1",
            "MaxRecvDataSegmentLength": "8192",
            "MaxXmitDataSegmentLength": "262144",
            "OFMarkInt": "2048~65535",
            "OFMarker": "No",
            "TargetAlias": "LIO Target"
          },
          "portals": [
            {
              "ip_address": "192.168.40.1",
              "iser": false,
              "offload": false,
              "port": 3260
            }
          ],
          "tag": 1
        }
      ],
      "wwn": "iqn.1999-10.net.********:san1srvp01"
    }
  ]
}


The PXE/iPXE/TFTP/HTTP server
Code:
Linux sy1srvp01.********.net 2.6.32-754.10.1.el6.i686 #1 SMP Tue Jan 15 17:33:10 UTC 2019 i686 i686 i386 GNU/Linux
tftp-0.49-8.el6.i686

The iPXE implementation will first hand off to scripts matching host name, uuid, or mac in that order. This is the individual iPXE boot script for this mac mac-0007e90feaf5.ipxe
Code:
set username jane
set password ****************
set reverse-username san1srvp01
set reverse-password ****************
set initiator-iqn iqn.1999-10.net.********:jane
sanboot iscsi:192.168.40.1::::iqn.1999-10.net.********:san1srvp01


The initiator
Code:
Compaq ML370 (Generation 0)
BIOS P17 (12/18/2002)
Processor 866/133 Mhz with 256k Cache
RAM 1 GB
Intel Boot Agent GE v1.2.22

The PXE -> iPXE chain load
Code:
PXE 2.1 Build 084 (WfM 2.0), RPL V1.25

PX->EB: PXE! at 9CC2:0070, entry point at 9CC2:0106
        UNDI code segment 9CC2:0000, data segment 969B:0000 (602-628kB)
        UNDI device is PCI 00:06.0, type DIX+802.3
        602kB free base memory after PXE unload
            
iPXE 1.0.0+ -- Open Source Network Boot Firmware -- http://ipxe.org
Features: DNS HTTP iSCSI TFTP AoE ELF MBOOT PXE bzImage Menu PXEXT

I've used a network trace to follow the iPXE sanboot iSCSI boot process. From a high level it is:

  1. Login Command (CHAP)
  2. Test Unit Ready
  3. Read Capacity(10)
  4. Read(10) <- Failure


The Read Capacity(10) seems to return an unexpected value of 63, if I'm interpreting it correctly. It then attempts a Read(10) at LBA 64 which fails with Logical Block Address Out Of Range - it actually retries it 10 times to no avail. While I expect to find the ultimate problem is with iPXE, I'm not able to explain why the iSCSI target thinks the disk is so small.

Read Capacity(10) - Request
Code:
Frame 27: 114 bytes on wire (912 bits), 114 bytes captured (912 bits)
Ethernet II, Src: Intel_0f:ea:f5 (00:07:e9:0f:ea:f5), Dst: SuperMic_6c:a9:82 (00:25:90:6c:a9:82)
Internet Protocol Version 4, Src: 192.168.4.13, Dst: 192.168.40.1
Transmission Control Protocol, Src Port: cifs (3020), Dst Port: iscsi-target (3260), Seq: 773, Ack: 637, Len: 48
iSCSI (SCSI Command)
Flags: 0xc1, F, R, Attr: Simple
SCSI CDB Read Capacity(10)
    [LUN: 0x0000]
    [Command Set:Direct Access Device (0x00) (Using default commandset)]
    [Response in: 29]
    Opcode: Read Capacity(10) (0x25)
    Control: 0x00

Read Capacity(10) - Response
Code:
Frame 29: 74 bytes on wire (592 bits), 74 bytes captured (592 bits)
Ethernet II, Src: SuperMic_6c:a9:82 (00:25:90:6c:a9:82), Dst: Intel_0f:ea:f5 (00:07:e9:0f:ea:f5)
Internet Protocol Version 4, Src: 192.168.40.1, Dst: 192.168.4.13
Transmission Control Protocol, Src Port: iscsi-target (3260), Dst Port: cifs (3020), Seq: 685, Ack: 821, Len: 8
[2 Reassembled TCP Segments (56 bytes): #28(48), #29(8)]
iSCSI (SCSI Data In)
SCSI Payload (Read Capacity(10) Response Data)
    [LUN: 0x0000]
    [Command Set:Direct Access Device (0x00) (Using default commandset)]
    [SBC Opcode: Read Capacity(10) (0x25)]
    [Request in: 27]
    [Response in: 29]
    LBA: 63 (0 MB)
    Block size in bytes: 512
SCSI Response (Read Capacity(10))
    [LUN: 0x0000]
    [Command Set:Direct Access Device (0x00) (Using default commandset)]
    [SBC Opcode: Read Capacity(10) (0x25)]
    [Request in: 27]
    [Time from request: 0.000252000 seconds]
    [Status: Good (0x00)]

Read(10) - Request
Code:
Frame 32: 114 bytes on wire (912 bits), 114 bytes captured (912 bits)
Ethernet II, Src: Intel_0f:ea:f5 (00:07:e9:0f:ea:f5), Dst: SuperMic_6c:a9:82 (00:25:90:6c:a9:82)
Internet Protocol Version 4, Src: 192.168.4.13, Dst: 192.168.40.1
Transmission Control Protocol, Src Port: cifs (3020), Dst Port: iscsi-target (3260), Seq: 821, Ack: 693, Len: 48
iSCSI (SCSI Command)
Flags: 0xc1, F, R, Attr: Simple
SCSI CDB Read(10)
    [LUN: 0x0000]
    [Command Set:Direct Access Device (0x00) (Using default commandset)]
    [Response in: 33]
    Opcode: Read(10) (0x28)
    Flags: 0x00
    Logical Block Address (LBA): 64
    ...0 0000 = Group: 0x00
    Transfer Length: 4
    Control: 0x00

Read(10) - Response
Code:
Frame 33: 214 bytes on wire (1712 bits), 214 bytes captured (1712 bits)
Ethernet II, Src: SuperMic_6c:a9:82 (00:25:90:6c:a9:82), Dst: Intel_0f:ea:f5 (00:07:e9:0f:ea:f5)
Internet Protocol Version 4, Src: 192.168.40.1, Dst: 192.168.4.13
Transmission Control Protocol, Src Port: iscsi-target (3260), Dst Port: cifs (3020), Seq: 693, Ack: 869, Len: 148
iSCSI (SCSI Response)
Flags: 0x80
SCSI: SNS Info
    [LUN: 0x0000]
    .111 0000 = SNS Error Type: Current Error (0x70)
    Valid: 112
    0... .... = Filemark: False
    .0.. .... = EOM: False
    ..0. .... = ILI: False
    .... 0101 = Sense Key: Illegal Request (0x5)
    Sense Info: 0x00000000
    Additional Sense Length: 10
    Command-Specific Information: 00000000
    Additional Sense Code+Qualifier: Logical Block Address Out Of Range (0x2100)
    Field Replaceable Unit Code: 0x00
    0... .... = SKSV: False
    .000 0000 0000 0000 0000 0000 = Sense Key Specific: 0x000000

The iPXE response to the console
Code:
Could not open SAN device: Input/output error (http://ipxe.org/1d704039
Could not boot image: Input/output error (http://ipxe.org/1d704039

The message logged on the iSCSI target
Code:
Feb 13 09:17:41 san1srvp01 kernel: cmd exceeds last lba 64 (lba 64, sectors 4)

So, if all of this is correct then I'm misunderstanding something rather serious. If it's not then I'm at a loss to know how to get the iSCSI target to reflect the correct size of the device and to access it. I have a lot of other iSCSI initiators, both bare metal and virtual, accessing a dozen different zvols over iSCSI and there's never been a hint of a problem.

-TIA

boot iPXE iso problems

Hello,

I have problems to boot with iso ipxe file in virtual machines (I tried with vmware 15 and Virtual Box with the same results)

I create the iso ipxe file from https://rom-o-matic.eu/ , with default opcions, then I run a vitual machine, and it works.

But when I try to create my own ipxe.iso file (download and compile ipxe project), doesn't work, boot from de hard disk. I checked BIOS settings.

To create my own ipxe.iso file, I use this howto (in Ubuntu 18.04):
https://ipxe.org/download

$ git clone git://git.ipxe.org/ipxe.git
$ cd ipxe/src
$ make
(works withou errors)
$ make bin/ipxe.iso


I need to use a custom ipxe.iso because I have to chache BOOTPS_PORT and BOOTPC_PORT, because I'm using a DHCP which does'nt use the defualt ports.

Thank you in advance!

chainload old Intel

Hello,


I have very old machine with intel nic

Code:
00:0a.0 Ethernet controller [0200]: Intel Corporation 82557/8/9/0/1 Ethernet Pro 100 [8086:1229] (rev 05)
        Subsystem: Compaq Computer Corporation NC3161 Fast Ethernet NIC (embedded, WOL) [0e11:b0c6]
        Flags: bus master, medium devsel, latency 66, IRQ 11
        Memory at 42200000 (32-bit, prefetchable) [size=4K]
        I/O ports at 2000 [size=32]
        Memory at 42100000 (32-bit, non-prefetchable) [size=1M]
        [virtual] Expansion ROM at 0c000000 [disabled] [size=1M]
        Capabilities: <access denied>
        Kernel driver in use: e100
after the start I get the message:
Image may be NSFW.
Clik here to view.
[Image: 20190218_134555.jpg]



Any advice?

boot command hangs

Hi,

I'm running ipxe commit d5c88c0 (Tue Feb 19 2019)

I have the following iPXE script:
Code:
#!ipxe
kernel -n img  http://<webserver>/fedora/28/x86_64/boot/vmlinuz ks=https://<webserver>:8443/kickstart ramdisk_size=8216 pcie_aspm=off ipv6.disable=1 cmdline inst.sshd noverifyssl biosdevname=0 net.ifnames=0 selinux=0
initrd http://<webserver>/fedora/28/x86_64/boot/initrd.img
boot img

I am PXE booting a Solarflare X2522 network card in a Dell R740 server
Code:
d8:00.0 Ethernet controller: Solarflare Communications SFC9250 10/25/40/50/100G Ethernet Controller (rev 01)
...
Product Name: Solarflare XtremeScale X2522 (10G) Adapter

When the card is in PCI Slot 1, SF OptionRom -> PXE -> iPXE -> boot, no problems.
When the card is in PCI Slot 8, SF OptionRom -> PXE -> iPXE -> hangs on 'boot' command!

Code:
iPXE> boot
_
<flashing cursor indefinitely>

Does anyone have any DEBUG= flags I could try (tcp doesn't show anything interesting)
Or knows of any iPXE related problems to this?
Or thinks it could be a Dell BIOS/iDRAC problem? (I'm on BIOS 1.6.12, iDRAC 3.21.26.22)

Any advice welcome Image may be NSFW.
Clik here to view.
Big Grin


Thanks!
Ross

Kernel parameters over HTTP in EFI

Hello,

I am booting ipxe.efi over network and provide it this script:

#!ipxe
dhcp
kernel http://xxx/boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto
initrd http://xxx/boot/fdi-image/initrd0.img

It works fine in BIOS as root kernel command line option is passed in (this is a LiveCD which needs root option to be present). However, when I try this in EFI mode, I am getting kernel panic because it seems like no kernel command line parameters are passed in.

Is there a way to pass in kernel command line parameters in EFI?

By the way I noticed that ipxe.efi works also in BIOS mode, does it mean it is compatible with both BIOS and EFI? Interesting stuff.

can't open '/conf/arch.conf'

try to load debian 9.5 from headless and it gave me this error:
vmlinuz and initrd.img (renamed from initrd) was copied from debian 9.5 netboot.

```
Select an option and press ENTER to boot/install, or F1 for Help
ready.
▒Loading, please wait...live/INITRD_N10.3.2.GZ....
/init: .: line 37: can't open '/conf/arch.conf'
[ 2.296345] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[ 2.296345]
[ 2.305438] CPU: 1 PID: 1 Comm: init Not tainted 4.9.0-7-686 #1 Debian 4.9.110-1
[ 2.312791] Hardware name: To be filled by O.E.M. To be filled by O.E.M./SHARKBAY, BIOS 4.6.5 12/11/2013
[ 2.322215] f2d21f18 c32e3132 f2ccb600 f2cfe040 c3158ac1 f2cfe040 f2ccb680 f2cfe040
[ 2.330081] f2cfe040 f2d21f64 c305c5e0 c368d010 00000200 be0509d1 00000002 f2eaade0
[ 2.337947] f2cfe040 01000154 f2ccba40 c37634c0 f51e05c0 00000000 f2d21f4c f2d21f4c
[ 2.345807] Call Trace:
[ 2.348256] [<c32e3132>] ? dump_stack+0x55/0x73
[ 2.352854] [<c3158ac1>] ? panic+0x94/0x1d8
[ 2.357107] [<c305c5e0>] ? do_exit+0xa00/0xa00
[ 2.361618] [<c305c657>] ? do_group_exit+0x37/0x90
[ 2.366478] [<c305c6c6>] ? SyS_exit_group+0x16/0x20
[ 2.371420] [<c3001a88>] ? do_fast_syscall_32+0x98/0x160
[ 2.376796] [<c359743a>] ? sysenter_past_esp+0x47/0x75
[ 2.382027] Kernel Offset: 0x2000000 from 0xc1000000 (relocation range: 0xc0000000-0xf7ffdfff)
[ 2.390594] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000200
[ 2.390594]

```

How to flash UEFI BIOS with iPXE?

Hello iPXE Forum! Image may be NSFW.
Clik here to view.
Cool


Can iPXE be configured to flash a UEFI BIOS over the network?

My current process:
1. Format a USB drive as FAT32 and copy flash files to USB
2. Boot to UEFI Built in Shell
3. Execute the flash.nsh
4. Reboot system after the UEFI BIOS is flashed
FILES:
afuefi.smc
fdt.smc
flash.nsh
X11SPI8.614

I was able to utilize iPXE sanboot to boot FreeDOS ISOs over a network share to flash legacy BIOS. Now I'm looking for a way to do this to flash UEFI BIOS.

Can you please assist? Is there some way to pull the flash files and flash.nsh script over the network with iPXE and flash the BIOS?

iPXE and calling PHP

I'd like to be able to run a php function to write the MAC and serial to a database. This is working, however when calling the php file ipxe exits and returns to the boot selection menu or boots the hard drive (depending on machine). Ideally I'd like to boot a new computer, call a function to write serial and mac to a database (using php i presume), then be able to continue in the ipxe menu to make a different boot selection.

From my testing it appears as long as php is 'ipxe compliant' and finishes running without error, it will return to ipxe menu, however because the php is running its own functions ipxe crashes with an error.

menu.ipxe
Code:
:prestage
echo Adding following details:
echo serial: ${smbios/serial}
echo mac: ${netX/mac}
sleep 3
# chain --replace --autofree http://172.16.0.17/prestage/index.php?serial=${smbios/serial}&mac=${netX/mac}
kernel http://172.16.0.17/prestage/index.php?serial=${smbios/serial}&mac=${netX/mac}
goto start

index.php - example code 'ipxe compliant' - returns to ipxe successfully
Code:
<?php
header ( "Content-type: text/plain" );
echo "#!ipxe \n";
echo "echo Dan is the man \n";
echo "sleep 5 \n";
?>

index.php - example code - breaks with error
Code:
<?php
header ( "Content-type: text/plain" );
echo "#!ipxe \n";
$serial = $_REQUEST['serial'];
$mac    = $_REQUEST['mac'];
echo "echo Dan is the man \n";
echo "sleep 5 \n";
?>

index.php - actual code works for purposes of writing database but crash exits
Code:
<?php
include "conn.php";
$serial = $_REQUEST['serial'];
$mac    = $_REQUEST['mac'];
if ($serial !="") {
    $sql = "insert into prestage (serial, mac) values ('$serial', '$mac')";
    mysqli_query($conn, $sql);
    };
    
?>

Do I need to compile ipxe binary with a different option?

loading kernel with secure boot

Hello,
I'm trying to build a iPXE efi file to boot a specific network image. I build my own efi file and included a sript pointing to the kernel and initrd on the network.

If I try to load the kernel I get a Exec format error, this only happens if secureboot is enabled. I tried this using http and nfs with the same results.

The Kernel is signed correctly, I build a bootable USB stick using the exact same kernel and initrd and it works with secure boot.

Do I need to load the kernel in a special way if secureboot is enabled?

HTTPS support on WIMBOOT

Hi

I could boot into WinPE environment with WIMBOOt on HTTP protocol
But it will display "Could not start download:Operation not supported (http://ipxe.org/3c092083)" when I change to HTTS protocol (change wimboot download URL from http to https)
For example :
Original : kernel http://xxxxxx/wimboot
Current : kernel https://xxxxxx/wimboot

I had add the web certificate during iPXE built.
Might I know if it is caused by WIMBOOT is only support HTTP protocol but not HTTPS ?

Thanks.

Possible bug in rtc_entropy.c

Hello,

I have been working with iPXE for a special project and ran into issues with Hyper-V Gen-1 VMs. I read through the forum and saw the history behind this and noted that the code to detect a broken RTC was added to mainline code some time ago. I instrumented the code and found that on newer versions of Hyper-V that test passes and the RTC code attempts to instantiate DRBG and fails when it calls get_noise. Tracing through I found that the process runs along fine until rtc_sample where it just freezes. Looking at the Assembly code in rtc_sample I noticed something odd. The current mainline code has two jz instructions that reference the label :1b, but that label does not exist in the code fragment. I'm bit sure why the assembler doesn't complain about it, but I suppose it leaves it for the linker to deal with and the linker ignores the issue because the code is embedded. In any event looking at the code I also noticed there are two identical labels :1 present. Overall it looks like some cutting and pasting may have resulted in assembly code that has flaws. I changed the second label to :2 leaving the first as :1 and then targeted the first jz at :1 an the second at :2 and the code started to function and the VMs could boot.

Perhaps this could be reviewed and updated if my assumptions are correct ?

iPXE boot Ubuntu 18.04 LUN

Hi Guys,

iPXE noob starting out and I’m trying to use iPXE to boot an iSCSI LUN which contains an installed Ubuntu 18.04 LTS O/S, the LUN appears to boot since it shows the Ubuntu Grub menu but then drops out to BusyBox with a few errors as below.

Any idea what I’m doing wrong here?

The steps I took were as follows:

(A) Use KVM (proxmox) to map the empty iSCSI LUN as single disk to a VM (UEFI 64 bit)
(B) Install Ubuntu 18.04 LTS to the empty LUN
© Check Ubuntu is installed to the VM as expected then stop the VM and detach the LUN from the VM.
(D) Boot a different VM (with only a simple 1GB disk attached but set to Network Boot) to iPXE and choose the following menu option:

Code:
:iscsi-boot-ubuntu-18-04-lts
set initiator-iqn [iSCSI-TARGET IQN]
set root-path iscsi:[iSCSI-TARGET-IP-ADDRESS]:::1:${initiator-iqn}
set keep-san 1
echo Booting Ubuntu 18.04.2 LTS (Linux ${arch}) for ${initiator-iqn}
sanboot ${root-path} || goto failed
goto start

(E) iPXE boots the LUN to the Ubuntu "GNU Grub version 2.02" menu and I select “Ubuntu” to start Ubuntu

(F) After a minute or so, the following errors are shown in the terminal and I'm dropped to a BusyBox (initramfs) prompt:

Code:
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Volume group "ubuntu-vg" not found
Cannot process volume group ubuntu-vg
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Volume group "ubuntu-vg" not found
Cannot process volume group ubuntu-vg
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Volume group "ubuntu-vg" not found
Cannot process volume group ubuntu-vg
Gave up waiting for suspend/resume device
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  Volume group "ubuntu-vg" not found
  Cannot process volume group ubuntu-vg
Gave up waiting waiting for root file system device.  Common problems:
- Boot args (cat /proc/cmdline)
  - Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT!   /dev/mapper/ubuntu--vg-root does not exist.   Dropping to a shell!


BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3.1) built-in shell (ash)
Enter 'help' for a list of built-in commads.

(initramfs) _


Thanks!

arm64 USB NIC Support

Hi,

since we now have working UEFI on the Raspberry Pi, I thought that I might try using iPXE on it. The NIC that the Raspberry Pi is using (https://dox.ipxe.org/smsc95xx_8c.html#details) is supported by iPXE, and so is 64-bit ARM EFI support. And, thankfully, I've got it to boot it! But, only with SNP only networking, which means that booting iPXE works, but it can't find the network devices. So I've included the relevant drivers:

Code:
make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi

Which fails:

Code:
edk2@9255f14e62f5:/home/ipxe$ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi
  [PARSEROM]
  [DEPS] drivers/usb/uhci.c
  [BUILD] bin-arm64-efi/uhci.o
  [BUILD] bin-arm64-efi/uhci.ids.o
  [AR] bin-arm64-efi/blib.a
aarch64-linux-gnu-ar: creating bin-arm64-efi/blib.a
  [VERSION] bin-arm64-efi/version.ncm--ecm--snp--smsc95xx.efi.o
  [LD] bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi.tmp
bin-arm64-efi/blib.a(uhci.o): In function `uhci_root_disable':
/home/ipxe/drivers/usb/uhci.c:1203: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:1205: undefined reference to `outw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_root_enable':
/home/ipxe/drivers/usb/uhci.c:1161: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:1163: undefined reference to `outw'
/home/ipxe/drivers/usb/uhci.c:1166: undefined reference to `outw'
/home/ipxe/drivers/usb/uhci.c:1171: undefined reference to `outw'
/home/ipxe/drivers/usb/uhci.c:1178: undefined reference to `inw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_root_speed':
/home/ipxe/drivers/usb/uhci.c:1224: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:1249: undefined reference to `outw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_stop':
/home/ipxe/drivers/usb/uhci.c:104: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:106: undefined reference to `outw'
/home/ipxe/drivers/usb/uhci.c:112: undefined reference to `inw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_reset':
/home/ipxe/drivers/usb/uhci.c:144: undefined reference to `outw'
/home/ipxe/drivers/usb/uhci.c:150: undefined reference to `inw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_root_poll':
/home/ipxe/drivers/usb/uhci.c:1285: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:1292: undefined reference to `outw'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_bus_open':
/home/ipxe/drivers/usb/uhci.c:1342: undefined reference to `outl'
bin-arm64-efi/blib.a(uhci.o): In function `uhci_run':
/home/ipxe/drivers/usb/uhci.c:87: undefined reference to `inw'
/home/ipxe/drivers/usb/uhci.c:89: undefined reference to `outw'
aarch64-linux-gnu-ld: bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi.tmp: hidden symbol `inw' isn't defined
aarch64-linux-gnu-ld: final link failed: Bad value
Makefile.housekeeping:1190: recipe for target 'bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi.tmp' failed
make: *** [bin-arm64-efi/ncm--ecm--snp--smsc95xx.efi.tmp] Error 1
rm bin-arm64-efi/version.ncm--ecm--snp--smsc95xx.efi.o

Looks like it tries to call outw, inw and outl from sys/io.h, which is X86 only (direct assembler calls). If someone could port this to aarch64 it might actually work. I am a frontend dev, so I myself won't be able to fix this sadly. Would anyone be able to take a look at this? It only seems to be these 3 functions that are X86 only ...

Also, see the GitHub issue for some more info if you could help!

trying to boot openbsd image

Hello,

i try with ipxe(latest from git) to boot an openbsd6.4 image, from a Debian machine with tftpd and http server, the image, which usually i put on a usb pen drive and it boots successfull, but if i try the same image to boot from ipxe, openbsd stops with a kernel panic cause not found of the root device which is usally /dev/wd*.

i tried many different configuration but none of them was able to successfull boot openbsd.
in my real_boot_script.txt i have:
Code:
:openbsd_x64
#kernel memdisk root=/dev/ram0
set memdisk http://X.X.X.X/memdisk
set src http://X.X.X.X/openbsd-image.img
imgfree
initrd ${src}
chain ${memdisk} harddisk raw
exit

:openbsd_exit
clear menu
exit 0

the output from fdisk of the image:
sudo fdisk -l openbsd-image.img

Code:
Disk openbsd-image.img: 244,5 MiB, 256376832 bytes, 500736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start    End Sectors   Size Id Type
openbsd-image.img4  *       32 500735  500704 244,5M a6 OpenBSD

please, can someone give me some advice what is wrong.
Thanks

boot using your example

Hi,
I am newbie in iPXE, so I want to start from somewhere.
I have read documentation ( which is quite not clear for me, btw)

You mentioned your demo in many places, in example here:
http://ipxe.org/cmdline

I have VirtualBox with iPXE built in.
from iPXE prompt I typed in:
dhcp - got IP
route - see right route
show dns - ok
chain http://boot.ipxe.org/demo/boot.php
the optput is:
vmlinuz-3.16.0-rc4... ok
could not select: exec format error (http://ipxe.org/2e008001)
Could not boot: Exec format error (http://ipxe.org/2e008001)

I have try to build 64b as well as 32b machines, no difference

Please help me to resolve the issue or point me to any working example.
It is important for me to find the right solution for booting several physical boxes which will have built-in iPXE support.

Great thanks
Luk
Viewing all 1484 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>