All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Linux Files needed for PXE network boot
@ 2018-04-20  9:21 Hussin, Mohamad Noor Alim
  0 siblings, 0 replies; 7+ messages in thread
From: Hussin, Mohamad Noor Alim @ 2018-04-20  9:21 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]

Maybe grub file bootx64.efi do not have network module.  You can try to use grub provided by Ubuntu http://archive.ubuntu.com/ubuntu/dists/trusty/main/uefi/grub2-amd64/current/grubnetx64.efi.signed

Or  build your own grub that build-in with network capability.

In your root tftp server create a grub folder with grub.cfg.
/tftpboot/grub/grub.cfg

Your grub.cfg should look like this
=============================
Set timeout 5

menuentry "core-image-sato" {
    linux image/bzImage
    initrd image/initrd
}

==============================

Put your image in tftp root
/tftpboot/image/bzImage
/tftpboot/image/initrd

If you want to put your rootfs in NFS. You need to include network module in kernel and  extract your rootfs for example to /srv/rootfs.  Then your grub.cfg should be like this

===================== grub.cfg ============================================
Set timeout 5

menuentry "core-image-sato-NFS" {
    linux image/bzImage root=/dev/nfs rw nfsroot=192.168.1.1:/srv/rootfs,hard,tcp,intr ip=dhcp
    initrd image/initrd
}

========================================================================


Regards,
Alim Hussin


