Compare commits
5 Commits
d6da5ca777
...
6c588d59a2
Author | SHA1 | Date |
---|---|---|
|
6c588d59a2 | |
|
8a2bb1666d | |
|
b35ff1b85d | |
|
594dc43366 | |
|
6be78932df |
|
@ -1,3 +1,5 @@
|
||||||
/images
|
/images
|
||||||
/linux
|
/linux
|
||||||
/output
|
/output
|
||||||
|
/.prepared
|
||||||
|
/.host-tools
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
update.tar: output/update.tar.zstd
|
||||||
|
|
||||||
|
.prepared: \
|
||||||
|
prepare.sh \
|
||||||
|
config-portage.sh \
|
||||||
|
setup-local-repo.sh \
|
||||||
|
$(shell find portage host-portage -type f) \
|
||||||
|
$(shell find patches/ebuilds -type f)
|
||||||
|
./prepare.sh
|
||||||
|
./config-portage.sh
|
||||||
|
./setup-local-repo.sh
|
||||||
|
touch .prepared
|
||||||
|
|
||||||
|
prepare: .prepared
|
||||||
|
|
||||||
|
.host-tools: \
|
||||||
|
build-host-tools.sh \
|
||||||
|
.prepared
|
||||||
|
./build-host-tools.sh
|
||||||
|
touch .host-tools
|
||||||
|
|
||||||
|
host-tools: .host-tools
|
||||||
|
|
||||||
|
images/rootfs.squashfs: \
|
||||||
|
build.sh \
|
||||||
|
build-rootfs.sh \
|
||||||
|
build-squashfs.sh \
|
||||||
|
linux/arch/arm64/boot/Image.gz \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build.sh
|
||||||
|
./build-rootfs.sh
|
||||||
|
./build-squashfs.sh
|
||||||
|
|
||||||
|
squashfs: images/rootfs.squashfs
|
||||||
|
|
||||||
|
linux/arch/arm64/boot/Image.gz: \
|
||||||
|
build-kernel.sh \
|
||||||
|
linux.config \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-kernel.sh
|
||||||
|
|
||||||
|
kernel: linux/arch/arm64/boot/Image.gz
|
||||||
|
|
||||||
|
output/efi-part/EFI/BOOT/BOOTAA64.efi: \
|
||||||
|
build-grub.sh \
|
||||||
|
grub.cfg \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-grub.sh
|
||||||
|
|
||||||
|
grub: output/efi-part/EFI/BOOT/BOOTAA64.efi
|
||||||
|
|
||||||
|
output/efi-part/u-boot.bin: \
|
||||||
|
build-uboot.sh \
|
||||||
|
u-boot.config
|
||||||
|
./build-uboot.sh
|
||||||
|
|
||||||
|
uboot: output/efi-part/u-boot.bin
|
||||||
|
|
||||||
|
images/sdcard.img: \
|
||||||
|
genimage.cfg \
|
||||||
|
genimage.sh \
|
||||||
|
post-build.sh \
|
||||||
|
output/efi-part/u-boot.bin \
|
||||||
|
output/efi-part/EFI/BOOT/BOOTAA64.efi
|
||||||
|
./post-build.sh
|
||||||
|
./genimage.sh
|
||||||
|
|
||||||
|
sdcard.img: images/sdcard.img
|
||||||
|
|
||||||
|
images/firmware.img: images/sdcard.img
|
||||||
|
|
||||||
|
output/update.tar.zstd: \
|
||||||
|
images/rootfs.squashfs \
|
||||||
|
images/firmware.img \
|
||||||
|
.host-tools \
|
||||||
|
.prepared
|
||||||
|
./build-update.sh
|
||||||
|
|
||||||
|
clean:
|
||||||
|
git -C u-boot clean -fdx && git -C u-boot checkout -- .
|
||||||
|
rm -rf linux output images tmp
|
||||||
|
rm -f .prepared .host-tools
|
||||||
|
|
||||||
|
.PHONY: \
|
||||||
|
grub \
|
||||||
|
host-tools \
|
||||||
|
kernel \
|
||||||
|
prepare \
|
||||||
|
sdcard.img \
|
||||||
|
squashfs \
|
||||||
|
uboot \
|
||||||
|
update.tar
|
|
@ -15,11 +15,11 @@ cd linux
|
||||||
../linux.config
|
../linux.config
|
||||||
make -C /usr/src/linux O=${PWD} olddefconfig
|
make -C /usr/src/linux O=${PWD} olddefconfig
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
kver=$(make kernelversion)
|
kver=$(make -s kernelversion)
|
||||||
make modules_install INSTALL_MOD_PATH=/mnt/gentoo
|
make modules_install INSTALL_MOD_PATH=/mnt/gentoo
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
printf 'Installing Kernel ...\n'
|
printf 'Installing Kernel %s ...\n' "${kver}"
|
||||||
mkdir -p /mnt/gentoo/boot
|
mkdir -p /mnt/gentoo/boot
|
||||||
cp -au linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
cp -au linux/arch/arm64/boot/Image.gz /mnt/gentoo/boot/vmlinuz-${kver}
|
||||||
cp -au linux/.config /mnt/gentoo/boot/config-${kver}
|
cp -au linux/.config /mnt/gentoo/boot/config-${kver}
|
||||||
|
|
|
@ -5,10 +5,16 @@ set -e
|
||||||
|
|
||||||
. ./config
|
. ./config
|
||||||
|
|
||||||
mkdir -p /mnt/gentoo/usr/bin
|
mkdir -p \
|
||||||
|
/mnt/gentoo/usr/bin \
|
||||||
|
/mnt/gentoo/usr/lib \
|
||||||
|
/mnt/gentoo/usr/lib64 \
|
||||||
|
|| exit
|
||||||
[ -h /mnt/gentoo/bin ] || ln -s usr/bin /mnt/gentoo/bin
|
[ -h /mnt/gentoo/bin ] || ln -s usr/bin /mnt/gentoo/bin
|
||||||
[ -h /mnt/gentoo/sbin ] || ln -s usr/sbin /mnt/gentoo/sbin
|
[ -h /mnt/gentoo/sbin ] || ln -s usr/sbin /mnt/gentoo/sbin
|
||||||
[ -h /mnt/gentoo/usr/sbin ] || ln -s bin /mnt/gentoo/usr/sbin
|
[ -h /mnt/gentoo/usr/sbin ] || ln -s bin /mnt/gentoo/usr/sbin
|
||||||
|
[ -h /mnt/gentoo/lib ] || ln -s usr/lib /mnt/gentoo/lib
|
||||||
|
[ -h /mnt/gentoo/lib64 ] || ln -s usr/lib64 /mnt/gentoo/lib64
|
||||||
|
|
||||||
mkdir -p /mnt/gentoo/etc/portage
|
mkdir -p /mnt/gentoo/etc/portage
|
||||||
ln -snf \
|
ln -snf \
|
||||||
|
@ -59,7 +65,10 @@ if [ -f /mnt/gentoo/etc/udev/hwdb.bin ]; then
|
||||||
mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/
|
mv /mnt/gentoo/etc/udev/hwdb.bin /mnt/gentoo/usr/lib/udev/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f /mnt/gentoo/lib/tmpfiles.d/provision.conf
|
||||||
|
|
||||||
systemctl preset-all --root=/mnt/gentoo
|
systemctl preset-all --root=/mnt/gentoo
|
||||||
|
rm -f /mnt/gentoo/lib/systemd/system/sysinit.target.wants/ldconfig.service
|
||||||
|
|
||||||
systemd-sysusers --root=/mnt/gentoo
|
systemd-sysusers --root=/mnt/gentoo
|
||||||
if grep -q '^root:.*/bin/bash$' /mnt/gentoo/etc/passwd; then
|
if grep -q '^root:.*/bin/bash$' /mnt/gentoo/etc/passwd; then
|
||||||
|
|
|
@ -5,14 +5,8 @@ set -e
|
||||||
|
|
||||||
. ./config
|
. ./config
|
||||||
|
|
||||||
|
./patch-uboot.sh
|
||||||
cd u-boot
|
cd u-boot
|
||||||
if [ ! -f .patched ]; then
|
|
||||||
for x in ../patches/uboot/*.patch; do
|
|
||||||
printf 'Applying patch %s ...\n' "${x##*/}"
|
|
||||||
patch -p1 < "${x}"
|
|
||||||
done
|
|
||||||
: > .patched
|
|
||||||
fi
|
|
||||||
cat configs/rpi_4_defconfig ../u-boot.config > configs/yellow_defconfig
|
cat configs/rpi_4_defconfig ../u-boot.config > configs/yellow_defconfig
|
||||||
make yellow_defconfig
|
make yellow_defconfig
|
||||||
CROSS_COMPILE=${target}- make
|
CROSS_COMPILE=${target}- make
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# vim: set sw=4 ts=4 sts=4 et :
|
||||||
|
|
||||||
|
if [ -f u-boot/.patched ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
rc=0
|
||||||
|
cd u-boot || exit
|
||||||
|
for x in ../patches/uboot/*.patch; do
|
||||||
|
[ -f "${x}" ] || continue
|
||||||
|
printf 'Applying patch %s ...\n' "${x##*/}"
|
||||||
|
patch -p1 < "${x}" || rc=$?
|
||||||
|
done
|
||||||
|
if [ $rc -eq 0 ]; then
|
||||||
|
: > .patched
|
||||||
|
fi
|
|
@ -12,6 +12,7 @@ cid=$(podman run \
|
||||||
-v packages:/var/cache/binpkgs \
|
-v packages:/var/cache/binpkgs \
|
||||||
-v distfiles:/var/cache/distfiles \
|
-v distfiles:/var/cache/distfiles \
|
||||||
-v packages:/usr/${target}/var/cache/binpkgs \
|
-v packages:/usr/${target}/var/cache/binpkgs \
|
||||||
|
-v /mnt/gentoo \
|
||||||
-v ${PWD}:/tmp/build:rw,z \
|
-v ${PWD}:/tmp/build:rw,z \
|
||||||
-w /tmp/build \
|
-w /tmp/build \
|
||||||
-d \
|
-d \
|
||||||
|
@ -20,7 +21,9 @@ cid=$(podman run \
|
||||||
python -c 'from signal import *;signal(SIGTERM, lambda x, y: None);pause()'
|
python -c 'from signal import *;signal(SIGTERM, lambda x, y: None);pause()'
|
||||||
)
|
)
|
||||||
|
|
||||||
podman exec -it ${cid} ./build-all.sh "${target}"
|
./patch-uboot.sh
|
||||||
|
|
||||||
|
podman exec -it ${cid} make
|
||||||
|
|
||||||
podman stop ${cid}
|
podman stop ${cid}
|
||||||
podman rm ${cid}
|
podman rm ${cid}
|
||||||
|
|
Loading…
Reference in New Issue