diff options
author | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
commit | 48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch) | |
tree | 00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/linux/linux.xibuild | |
parent | 871b2b573f01c1b3176a0f65458b3d281b41c437 (diff) |
removed idea of repos
Diffstat (limited to 'repo/linux/linux.xibuild')
-rw-r--r-- | repo/linux/linux.xibuild | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/repo/linux/linux.xibuild b/repo/linux/linux.xibuild new file mode 100644 index 0000000..7bc15b4 --- /dev/null +++ b/repo/linux/linux.xibuild @@ -0,0 +1,73 @@ +#!/bin/sh + +MAKEDEPS="make bc" +DEPS="sbase kmod" + +PKG_VER=5.17.6 +SOURCE=https://cdn.kernel.org/pub/linux/kernel/v${PKG_VER%%.*}.x/linux-$PKG_VER.tar.xz +ADDITIONAL=" + fix-sbase-coreutils.patch + config +" + +prepare () { + apply_patches + cp config .config + + export GREP="ggrep" + + make olddefconfig + make -s kernelrelease > version + echo "Prepared linux version $(cat version)" +} + +build () { + make all +} + +package () { + local kernver="$(cat version)" + local modulesdir="$PKG_DEST/usr/lib/modules/$kernver" + + echo "Installing boot image..." + mkdir -p $PKG_DEST/boot + + cp arch/x86/boot/bzImage $PKG_DEST/boot/vmlinuz-$kernver + cp System.map $PKG_DEST/boot/System.map-$kernver + cp .config $PKG_DEST/boot/config-$kernver + + install -d $PKG_DEST/usr/share/doc/linux-$kernver + cp -r Documentation/* $PKG_DEST/usr/share/doc/linux-$kernver + + install -m755 -d $PKG_DEST/etc/modprobe.d + cat > $PKG_DEST/etc/modprobe.d/usb.conf << "EOF" +# Begin /etc/modprobe.d/usb.conf + +install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i ohci_hcd ; true +install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe -i uhci_hcd ; true + +# End /etc/modprobe.d/usb.conf +EOF + + echo "Installing modules..." + make INSTALL_MOD_PATH="$PKG_DEST/usr" INSTALL_MOD_STRIP=1 modules_install + builddir=$modulesdir/build + rm $modulesdir/source + rm $builddir + mkdir $builddir + echo "Installing build files..." + install -D -m644 .config "$builddir" + install -D -m644 Makefile "$builddir" + install -D -m644 Module.symvers "$builddir" + install -D -m644 System.map "$builddir" + install -D -m644 version "$builddir" + install -D -m644 vmlinux "$builddir" + install -D -m644 kernel/Makefile "$builddir/kernel/Makefile" + install -D -m644 arch/x86/Makefile "$builddir/arch/x86/Makefile" + cp -r scripts "$builddir" + + install -D tools/objtool/objtool "$builddir/tools/objtool" + install -D tools/bpf/resolve_btfids/resolve_btfids "$builddir/tools/bpf/resolve_btfids" + ln -s /usr/src/linux $modulesdir/source +} + |