kernel_5.15.sh 1.7 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. rm -rf 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 reset --hard origin/master
  8. git checkout HEAD^
  9. [ "$(echo $(git log -1 --pretty=short) | grep "kernel: bump 5.15")" ] && git checkout $latest
  10. cp -rf --parents target/linux package/kernel package/boot package/firmware/linux-firmware include/{kernel-*,netfilter.mk} ../
  11. cd -
  12. kernel_v="$(cat include/kernel-5.15 | grep LINUX_KERNEL_HASH-* | cut -f 2 -d - | cut -f 1 -d ' ')"
  13. echo "KERNEL=${kernel_v}" >> $GITHUB_ENV || true
  14. sed -i "s?targets/%S/.*'?targets/%S/$kernel_v'?" include/feeds.mk
  15. sh -c "curl -sfL https://github.com/coolsnowwolf/lede/commit/06fcdca1bb9c6de6ccd0450a042349892b372220.patch | patch -d './' -p1 --forward"
  16. svn export --force https://github.com/openwrt/packages/trunk/kernel feeds/packages/kernel
  17. svn export --force https://github.com/openwrt/packages/trunk/net/xtables-addons feeds/packages/net/xtables-addons
  18. svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
  19. curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/openwrt-22.03/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
  20. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  21. echo "
  22. CONFIG_TESTING_KERNEL=y
  23. CONFIG_PACKAGE_kmod-ipt-coova=n
  24. CONFIG_PACKAGE_kmod-pf-ring=n
  25. " >> devices/common/.config