Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phase1: remove kmods in target packages if archive is enabled #37

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dangowrt
Copy link
Member

OPKG gets confused if kmod packages are present in both, target packages as well as kernel version specific folder.
Remove them from target packages to make opkg pick the kmods from kmod archive folder only.

I didn't test this and I'm not very familiar with buildbot. Just noticing that currently, older snapshots fail to install packages because newer-version kmods from target packages are selected instead of the ones matching the kernel version, so this should be fixed somehow...

@ynezz
Copy link
Member

ynezz commented May 31, 2024

OPKG gets confused if kmod packages are present in both, target packages as well as kernel version specific folder.

Do you've more details about the issue, ideally reproducer? I just tried following and don't see any issue.

root@OpenWrt:/# ubus call system board
{
        "kernel": "6.6.32",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 4",
        "model": "Linksys E8450",
        "board_name": "linksys,e8450",
        "rootfs_type": "initramfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r26463-a1a9572f43",
                "target": "mediatek/mt7622",
                "description": "OpenWrt SNAPSHOT r26463-a1a9572f43"
        }
}
root@OpenWrt:/# opkg update 
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/kmods/6.6.32-1-5ca3cc895cfde6fa5bcd4cac1657aceb/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/kmods/6.6.32-1-5ca3cc895cfde6fa5bcd4cac1657aceb/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/telephony/Packages.sig
Signature check passed.
root@OpenWrt:/# opkg install kmod-usb-serial
Installing kmod-usb-serial (6.6.32-r1) to root...
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/kmods/6.6.32-1-5ca3cc895cfde6fa5bcd4cac1657aceb/kmod-usb-serial_6.6.32-r1_aarch64_cortex-a53.ipk
Installing kmod-nls-base (6.6.32-r1) to root...
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/kmods/6.6.32-1-5ca3cc895cfde6fa5bcd4cac1657aceb/kmod-nls-base_6.6.32-r1_aarch64_cortex-a53.ipk
Installing kmod-usb-core (6.6.32-r1) to root...
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/kmods/6.6.32-1-5ca3cc895cfde6fa5bcd4cac1657aceb/kmod-usb-core_6.6.32-r1_aarch64_cortex-a53.ipk
Configuring kmod-nls-base.
Configuring kmod-usb-core.
Configuring kmod-usb-serial.
root@OpenWrt:/# dmesg | grep usbserial
[  144.192904] usbcore: registered new interface driver usbserial_generic
[  144.192952] usbserial: USB Serial support registered for generic

@dangowrt
Copy link
Member Author

@ynezz Reproducing is easy. Install a snapshot today and try installing a kmod package or anything depending on a kmod package in a few weeks, after a kernel version bump. Despite the kmod archive feed being present, opkg well prefer the no longer matching newer kmods instead of choosing the ones from the kmod archive.

@jow-
Copy link
Contributor

jow- commented May 31, 2024

I can confirm this wrong opkg behavior and purging the kmods from the core repo will fix it. Basically, our opkg fork is broken when it has to pick a dependency with version constraints from multiple providers. Likely one of our opkg memory usage reduction patches is breaking this.

@Ansuel
Copy link
Member

Ansuel commented May 31, 2024

(this problem with kmods and dependency was one of the main reason we wants to move to apk)

@aparcar
Copy link
Member

aparcar commented Jun 1, 2024

I think we tried to tackle this issue back in 2020 and even made it working. I wonder what broke it again...

@ynezz
Copy link
Member

ynezz commented Jun 1, 2024

I've just deployed this change "manually" to https://buildbot.staging.openwrt.org

@aparcar
Copy link
Member

aparcar commented Jun 1, 2024

Long live the OPKG

phase1/master.cfg Outdated Show resolved Hide resolved
@dangowrt
Copy link
Member Author

@Ansuel Thank you! You are too fast 😜

@Ansuel
Copy link
Member

Ansuel commented Jun 12, 2024

@dangowrt ehehehe problem is that i think this needs to be manually picked for staging buildbot :(

@ynezz
Copy link
Member

ynezz commented Jun 12, 2024

Thanks, fix deployed.

@Ansuel
Copy link
Member

Ansuel commented Jun 12, 2024

Lovely find command that loves order of args...

find: paths must precede expression: `bin/targets/malta/be/packages/'
find: possible unquoted pattern after predicate `-delete'?

@ynezz can you redeploy one last time :( ?

@ynezz
Copy link
Member

ynezz commented Jun 12, 2024

@ynezz can you redeploy one last time :( ?

Done

@ynezz ynezz changed the title [RFC] phase1: remove kmods in target packages if archive is enabled phase1: remove kmods in target packages if archive is enabled Jun 12, 2024
@ynezz
Copy link
Member

ynezz commented Jun 13, 2024

Just added apk compat and printing of deleted files, deployed to staging.

@Ansuel
Copy link
Member

Ansuel commented Jun 13, 2024

@ynezz in case you miss IRC i think an intermediate commit was deployed to staging
https://buildbot.staging.openwrt.org/images/#/builders/5/builds/5

@ynezz
Copy link
Member

ynezz commented Jun 13, 2024

@ynezz in case you miss IRC i think an intermediate commit was deployed to staging https://buildbot.staging.openwrt.org/images/#/builders/5/builds/5

Yep, should be fixed. I've as well (hopefully) fixed the wrong find expression.

@Ansuel
Copy link
Member

Ansuel commented Jun 14, 2024

@ynezz I think i understood why this fail

https://buildbot.staging.openwrt.org/images/#/builders/1/builds/8/steps/59/logs/stdio

the file list is generated by the sha256sums file that is generated before the kmodclean is called (when the kmods are still in the target directory) hence rsync complain that the file can't be found.

Solution is to move the step before the checksums call so that file gets correctly deleted and are not included in the final file.

Can you check if this theory is correct and redeploy?

If it does look ugly we may have to add an additional step to remove the missing entry in the sha256sums (if we want to keep everything in order)

@Ansuel Ansuel force-pushed the fix-kmod-archive branch 2 times, most recently from fbd516a to a4d912e Compare June 14, 2024 11:43
@Ansuel
Copy link
Member

Ansuel commented Jun 14, 2024

Well it seems at the end we really need to ""fix"" the sha256sums... Alternative solution is to use a tmp directory to move the kmods.

Honestly they are both bad solution but one should be faster than moving lots of files around one extra time...

phase1/master.cfg Outdated Show resolved Hide resolved
OPKG gets confused if kmod packages are present in both, target packages
as well as kernel version specific folder.
Remove them from target packages to make opkg pick the kmods from kmod
archive folder only.

Also add an additional step to remove any kmod entry from sha256sums.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[ rework implementation, sha256sumsclean + --remove-source-files ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants