kernel_5.15.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  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. rm -rf target/linux/generic/pending-5.15/444-mtd-nand-rawnand-add-support-for-Toshiba-TC58NVG0S3H.patch
  16. sh -c "curl -sfL https://github.com/coolsnowwolf/lede/commit/06fcdca1bb9c6de6ccd0450a042349892b372220.patch | patch -d './' -p1 --forward"
  17. svn export --force https://github.com/openwrt/packages/trunk/kernel feeds/packages/kernel
  18. svn export --force https://github.com/openwrt/packages/trunk/net/xtables-addons feeds/packages/net/xtables-addons
  19. svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
  20. rm -rf target/linux/generic/hack-5.15/{220-gc_sections*,781-dsa-register*,780-drivers-net*}
  21. curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/openwrt-22.03/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
  22. sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
  23. echo "
  24. CONFIG_TESTING_KERNEL=y
  25. CONFIG_PACKAGE_kmod-ipt-coova=n
  26. CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common=n
  27. CONFIG_PACKAGE_kmod-pf-ring=n
  28. " >> devices/common/.config