forked from siderolabs/pkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pkg.yaml
91 lines (86 loc) · 3.18 KB
/
pkg.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: kernel
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- image: '{{ .TOOLS_IMAGE }}'
steps:
- sources:
- url: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.5.15.tar.xz
destination: linux.tar.xz
sha256: c41fd8052e3e53de5bf0a0d666f92b7a9ea2d5f09b24423ee8c090f1e77ce214
sha512: fc774cee6c2eb87cf3efdb6a71f4b22e82536e7d62d32b8ee28f8001f31e1a2c3029ddd95884a69284685f02f928d3d3eb37b506568fa32d6192b12c9d45adde
prepare:
- |
tar -xJf linux.tar.xz --strip-components=1
mkdir /bin
ln -sv /toolchain/bin/bash /bin/bash
ln -sv /toolchain/bin/bash /bin/sh
ln -sv /toolchain/lib /lib
mkdir -p /usr/bin \
&& ln -sf /toolchain/bin/env /usr/bin/env \
&& ln -sf /toolchain/bin/true /bin/true \
&& ln -sf /toolchain/bin/pwd /bin/pwd
# Ensure that `make menuconfig` works.
mkdir -p /usr/lib/pkgconfig
ln -s /toolchain/include /usr/include
for lib in ncurses form panel menu ; do
rm -vf /lib/lib${lib}.so
echo "INPUT(-l${lib}w)" > /lib/lib${lib}.so
ln -sfv ${lib}w.pc /lib/pkgconfig/${lib}.pc
done
case $ARCH in
x86_64)
make mrproper
cp -v /pkg/config-amd64 .config
;;
aarch64)
export ARCH=arm64
make mrproper
cp -v /pkg/config-arm64 .config
;;
*)
echo "unsupported arch ${ARCH}"
exit 1
;;
esac
build:
- |
case $ARCH in
x86_64)
;;
aarch64)
export ARCH=arm64
;;
*)
echo "unsupported arch ${ARCH}"
exit 1
;;
esac
make -j $(nproc)
make -j $(nproc) modules
install:
- |
mkdir -p /rootfs/boot
case $ARCH in
x86_64)
mv arch/x86/boot/bzImage /rootfs/boot/vmlinuz
mv vmlinux /rootfs/boot/vmlinux
;;
aarch64)
export ARCH=arm64
mv arch/arm64/boot/Image.gz /rootfs/boot/vmlinuz
mv vmlinux /rootfs/boot/vmlinux
;;
*)
echo "unsupported arch ${ARCH}"
exit 1
;;
esac
export KERNELRELEASE=$(cat include/config/kernel.release)
make -j $(nproc) modules_install DEPMOD=/toolchain/bin/depmod INSTALL_MOD_PATH=/rootfs
depmod -b /rootfs $KERNELRELEASE
unlink /rootfs/lib/modules/$KERNELRELEASE/build
unlink /rootfs/lib/modules/$KERNELRELEASE/source
finalize:
- from: /rootfs
to: /