GithubHelp home page GithubHelp logo

pipxe's Introduction

piPXE - iPXE for the Raspberry Pi

Build Release

piPXE is a build of the iPXE network boot firmware for the Raspberry Pi.

Quick start

  1. Download sdcard.img and write it onto any blank micro SD card using a tool such as dd or Etcher.

  2. Insert the micro SD card into your Raspberry Pi.

  3. Power on your Raspberry Pi.

Within a few seconds you should see iPXE appear and begin booting from the network:

Screenshot

Building from source

To build from source, clone this repository and run make. This will build all of the required components and eventually generate the SD card image sdcard.img.

You will need various build tools installed, including a cross-compiling version of gcc for building AArch64 binaries.

Fedora build tools:

sudo dnf install -y binutils gcc gcc-aarch64-linux-gnu \
                    git-core iasl libuuid-devel make \
                    mtools perl python subversion xz-devel

Ubuntu build tools:

sudo apt install -y build-essential gcc-aarch64-linux-gnu \
                    git iasl lzma-dev mtools perl python \
                    subversion uuid-dev

How it works

The SD card image contains:

The Raspberry Pi has a somewhat convoluted boot process in which the VC4 GPU is responsible for loading the initial executable ARM CPU code. The flow of execution is approximately:

  1. The GPU code in the onboard boot ROM loads bootcode.bin from the SD card.
  2. The GPU executes bootcode.bin and loads RPI_EFI.fd from the SD card.
  3. The GPU allows the CPU to start executing RPI_EFI.fd.
  4. The CPU executes RPI_EFI.fd and loads bootaa64.efi from the SD card.
  5. The CPU executes bootaa64.efi (i.e. iPXE) to boot from the network.

Licence

Every component is under an open source licence. See the individual subproject licensing terms for more details:

pipxe's People

Contributors

mcb30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pipxe's Issues

Integrating iPXE driver binary into https://github.com/tianocore/edk2-non-osi for Pi?

Hi Michael,

It's been a while since we last chatted (GSoC 2012? 2011?).

First of all big thanks for your fixes/cleanups to the Tiano DWC2 driver. And thanks for pipxe.

How do you feel about checking in a known iPXE build as part of the edk2 tree for Pi 3/4? Today we check-in the Trusted Firmware prebuilts into https://github.com/tianocore/edk2-non-osi (TF-A is OSS, but it's not Tiano code, and as a binary blob that's where it goes).

Distributing iPXE would mean supporting a wider set of USB-based NICs on Pi 3 and Pi 4 (including the onboard NIC on Pi 3). This would remove the need to maintain a separate pipxe repo here.

A

Build Issue: no bootable option or device was found on re-built image

Hi,

When I flash a sd card with the prebuilt image everything works as expected, my pi boots through in the iPXE environment and starts looking for something to connect to on net0.

