kernel_5.15.sh 1.5 KB

12345678910111213141516171819202122232425262728
  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/packages?targets/%S/$kernel_v?" include/feeds.mk
  14. sh -c "curl -sfL https://github.com/coolsnowwolf/lede/commit/06fcdca1bb9c6de6ccd0450a042349892b372220.patch | patch -d './' -p1 --forward"
  15. svn export --force https://github.com/openwrt/packages/trunk/kernel feeds/packages/kernel
  16. svn export --force https://github.com/openwrt/packages/trunk/net/xtables-addons package/feeds/kiddin9/xtables-addons
  17. svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
  18. rm -rf target/linux/generic/hack-5.15/{220-gc_sections*,781-dsa-register*,780-drivers-net*}
  19. echo "
  20. CONFIG_TESTING_KERNEL=y
  21. CONFIG_PACKAGE_kmod-ipt-coova=n
  22. CONFIG_PACKAGE_kmod-usb-serial-xr_usb_serial_common=n
  23. " >> devices/common/.config