ymir-linux / void-packages

The Void source libre packages collection
https://voidlinux.org
Other
7 stars 2 forks source link

"Linux-libre" on uname -s #25

Open reback00 opened 4 years ago

reback00 commented 4 years ago

Currently our Linux-libre kernel builds show Linux when run uname -s. It would be great if it showed Linux-libre. It would make it easy to identify if the user is actually running Linux libre.

I found this answer and this in-depth one showing it's comparatively easy to do. Usually it needs change in include/linux/uts.h on the UTS_SYSNAME value.

drake-newell commented 4 years ago

Would we employ it as an xbps-src patch?

drake-newell commented 4 years ago

I've made a patch, I'll try to see if it builds later today

drake-newell commented 4 years ago

The patched kernel built but uname -s still returns Linux. Odd

drake-newell commented 4 years ago

I think I forgot to force rebuild it and that version was already indexed. I'll force it or just let it build on next release

reback00 commented 4 years ago

I was thinking about a scenario. If we change output of uname -s, can it break any scripts or something? I mean if those scripts use the output of uname -s. There is another option, uname -o. Although I'm not sure if that can be changed and if that can also cause a break.

But then again, as much as I've searched around nobody warned against it. So I guess it's alright.

drake-newell commented 4 years ago

I think it does break something. I had to run an appimage of android studio and it didn't work because the kernel name was unknown to it.

reback00 commented 4 years ago

Hmm. Then maybe this is not a good idea afterall. Will changing output of uname -o will do the same?

If it's a problem too, maybe we can introduce a ymir-info program to check whether linux-libre (and if we're doing this also the ymir repos) is installed/running. We can keep that in a ymir-utils package. This way it doesn't affect existing functionality at all, and we can get the output without issues.

EDIT: Example output maybe something like:

$ ymir-info
Ymir repos: Installed
Linux-libre kernel installed: Yes
Linux-libre kernel running: Yes
Linux-libre kernel version: 5.8.16_1
Base system: Void Linux
$ ymir-info -k
Linux-libre kernel 5.8.16_1 running
drake-newell commented 4 years ago

That seems like a good idea.

reback00 commented 4 years ago

@drake-newell I've written a script for ymir-info here. It's sh based, so should work even on bare bones systems.

Sample output:

$ ymir-info
Ymir repos: Installed
Linux-libre installed: Yes
Linux-libre running: Yes (5.8.14-gnu_1)
Base system: Void Linux

Parameters work for now:

It's just a first draft. Feel free to improve / discuss upon it.

drake-newell commented 4 years ago

@drake-newell I've written a script for ymir-info here. It's sh based, so should work even on bare bones systems.

Sample output:

$ ymir-info
Ymir repos: Installed
Linux-libre installed: Yes
Linux-libre running: Yes (5.8.14-gnu_1)
Base system: Void Linux

Parameters work for now:

  • -a: All info
  • -b: Base system info
  • -k: Kernel info
  • -r: Ymir repo info

It's just a first draft. Feel free to improve / discuss upon it.

I'll take a look

reback00 commented 3 years ago

I just commited changes to base-files package for lsb_release liberation. This should return Ymir values instead of Void ones. After the package is built and updated on our repos, running lsb_release -a should return:

$ lsb_release -a
LSB Version:    1.0
Distributor ID: YmirLinux
Description:    Ymir Linux
Release:    rolling
Codename:   ymir

So this kind of helps this issue a little bit, but does not solve this one:

identify if the user is actually running Linux libre

So I think we'd still have to look into ymir-info.

EDIT: Added output

drake-newell commented 3 years ago

Cool! Good work. I'll recompile base-files. EDIT: base-files has been updated, I can confirm that it works on my end. We may want to update the website to reflect the new output.

reback00 commented 3 years ago

We may want to update the website to reflect the new output.

Yes, of course. One thing though. Initially I arranged the commands in such a way so that it is clear we're on Void Linux system and using libre stuff. This way at a glance it was clear what it does. But now what?

One idea I had around is to use some xbps- command. xbps command is not speaking Void Linux out loud, so nonfree name is not there, but still says Void indirectly. Like:

$ xbps-query -R linux-libre | grep pkgver
pkgver: linux-libre-5.8_1

I was thinking of placing it instead of uname -rm. And then updating the output of lsb_release -i to say YmirLinux. What do you think?

EDIT: minor edits