2024-03-07 20:40:33 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-03-12 11:54:23 +00:00
|
|
|
set -e
|
|
|
|
|
2024-03-07 20:40:33 +00:00
|
|
|
#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
|
2024-03-12 11:54:23 +00:00
|
|
|
make -j 8
|
2024-03-07 20:40:33 +00:00
|
|
|
|
|
|
|
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
|
2024-03-12 11:54:23 +00:00
|
|
|
make -j$(nproc)
|
|
|
|
cd ..
|
2024-03-07 20:40:33 +00:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cp src/linux-$kernel_latest/arch/x86/boot/bzImage ./
|
|
|
|
|
|
|
|
|