target/realtek: fix kernel modules after upgraded

(cherry picked from commit 657e9323d0a0ec215ba8ff722e83cf57b2ec7194)
This commit is contained in:
jjm2473 2022-01-10 11:04:46 +08:00
parent 931cbc3738
commit c6d28a2864
2 changed files with 11 additions and 1 deletions

View File

@ -35,11 +35,19 @@ split_both_status() {
}
ls_all_pkgs() {
( cd /usr/lib/opkg/info ; find . -maxdepth 1 -name '*.control' | sed -E 's#./(.*).control#\1#g' )
( cd /usr/lib/opkg/info ; find . -maxdepth 1 -name '*.control' | sed -E 's#./(.*).control#\1#g' | grep -v '^kmod-' | grep -v '^kernel$' )
}
ls_all_kmods() {
[ -f /tmp/romopkgstatus/kernel ] && echo kernel
( cd /rom/usr/lib/opkg/info ; find . -maxdepth 1 -name 'kmod-*.control' | sed -E 's#./(.*).control#\1#g' )
}
rebuild_opkg_status() {
local line
ls_all_kmods | while read line; do
cat /tmp/romopkgstatus/$line
done
ls_all_pkgs | while read line; do
if [ -f /overlay/upper/usr/lib/opkg/info/$line.control ]; then
cat /tmp/newopkgstatus/$line

View File

@ -106,6 +106,8 @@ mount_overlay_partition()
rm -rf /overlay/upper /overlay/work
rm -f /overlay/.reset
sync /overlay
elif [ -f /overlay/upper/usr/lib/opkg/.upgrading ]; then
rm -rf /overlay/upper/lib/modules /overlay/upper/etc/modules-boot.d /overlay/upper/etc/modules.d /overlay/upper/usr/lib/opkg/info/kmod-* /overlay/upper/usr/lib/opkg/info/kernel.*
fi
mkdir -p /overlay/upper /overlay/work