[-- Attachment #2: Type: text/html, Size: 5446 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Linux Files needed for PXE network boot
  2018-04-20  5:47       ` Raymond Yeung
@ 2018-04-22  5:23         ` Raymond Yeung
  0 siblings, 0 replies; 7+ messages in thread
From: Raymond Yeung @ 2018-04-22  5:23 UTC (permalink / raw)
  To: William Mills, yocto

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Thanks for all who extended helping hands.  I finally resolved my issues, and the target PXE-boot'ed up.  I'd like to provide some updates, for reference to someone that may run into this in the future.


I'm able to use legacy mode (in BIOS) instead of UEFI mode.  While I haven't worked out the canonical form, it seems two things are important on BIOS side - there are a number of options that have UEFI vs. legacy choices.  Select "legacy" mode for all of them.  This is in the "CSM & Option ROM" Advanced setting.  Some of the logging options under "Event Logs" tab might have helped turned on more diagnostic messages.


After the above adjustment, the error messages on the BIOS console guided me to pick up missing files, including ldlinux.c32, libutil.c32, lib com.c32 that are not mentioned anywhere that I looked so far.


Now, I'm onto investigating how I could (re)create partitions on SSD, load the kernel there, and boot from that.


Raymond

[-- Attachment #2: Type: text/html, Size: 1816 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Linux Files needed for PXE network boot
  2018-04-19 20:56     ` William Mills
@ 2018-04-20  5:47       ` Raymond Yeung
  2018-04-22  5:23         ` Raymond Yeung
  0 siblings, 1 reply; 7+ messages in thread
From: Raymond Yeung @ 2018-04-20  5:47 UTC (permalink / raw)
  To: William Mills, yocto

[-- Attachment #1: Type: text/plain, Size: 5826 bytes --]

Thanks William.  I think I need to backtrack at least 1 step from the files used.  I've been stuck at tftp of 1st stage boot loader (e.g. pxelinux.0, or grub).  If I set it up to use pxelinux.0, on client side, I only saw successful download of this file, and then it failed due to "Boot option loading failed".  On the server side, I didn't see any more access beyond this tftp.


If I set it up to use bootx64.efi, I could see the client side boot to grub and then got stuck there.  Again, no further activity on server side beyond such tftp.  The client side doesn't seem to even come back for more files (e.g. the pxelinux.cfg/default).  Below is my /etc/dhcp/dhcpd.conf.  Please someone review to see if I did something wrong.  The DHCP server has 192.168.1.1 IP address, same as TFTP server; they both are on the same machine.


authoritative;

allow booting;

allow bootp;

default-lease-time 3600;

max-lease-time 7200;


subnet 192.168.1.0 netmask 255.255.255.0 {

  range 192.168.1.10 192.168.1.20;

  next-server 192.168.1.1;

#  filename "pxelinux.0";

  filename "bootx64.efi";

}


option space PXE;

option PXE.discovery-control code 6 = unsigned integer 8;


class "PXE" {

#   match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";

    option vendor-class-identifier "PXEClient";

    option tftp-server-name "192.168.1.1";

    option bootfile-name "bootx64.efi";

    vendor-option-space PXE;

    option PXE.discovery-control 11;

}


Thanks,

Raymond



________________________________
From: William Mills <wmills@ti.com>
Sent: Thursday, April 19, 2018 1:56 PM
To: Raymond Yeung; yocto@yoctoproject.org
Subject: Re: [yocto] Linux Files needed for PXE network boot

Robert,

I assume no one responded to you because you did not supply enough
information to understand your situation.  (You don't specify what HW
you are using, version of Yocto Project, what DHCP server, etc.)

From the second message I can tell you are using a X86_64 based
platform.  Is this a commercial PC or a developer board (Minnow etc)?

If I were you I would focus on the UEFI mode as you are closer there.

I am not an X86 UEFI expect but ...


On 04/18/2018 09:38 PM, Raymond Yeung wrote:
> Another thing I haven't tried is to set up NFS.  Can we simply specify
> ONE file (similar to .hddimg) that could be tftp over to target, and
> expect it to boot up?  Could this be the cause of my problem?
>

Yes, Grub should be able to go back to the TFTP server to get more files.

Alternatively, yes, it is possible (but a bit ugly) to create one file
for the TFTP server that has everything.

It has been 4 years ago now but I did play with Minnow board UEFI and
GRUB via netboot.

What I got working was a single fat Grub binary with kernel and initram
disk included.  I did this because the UEFI on minnow at that time had
trouble using the ethernet from grub but could reliably transfer a large
file before the handoff.  I would hope this is now fixed on minnow and
commercial PCs would not have this issue.

Anyway if you want to see what I did the files are here:
http://arago-project.org/files/short-term/misc/make-netbootia32.tar.bz2

I would not recommend using these binaries (They are 32bit UEFI and old)
but you can see what I did looking at the README.txt file.

>
>
> ------------------------------------------------------------------------
> *From:* Raymond Yeung <rksyeung@hotmail.com>
> *Sent:* Wednesday, April 18, 2018 6:33 PM
> *To:* yocto@yoctoproject.org
> *Subject:* Re: Linux Files needed for PXE network boot
>
>
> I've yet to receive any response to my post below.  I've gone through
> fair amount of experimentation to get my board downloaded successfully
> the first-stage boot loader.  I'd tried pxelinux.0 for legacy BIOS and
> bootx64.efi (also generated in build process) to work with UEFI on
> client side.  However, no luck going any further so far.  Debugging the
> client side is rather cryptic (black box).
>
>
> I'm just wondering if it's because of a missing kick-start file
> (ks.conf)?  I've tried "kernel images/<kernel>.hddimg" (was careful in
> specifying the path relative /tftpboot root directory), also
> bzImage.bin, and the combo of vmlinuz + initrd files.  Neither one of
> the works so far.  When I tried UEFI with bootx64.efi, the client side
> stops at GRUB, complaining "error: no such device:
> ()/EFI/BOOT/grub.cfg."  When I tried legacy BIOS with pxelinux.0, I got
> "PXE-E16: No offer received.  ERROR: Boot option loading failed".
>
>
> Any idea anyone?
>
>

I believe the () in ()/EFI/BOOT/grub.cfg should have been (tftp) to make
grub go back to the TFTP server for the config file.  Something is not
right in your setup or UEFI to Grub hand-off.  Can you get a Grub shell
prompt?  If so you should be able to debug from there.

Again see the README.txt in the file I referenced above.  It shows how I
configured grub.

>
> ------------------------------------------------------------------------
> *From:* Raymond Yeung <rksyeung@hotmail.com>
> *Sent:* Monday, April 16, 2018 12:42 PM
> *To:* yocto@yoctoproject.org
> *Subject:* Linux Files needed for PXE network boot
>
> I've a .hddimg image bootable from USB thumb drive.  As part of the
> boot-up, I also could invoke "Serial Install" to transfer such an image
> to SSD, such that in the next round, I could boot from SSD instead.
>
> What are the files and where do I get them (relative to where I find
> .hddimg) from the build tree, and install them on the tftp server, in
> order to support PXE network booting?  Also, what mechanism do people
> use to transfer this after PXE boot into the SSD, making it bootable?
>
> Raymond
>
>

[-- Attachment #2: Type: text/html, Size: 9517 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Linux Files needed for PXE network boot
  2018-04-19  1:38   ` Raymond Yeung
@ 2018-04-19 20:56     ` William Mills
  2018-04-20  5:47       ` Raymond Yeung
  0 siblings, 1 reply; 7+ messages in thread
From: William Mills @ 2018-04-19 20:56 UTC (permalink / raw)
  To: Raymond Yeung, yocto

Robert,

I assume no one responded to you because you did not supply enough
information to understand your situation.  (You don't specify what HW
you are using, version of Yocto Project, what DHCP server, etc.)

From the second message I can tell you are using a X86_64 based
platform.  Is this a commercial PC or a developer board (Minnow etc)?

If I were you I would focus on the UEFI mode as you are closer there.

I am not an X86 UEFI expect but ...


On 04/18/2018 09:38 PM, Raymond Yeung wrote:
> Another thing I haven't tried is to set up NFS.  Can we simply specify
> ONE file (similar to .hddimg) that could be tftp over to target, and
> expect it to boot up?  Could this be the cause of my problem?
>

Yes, Grub should be able to go back to the TFTP server to get more files.

Alternatively, yes, it is possible (but a bit ugly) to create one file
for the TFTP server that has everything.

It has been 4 years ago now but I did play with Minnow board UEFI and
GRUB via netboot.

What I got working was a single fat Grub binary with kernel and initram
disk included.  I did this because the UEFI on minnow at that time had
trouble using the ethernet from grub but could reliably transfer a large
file before the handoff.  I would hope this is now fixed on minnow and
commercial PCs would not have this issue.

Anyway if you want to see what I did the files are here:
http://arago-project.org/files/short-term/misc/make-netbootia32.tar.bz2

I would not recommend using these binaries (They are 32bit UEFI and old)
but you can see what I did looking at the README.txt file.

> 
> 
> ------------------------------------------------------------------------
> *From:* Raymond Yeung <rksyeung@hotmail.com>
> *Sent:* Wednesday, April 18, 2018 6:33 PM
> *To:* yocto@yoctoproject.org
> *Subject:* Re: Linux Files needed for PXE network boot
>  
> 
> I've yet to receive any response to my post below.  I've gone through
> fair amount of experimentation to get my board downloaded successfully
> the first-stage boot loader.  I'd tried pxelinux.0 for legacy BIOS and
> bootx64.efi (also generated in build process) to work with UEFI on
> client side.  However, no luck going any further so far.  Debugging the
> client side is rather cryptic (black box).
> 
> 
> I'm just wondering if it's because of a missing kick-start file
> (ks.conf)?  I've tried "kernel images/<kernel>.hddimg" (was careful in
> specifying the path relative /tftpboot root directory), also
> bzImage.bin, and the combo of vmlinuz + initrd files.  Neither one of
> the works so far.  When I tried UEFI with bootx64.efi, the client side
> stops at GRUB, complaining "error: no such device:
> ()/EFI/BOOT/grub.cfg."  When I tried legacy BIOS with pxelinux.0, I got
> "PXE-E16: No offer received.  ERROR: Boot option loading failed".
> 
> 
> Any idea anyone?
> 
> 

I believe the () in ()/EFI/BOOT/grub.cfg should have been (tftp) to make
grub go back to the TFTP server for the config file.  Something is not
right in your setup or UEFI to Grub hand-off.  Can you get a Grub shell
prompt?  If so you should be able to debug from there.

Again see the README.txt in the file I referenced above.  It shows how I
configured grub.

> 
> ------------------------------------------------------------------------
> *From:* Raymond Yeung <rksyeung@hotmail.com>
> *Sent:* Monday, April 16, 2018 12:42 PM
> *To:* yocto@yoctoproject.org
> *Subject:* Linux Files needed for PXE network boot
>  
> I've a .hddimg image bootable from USB thumb drive.  As part of the
> boot-up, I also could invoke "Serial Install" to transfer such an image
> to SSD, such that in the next round, I could boot from SSD instead.
> 
> What are the files and where do I get them (relative to where I find
> .hddimg) from the build tree, and install them on the tftp server, in
> order to support PXE network booting?  Also, what mechanism do people
> use to transfer this after PXE boot into the SSD, making it bootable?
> 
> Raymond
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Linux Files needed for PXE network boot
  2018-04-19  1:33 ` Raymond Yeung
@ 2018-04-19  1:38   ` Raymond Yeung
  2018-04-19 20:56     ` William Mills
  0 siblings, 1 reply; 7+ messages in thread
From: Raymond Yeung @ 2018-04-19  1:38 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]

Another thing I haven't tried is to set up NFS.  Can we simply specify ONE file (similar to .hddimg) that could be tftp over to target, and expect it to boot up?  Could this be the cause of my problem?


________________________________
From: Raymond Yeung <rksyeung@hotmail.com>
Sent: Wednesday, April 18, 2018 6:33 PM
To: yocto@yoctoproject.org
Subject: Re: Linux Files needed for PXE network boot


I've yet to receive any response to my post below.  I've gone through fair amount of experimentation to get my board downloaded successfully the first-stage boot loader.  I'd tried pxelinux.0 for legacy BIOS and bootx64.efi (also generated in build process) to work with UEFI on client side.  However, no luck going any further so far.  Debugging the client side is rather cryptic (black box).


I'm just wondering if it's because of a missing kick-start file (ks.conf)?  I've tried "kernel images/<kernel>.hddimg" (was careful in specifying the path relative /tftpboot root directory), also bzImage.bin, and the combo of vmlinuz + initrd files.  Neither one of the works so far.  When I tried UEFI with bootx64.efi, the client side stops at GRUB, complaining "error: no such device: ()/EFI/BOOT/grub.cfg."  When I tried legacy BIOS with pxelinux.0, I got "PXE-E16: No offer received.  ERROR: Boot option loading failed".


Any idea anyone?


________________________________
From: Raymond Yeung <rksyeung@hotmail.com>
Sent: Monday, April 16, 2018 12:42 PM
To: yocto@yoctoproject.org
Subject: Linux Files needed for PXE network boot

I've a .hddimg image bootable from USB thumb drive.  As part of the boot-up, I also could invoke "Serial Install" to transfer such an image to SSD, such that in the next round, I could boot from SSD instead.

What are the files and where do I get them (relative to where I find .hddimg) from the build tree, and install them on the tftp server, in order to support PXE network booting?  Also, what mechanism do people use to transfer this after PXE boot into the SSD, making it bootable?

Raymond

[-- Attachment #2: Type: text/html, Size: 3718 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Linux Files needed for PXE network boot
  2018-04-16 19:42 Raymond Yeung
@ 2018-04-19  1:33 ` Raymond Yeung
  2018-04-19  1:38   ` Raymond Yeung
  0 siblings, 1 reply; 7+ messages in thread
From: Raymond Yeung @ 2018-04-19  1:33 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]

I've yet to receive any response to my post below.  I've gone through fair amount of experimentation to get my board downloaded successfully the first-stage boot loader.  I'd tried pxelinux.0 for legacy BIOS and bootx64.efi (also generated in build process) to work with UEFI on client side.  However, no luck going any further so far.  Debugging the client side is rather cryptic (black box).


I'm just wondering if it's because of a missing kick-start file (ks.conf)?  I've tried "kernel images/<kernel>.hddimg" (was careful in specifying the path relative /tftpboot root directory), also bzImage.bin, and the combo of vmlinuz + initrd files.  Neither one of the works so far.  When I tried UEFI with bootx64.efi, the client side stops at GRUB, complaining "error: no such device: ()/EFI/BOOT/grub.cfg."  When I tried legacy BIOS with pxelinux.0, I got "PXE-E16: No offer received.  ERROR: Boot option loading failed".


Any idea anyone?


________________________________
From: Raymond Yeung <rksyeung@hotmail.com>
Sent: Monday, April 16, 2018 12:42 PM
To: yocto@yoctoproject.org
Subject: Linux Files needed for PXE network boot

I've a .hddimg image bootable from USB thumb drive.  As part of the boot-up, I also could invoke "Serial Install" to transfer such an image to SSD, such that in the next round, I could boot from SSD instead.

What are the files and where do I get them (relative to where I find .hddimg) from the build tree, and install them on the tftp server, in order to support PXE network booting?  Also, what mechanism do people use to transfer this after PXE boot into the SSD, making it bootable?

Raymond

[-- Attachment #2: Type: text/html, Size: 2829 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Linux Files needed for PXE network boot
@ 2018-04-16 19:42 Raymond Yeung
  2018-04-19  1:33 ` Raymond Yeung
  0 siblings, 1 reply; 7+ messages in thread
From: Raymond Yeung @ 2018-04-16 19:42 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 502 bytes --]

I've a .hddimg image bootable from USB thumb drive.  As part of the boot-up, I also could invoke "Serial Install" to transfer such an image to SSD, such that in the next round, I could boot from SSD instead.

What are the files and where do I get them (relative to where I find .hddimg) from the build tree, and install them on the tftp server, in order to support PXE network booting?  Also, what mechanism do people use to transfer this after PXE boot into the SSD, making it bootable?

Raymond

[-- Attachment #2: Type: text/html, Size: 942 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-23 11:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20  9:21 Linux Files needed for PXE network boot Hussin, Mohamad Noor Alim
  -- strict thread matches above, loose matches on Subject: below --
2018-04-16 19:42 Raymond Yeung
2018-04-19  1:33 ` Raymond Yeung
2018-04-19  1:38   ` Raymond Yeung
2018-04-19 20:56     ` William Mills
2018-04-20  5:47       ` Raymond Yeung
2018-04-22  5:23         ` Raymond Yeung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.