OpenWrt Forum Archive

Topic: opkg remove kernel

The content of this topic has been archived on 9 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hey guys,

I had openwrt running totally fine on my Tplink Archer C7 V4. This morning i wanted to install SQM opkg package and i got an error about conflicts in the kernel package version.

Some days ago i had the great idea to upgrade all packages, including kernel apparently. I thought i read somewhere you cannot overwrite these packages and it will install it besides the old package. So i went to Luci and uninstalled the opkg package "kernel". I was on OpenVPN and the connection just halted. I can no longer reach my router using OpenVPN.

Internet still seems to work fine, since my wife is at home and has no issues, so the router seems to be still alive smile However, i asked her to go to the IP of it, and Luci no longer responds. When i get back home, i really hope SSH is still working on it.

Any suggestions what i should do to get this thing back to life? Any hopes SSH will still be working? smile

(Last edited by bravo on 20 Feb 2018, 13:41)

Apparently no issue at all big_smile Just logged in without any problems in Luci. SSH works too, and mentioned the filesystem being full. However, it wasn't and after a reboot everything was ok!

The kernel is not a package.  To upgrade the kernel, you have to flash the whole firmware image.  The kernel is stored in a separate area of the flash chip that is not in the filesystem.

Well, when you search for opkg packages with the name "kernel" i definately get a result:

Package name    Version
kernel                     4.9.82-1-daac58631693..906

That is only a placeholder meta-package used to establish the version and dependencies.  It carries no installed files. 

Try opkg files kernel.

Ah that clears things up! Thank you for the information!

The kernel is the heart and brain of a linux system, on which OpenWRT is built. You can't "remove the kernel" - well not without significant corruption / bricking the router on reboot.
As @mk24 says, the kernel is stored for example in a squashfs "root" filesystem (partition) and there are many partitions. The kernel is thus part of the flashable image. It also requires module packages "kmod-*" in order ot function and these can be added using opkg. A JIFFs partition for example is where downloaded packages and kmods' would typically be stored following an opkg install ....

If you change the kernel then the flashable image must be recompiled/rebuilt to include the desired kernel, as must all the kmod's because there is a 1:1 relationship between kernel (version) and kmod's (version).

I've used examples above, not all routers follow the same architecture, but you get the idea.

Kernel builds is not for the inexperienced due to the plethora of options and relationships between options. Get just one wrong and the router may end upa brick. Better to create a VM of the router and compile/run the image in that. But then your're into yet more complexity trying to configure a VM to mirror a physical router, but it's possible - I have done it - but not trivial.

(Last edited by ninjaef on 21 Feb 2018, 12:10)

Thank you for your info! I read something like that, that's why i was under the impression that removing the kernel package with opkg would have no influence since all important stuff is read-only mounted. However, for some reason my OpenVPN service just stopped, but nothing broke.

I upgraded my router with the latests snapshot (since Archer C7 v4 is still only snapshot supported sad ), but i still have the SQM error that the kernel version does not match. I got the same when installing OpenVPN and used the force-dependency option to install it anyway. Is it safe to do this also for the SQM package? I thought it would be more low-level and i see warnings everywhere about using the force option in opkg.

When installing a snapshot build, install all the packages, especially kmods, that you need at the same time.  They will be replaced on the server with new versions the next day.   There isn't server space to keep every daily build.  Only release builds are archived.

The discussion might have continued from here.