Compare commits

...

11 Commits

Author SHA1 Message Date
3a5d5f06d2 mend
Some checks failed
Gitea Actions Demo / make ipxe (push) Failing after 2s
2024-11-24 12:03:09 +01:00
0ca5e18271 test
Some checks failed
Gitea Actions Demo / make ipxe (push) Has been cancelled
2024-11-24 12:00:35 +01:00
e9497ee975 update ci
Some checks failed
Gitea Actions Demo / make ipxe (push) Failing after 1s
2024-10-15 21:32:31 +02:00
aa99d146b8 tilo: build the system
Some checks failed
build ipxe / make ipxe (push) Failing after 1s
2024-03-12 13:08:14 +01:00
3a42e24128 [CI] do not run ipxe on push
All checks were successful
build ipxe / make ipxe (push) Successful in 5m0s
2024-03-08 09:12:38 +01:00
f041247eef Add Ti(ny) Lo(ader) build script
All checks were successful
build ipxe / make ipxe (push) Successful in 5m3s
2024-03-07 21:42:12 +01:00
cb861565a0 finally boot the second stage
All checks were successful
build ipxe / make ipxe (push) Successful in 5m14s
2024-03-05 12:52:58 +01:00
532dd13a3c ipxe: switch to root-path
All checks were successful
build ipxe / make ipxe (push) Successful in 5m8s
2024-03-05 12:42:53 +01:00
e02e33ceab IPXE ci: switch release action back to main repo
All checks were successful
build ipxe / make ipxe (push) Successful in 5m4s
2024-03-05 10:05:56 +01:00
9241b9a17f ipxe: debug using sleep
Some checks failed
build ipxe / make ipxe (push) Failing after 13s
2024-03-05 09:59:30 +01:00
972229c858 ipxe/netboot: add script for Provisioner
Some checks failed
build ipxe / make ipxe (push) Failing after 20s
2024-02-16 14:18:38 +00:00
4 changed files with 132 additions and 34 deletions

View File

