diff options
| author | emmett1 <emmett1.2miligrams@protonmail.com> | 2024-05-24 12:22:12 +0800 |
|---|---|---|
| committer | emmett1 <emmett1.2miligrams@protonmail.com> | 2024-05-24 12:22:12 +0800 |
| commit | 46ca440e9d6cc606d9c3233021e32d24b25172cf (patch) | |
| tree | eeb573e47ac56498fbf74bda6d22fac47038ecab /repos/extra/linux/build | |
| parent | 8c2e7bb570c11a51fdcecf7302af4058757d862c (diff) | |
| download | alicelinux-46ca440e9d6cc606d9c3233021e32d24b25172cf.tar.gz alicelinux-46ca440e9d6cc606d9c3233021e32d24b25172cf.zip | |
added repos
Diffstat (limited to 'repos/extra/linux/build')
| -rw-r--r-- | repos/extra/linux/build | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/repos/extra/linux/build b/repos/extra/linux/build new file mode 100644 index 00000000..6260ba36 --- /dev/null +++ b/repos/extra/linux/build @@ -0,0 +1,71 @@ +make mrproper + +cp $SRC/dotconfig .config + +sed '/^CONFIG_LOGO=/d' -i .config +echo '# CONFIG_LOGO is not set' >> .config +sed '/^CONFIG_LOGO_LINUX_CLUT224=/d' -i .config +echo '# CONFIG_LOGO_LINUX_CLUT224 is not set' >> .config +sed '/^CONFIG_LOCALVERSION=/d' -i .config +echo 'CONFIG_LOCALVERSION="-Alice"' >> .config +sed '/^CONFIG_IKHEADERS=/d' -i .config +echo '# CONFIG_IKHEADERS is not set' >> .config +sed '/^CONFIG_DEFAULT_HOSTNAME=/d' -i .config +echo 'CONFIG_DEFAULT_HOSTNAME="alice"' >> .config +sed '/^# CONFIG_MODULE_COMPRESS_XZ/d' -i .config +echo 'CONFIG_MODULE_COMPRESS_XZ=y' >> .config +sed '/^# CONFIG_EROFS_FS/d' -i .config +echo 'CONFIG_EROFS_FS=y' >> .config + +make olddefconfig + +kernver=${version}$(grep CONFIG_LOCALVERSION= .config | cut -d '"' -f2) + +#make menuconfig + +make bzImage modules +make INSTALL_MOD_PATH=$PKG INSTALL_MOD_STRIP=1 modules_install + +mkdir -p $PKG/boot + +cp arch/x86/boot/bzImage $PKG/boot/vmlinuz-linux + +make clean +make prepare + +rm -rf $PKG/lib/firmware + +for file in $(ls arch); do + case $file in + x86|Kconfig) continue ;; + *) rm -fr arch/$file ;; + esac +done + +# strip down sources +# don't package the kernel in the sources directory +find . -name "*Image" -exec rm "{}" \; +find . -name "*.cmd" -exec rm -f "{}" \; +rm -f .*.d + +rm -fr firmware ipc .config.old .version .cocciconfig \ + .get_maintainer.ignore .gitattributes .gitignore .mailmap \ + COPYING CREDITS MAINTAINERS README Documentation +find . -name ".gitignore" -exec rm "{}" \; +for dir in block certs crypto drivers fs init kernel lib mm net samples security sound usr virt; do + find $dir -type f \( -name "*.c" -o -name "*.h" \) -exec rm "{}" \; +done +for i in $(ls tools); do + [ "$i" = "objtool" ] || rm -fr tools/$i +done +for i in $(ls tools/objtool); do + [ "$i" = "objtool" ] || rm -fr tools/objtool/$i +done + +rm $PKG/lib/modules/$kernver/build \ + $PKG/lib/modules/$kernver/source || true +mv $SRC/linux-${version%.0} $PKG/lib/modules/$kernver/build +ln -sv build $PKG/lib/modules/$kernver/source + +# remove now broken symlinks +find -L $PKG/lib/modules/$kernver/build -type l -exec rm -f "{}" \; |