Artifactory/tilo/build.sh
misthios aa99d146b8
Some checks failed
build ipxe / make ipxe (push) Failing after 26s
tilo: build the system
2024-03-12 13:08:14 +01:00

43 lines
1.1 KiB
Bash
Executable File

#!/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 ./