After I spun up a clean Ubuntu 20.04 environment, cloned and rebuilt the image from scratch (appears to be a clean build, no build errors reports, etc. and the generated sdcard.img is the same size as the pre-built image, however I get the following:

BdsDxe: No bootable option or device was found.
BdsDxe: Press any key to enter the Boot Manager Menu.

Pressing any key doesn't go any further i.e. no boot manager menu.

Would appreciate any thoughts...

Thanks

Shaun

iSCSI

Hi!

I tried it on a Rpi3b, but I did not manage to boot from iSCSI.

What are the pre requirements to be configured to get this to work?

I configured the iqn but the next menu "add attempt" just returns
a page which only shows "MAC Selection" on the top and "Esx=Exit"
on the bottom but nothings to select.

Failed to build from source

Was building on:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.04
DISTRIB_CODENAME=hirsute
DISTRIB_DESCRIPTION="Ubuntu 21.04"

Building error log part:

  [BUILD] bin-arm64-efi/flexboot_nodnic.o
drivers/infiniband/flexboot_nodnic.c: In function ‘flexboot_nodnic_create_qp’:
drivers/infiniband/flexboot_nodnic.c:368:53: error: implicit conversion from ‘enum ib_queue_pair_type’ to ‘nodnic_queue_pair_type’ [-Werror=enum-conversion]
  368 |  status = nodnic_port_create_qp(&port->port_priv, qp->type,
      |                                                   ~~^~~~~~
drivers/infiniband/flexboot_nodnic.c: In function ‘flexboot_nodnic_destroy_qp’:
drivers/infiniband/flexboot_nodnic.c:409:45: error: implicit conversion from ‘enum ib_queue_pair_type’ to ‘nodnic_queue_pair_type’ [-Werror=enum-conversion]
  409 |  nodnic_port_destroy_qp(&port->port_priv, qp->type,
      |                                           ~~^~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile.housekeeping:946: bin-arm64-efi/flexboot_nodnic.o] Error 1
make[1]: Leaving directory '/var/local/acp/pipxe/ipxe/src'
make: *** [Makefile:46: ipxe/src/bin-arm64-efi/rpi.efi] Error 2

Question: WiFi Support?

Hi,

I was hoping this would facilitate a WiFi approach but doesn't appear to be the case. Dropping into the iPXE command line and running an 'ifstat' only shows the physical network interface (net0) as detected. Any thoughts on adding/supporting the wifi interface?

Cheers,

Shaun

Headless boot issue with absent monitor

I'm using pipxe with MAAS images and cloud-init to have a bunch of centrally managed Pies, just like I do with x86. After patching EDK2 to not limit RAM to 3GB, and to auto-boot from the network device (instead of waiting for manual input), there is another issue left for headless boot: absent monitor. Either the UEFI bootloader from EDK2 or pipxe doesn't like an absent monitor and appears to freeze (I can ping the machine for about 5 seconds and then it goes offline, so it appears to be happening between the UEFI and pipxe phases). At first, I worked around it by using a dummy HDMI plug, but later found out that it can be worked around in software by adding the following into config.txt (which in my case resides on the TFTP server):

hdmi_force_hotplug=1
hdmi_safe=1

I successfully tested the workaround it on a RPi4B with 2G and 8G of RAM.

Unfortunately I don't know whether the issue is triggered in the UEFI bootloader or in pipxe, so I'm not sure where to report it.

Black screen with Raspbian's kernel8.img

Thanks for pipxe, it sounds awesome!
It booted on the first try, but:

  • It takes 3 minutes to load the kernel/initrd via TFTP, is http faster?
  • The kernel8.img from the latest Raspbian Buster just shows a black screen after it loads. The other Raspbian kernels show Exec format error.

Which kernel is appropriate to boot an rpi3 with pipxe?

svn no longer works with github.com for raspberrypi/firmware

first discovered while working with netboot.xyz (issue posted at netbootxyz/netboot.xyz#1421)

the makefile needs a little rework around https://github.com/ipxe/pipxe/blob/master/Makefile#L29
related github blog post on svn deprecation: https://github.blog/2023-01-20-sunsetting-subversion-support/

currently diving down the rabbit hole of some fixes; but i believe the sparse-checkout is the way to go
Edit: i ended up updating the sub-modules to reflect what the netboot.xyz has done; i've a WIP pull request on my fork; need to have it output the sdcard images so it can be tested by more than me: vanillaSprinkles#1
edit2: used that branch to output a release of img and zip's; extracted both zip files and did a simple diff on the 2x folders; below are results (i do not yet have a means of testing them booting in an rpi):

find sdcard_rpi{3,4} -type f | sed -r 's/^sdcard_rpi[34]//g' | sort -u  | xargs -I{} diff sdcard_rpi3/{} sdcard_rpi4/{}
Binary files sdcard_rpi3//RPI_EFI.fd and sdcard_rpi4//RPI_EFI.fd differ





[ below can be ignored since pull request has been made in my own branch and am testing it out ]
my current fix includes (will make a pull request once I get this ironed out):

(top of file)

FW_REPO_URL     := https://github.com/raspberrypi/firmware
FW_BRANCH       := stable
FW_SUBDIR       := boot

(submodules to handle later gcc versions aborting build - this is not related to the svn fix, but is a hack to get the current state building)

submodules :
        git submodule update --init --recursive
        sed -i -r 's@(-nostdlib)( -g)@\1 -Wno-vla-parameter -Wno-stringop-overflow -Wno-use-after-free -Wno-dangling-pointer\2@g'   edk2/BaseTools/Source/C/Makefiles/header.makefile

(firmware block)

firmware :
        if [ ! -e firmware ] ; then \
                $(RM) -rf rpi_firmware ; \
                git clone --depth 1 --no-checkout --branch $(FW_BRANCH)  '$(FW_REPO_URL)'   rpi_firmware ; \
                cd rpi_firmware ; \
                git config core.sparseCheckout true ; \
                git sparse-checkout set $(FW_SUBDIR) ; \
                git checkout ; \
                cd - ; \
                mv rpi_firmware/$(FW_SUBDIR) firmware ; \
        fi

(clean block)

clean :
        $(RM) -rf firmware rpi_firmware Build sdcard sdcard.img sdcard.zip
        if [ -d $(IPXE_SRC) ] ; then $(MAKE) -C $(IPXE_SRC) clean ; fi

Missing pieces of the quickstart?

Hi, I was wanting to try out this tool, but the quickstart seems to carry some implied knowledge, or be missing some steps:

1 Download sdcard.img and write it onto any blank micro SD card using a tool such as dd or Etcher.
2 Insert the micro SD card into your Raspberry Pi.
3 Power on your Raspberry Pi.
Within a few seconds you should see iPXE appear and begin booting from the network:

Is there not the need to configure an iPXE server or target to boot from? It would be appreciated if you could look at including the missing / assumed steps / knowledge in the README or with some hints on how to use the software.

Raspberry Pi 4?

Do you have plans for making this work with Raspberry Pi 4?

start4.elf: is not compatible

Tried your README and have used Etcher to write sdcard.img, but after booting from that sdcard, raspberry pi 4 is showing that error.
Was it tested with Raspberry Pi 4 Model B with 4GB ram?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.