Skip to content

Commit

Permalink
Add boot.img for HTTP boot
Browse files Browse the repository at this point in the history
  • Loading branch information
valtzu committed Mar 27, 2022
1 parent 8f2d1a4 commit 08f36f0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ jobs:
asset_name: tftpboot.zip
asset_path: tftpboot.zip
asset_content_type: application/zip

- name: Upload (boot.img)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: boot.img
asset_path: boot.img
asset_content_type: application/octet-stream
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ RUN true \
lzma-dev \
uuid-dev \
zip \
wget \
&& true

# mtools version 4.0.32 in the ubuntu repo as of 2022-03-26 does not work, so let's download a working version manually
RUN \
wget https://ftp.gnu.org/gnu/mtools/mtools_4.0.38_amd64.deb \
&& dpkg -i mtools_4.0.38_amd64.deb \
&& true

RUN mkdir -p /opt/build
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ IPXE_EFI := $(IPXE_SRC)/$(IPXE_TGT)
IPXE_CONSOLE := $(IPXE_SRC)/config/local/rpi/console.h
IPXE_GENERAL := $(IPXE_SRC)/config/local/rpi/general.h

all : tftpboot.zip
SDCARD_MB := 32
export MTOOLSRC := mtoolsrc

all : tftpboot.zip boot.img

submodules :
git submodule update --init --recursive
Expand Down Expand Up @@ -67,14 +70,20 @@ tftpboot.zip : pxe
$(RM) -f $@
( pushd $< ; zip -q -r ../$@ * ; popd )

boot.img: pxe
truncate -s $(SDCARD_MB)M $@
mpartition -I -c -b 32 -s 32 -h 64 -t $(SDCARD_MB) -a "z:"
mformat -v "pipxe" "z:"
mcopy -s pxe/* "z:"

update:
git submodule foreach git pull origin master

tag :
git tag v`git show -s --format='%ad' --date=short | tr -d -`
git tag v`git show -s --format='%ad' --date=short | tr -d -`-rpi4

.PHONY : submodules firmware efi efi-basetools $(EFI_FD) ipxe $(IPXE_EFI) pxe

clean :
$(RM) -rf firmware Build pxe tftpboot.zip
$(RM) -rf firmware Build pxe tftpboot.zip boot.img
if [ -d $(IPXE_SRC) ] ; then $(MAKE) -C $(IPXE_SRC) clean ; fi
3 changes: 3 additions & 0 deletions mtoolsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
drive z:
file="boot.img"
partition=1

0 comments on commit 08f36f0

Please sign in to comment.