kernel_5.15.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334
  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. mkdir new; cp -rf .git new/.git
  5. cd new
  6. [ "$latest" ] && git reset --hard $latest || git reset --hard origin/master
  7. git checkout HEAD^
  8. [ "$(echo $(git log -1 --pretty=short) | grep "kernel: bump 5.15")" ] && git checkout $latest
  9. cp -rf --parents target/linux package/kernel package/boot package/firmware/linux-firmware include/{kernel-*,netfilter.mk} ../
  10. cd -
  11. kernel_v="$(cat include/kernel-5.15 | grep LINUX_KERNEL_HASH-* | cut -f 2 -d - | cut -f 1 -d ' ')"
  12. echo "KERNEL=${kernel_v}" >> $GITHUB_ENV || true
  13. sed -i "s?targets/%S/.*'?targets/%S/$kernel_v'?" include/feeds.mk
  14. rm -rf target/linux/generic/pending-5.15/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch
  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. rm -rf target/linux/generic/hack-5.15/{220-gc_sections*,781-dsa-register*,780-drivers-net*}
  20. curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/openwrt-22.03/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
  21. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  22. echo "
  23. CONFIG_TESTING_KERNEL=y
  24. CONFIG_PACKAGE_kmod-ipt-coova=n
  25. CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common=n
  26. CONFIG_PACKAGE_kmod-pf-ring=n
  27. " >> devices/common/.config