kernel_5.15.sh 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. rm -rf tools target/linux package/kernel package/boot package/firmware/linux-firmware include/{kernel-*,netfilter.mk}
  3. latest="$(curl -sfL https://github.com/openwrt/openwrt/commits/master/include | grep -o 'href=".*>kernel: bump 5.15' | head -1 | cut -d / -f 5 | cut -d '"' -f 1)"
  4. latest=""
  5. mkdir new; cp -rf .git new/.git
  6. cd new
  7. [ "$latest" ] && (git reset --hard $latest && git checkout HEAD^) || git reset --hard origin/master
  8. [ "$(echo $(git log -1 --pretty=short) | grep "kernel: bump 5.15")" ] && git checkout $latest
  9. cp -rf --parents tools target/linux package/kernel package/boot package/firmware/linux-firmware include/{kernel-*,netfilter.mk} ../
  10. cd -
  11. curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/master/include/image-commands.mk -o include/image-commands.mk
  12. sed -i "s/\$(STAGING_DIR_HOST)\/bin\/gzip/gzip/" include/image-commands.mk
  13. svn export --force https://github.com/openwrt/packages/trunk/kernel feeds/packages/kernel
  14. svn export --force https://github.com/openwrt/packages/trunk/net/xtables-addons feeds/packages/net/xtables-addons
  15. svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
  16. svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/backport-5.15 target/linux/generic/backport-5.15
  17. find target/linux/generic/backport-5.15 -name "[0-9][0-9][0-9]-[a-z][a-z]*" -exec rm -f {} \;
  18. rm -rf target/linux/generic/backport-5.15/{802-v6.1-nvmem*,803-v5.19-nvmem*}
  19. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  20. echo "
  21. CONFIG_TESTING_KERNEL=y
  22. CONFIG_PACKAGE_kmod-ipt-coova=n
  23. CONFIG_PACKAGE_kmod-pf-ring=n
  24. " >> devices/common/.config