@ -1,41 +1,14 @@
name: build ipxe
on:
push:
schedule:
- cron: '0 2 * * SUN'
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
runs-on: runner-01-x86_64
on: [push]
jobs:
make-ipxe:
make-ipxe:
name: make ipxe
runs-on: ubuntu-latest
runs-on: runner-01-x86_64
container: docker.io/alpine:edge
steps:
- name: install dependencies
run: |
apk add git make binutils mtools perl xz-dev libc-dev clang nodejs
- name: checkout ipxe repo
run: |
git clone https://github.com/ipxe/ipxe ipxe
- name: checkout provisioner repo
uses: actions/checkout@v4
with:
fetch-depth: 0
path: self
- name: build ipxe
run: |
self_root="${GITHUB_WORKSPACE}/self"
ipxe_root="${GITHUB_WORKSPACE}/ipxe"
cp ${self_root}/ipxe/netboot.ipxe ${ipxe_root}/src
cd ${ipxe_root}/src
make -j$(nproc) bin-i386-pcbios/undionly.kpxe EMBED=netboot.ipxe
make -j$(nproc) bin-x86_64-efi/ipxe.efi EMBED=netboot.ipxe
mkdir artifact
mv bin-i386-pcbios/undionly.kpxe artifact/undionly.kpxe
mv bin-x86_64-efi/ipxe.efi artifact/ipxe64.efi
- name: update Nightly Release
uses: akkuman/gitea-release-action@v1
with:
name: ipxe
prerelease: true
tag_name: ipxe-nightly
files: |-
${{ github.workspace }}/ipxe/src/artifact/*

View File

@ -1 +1,21 @@
#!ipxe
#Init networking
dhcp
#Print useful information for debugging
echo root-path is ${root-path}
echo filaneme is ${filename}
echo MAC address is ${net0/mac}
echo IP address is ${ip}
#Provisioner uses the following pattern: /boot/{mac}
set server http://${root-path}/boot/${mac:hexhyp}
echo Server is ${server}
sleep 5
# Download the correct bootscript or continue normal boot
chain ${server}
echo should not be reached
exit

42
tilo/build.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh
set -e
#get latest non patch release candidate kernel and busybox version
busybox_latest="$(curl -s "https://api.github.com/repos/mirror/busybox/tags" | jq -r '.[0].name' | tr "_" ".")"
kernel_latest="$(curl -s "https://api.github.com/repos/torvalds/linux/tags" | jq -r '.[] .name' | awk '$0 !~/-/' | head -n1 | cut -c2-4)"
#backups for when hitting ratelimits during testing :)
#kernel_latest="6.7"
#busybox_latest="1.36.0"
echo "Using kernel version: $kernel_latest"
echo "Using busybox version: $busybox_latest"
kernel_major="$(echo "$kernel_latest" | cut -c1)"
kernel_url="https://mirrors.edge.kernel.org/pub/linux/kernel/v$kernel_major.x"
mkdir -p src
cd src
wget "$kernel_url/linux-$kernel_latest.tar.xz"
tar -xf linux-$kernel_latest.tar.xz
cd linux-$kernel_latest
make defconfig
make -j 8
cd ..
wget https://busybox.net/downloads/busybox-$busybox_latest.tar.bz2
tar -xf busybox-$busybox_latest.tar.bz2
cd busybox-$busybox_latest
make defconfig
sed 's/^.*CONFIG_STATIC[^_].*$/CONFIG_STATIC=y/g' -i .config
make -j$(nproc)
cd ..
cd ..
cp src/linux-$kernel_latest/arch/x86/boot/bzImage ./

63
tilo/initrd.sh Executable file
View File

@ -0,0 +1,63 @@
#!/bin/sh
set -e
#extract the version of the compiled busybox :)
busybox_ver="$(find ./src/ -type d -maxdepth 1 -name "busy*" | cut -d- -f2)"
mkdir initrd
cd initrd
mkdir -p bin dev proc sys etc usr
#Add busybox programs
cd bin
cp ../../src/busybox-$busybox_ver/busybox ./
for prog in $(./busybox --list); do
ln -s /bin/busybox ./$prog
done
cd ..
#Create initial init
cat <<EOF >init
#!/bin/sh
mount -t sysfs sysfs /sys
mount -t proc proc /proc
mount -t devtmpfs udev /dev
exec /bin/init
clear
EOF
#Create busybox initrd
echo "tty1::respawn:-/bin/sh" > ./etc/inittab
#Create resolv.conf
echo "nameserver 1.1.1.1" > ./etc/resolv.conf
#Add curl + certificates for tls support
#Add static curl binary
ver="$(curl -s "https://api.github.com/repos/stunnel/static-curl/tags" | jq -r '.[0].name' | tr "_" ".")"
rel="$(curl -s "https://api.github.com/repos/stunnel/static-curl/releases" | jq -r '.[0].name' | tr "_" ".")"
wget "https://github.com/stunnel/static-curl/releases/download/$rel/curl-linux-x86_64-musl-$ver.tar.xz"
tar xf curl-linux-x86_64-musl-$ver.tar.xz -C ./bin/
rm curl-linux-x86_64-musl-$ver.tar.xz
#Add certificates
##very ugly way to extract the certs, but hey it just works :)
container="$(podman run -d alpine:edge /bin/sh -c "apk add ca-certificates && update-ca-certificates && sleep 90")"
sleep 10 #make sure that the cmds are finished (except sleep ofc)
podman cp $container:/etc/ssl/ ./etc/
podman container rm -f $container
#give perms to files, #todo: find a better way someday
#prevents errors like "can't open /dev/tty1: no such file "
chmod -R 777 .
#Add all the files to a img
find . | cpio -o -H newc > ../initrd.img
cd ..