-
Notifications
You must be signed in to change notification settings - Fork 21
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
utmp implementation #33
Comments
Well here's the thing with
From the musl wiki FAQ:
The only distribution I know of that has For further reading:
Hope that helps. |
@firasuke , oh no, that helps a lot! I just stumbled into an APKBUILD from Adélie Linux that shows
Its good to know I can check Adélie Linux to see how can get a utmpx implementation working. Now I know why when build utmps after MLFS, it's not used at all. |
Yup, there's also that. Don't forget to examine the resulting executables using your |
Looks like I found my first hurdle: inetutils. Can't decide if i should drop inetutils. Personally, I use
Created a patch to fix mismatch of types. Compile error goes away. Patch will be featured in MLFS-8.00 |
Completed mlfs-8.00 with utmp/utmpx implementation. Not sure how to test. elogind now no longer has error |
Nice, now hit |
Any updates on this? Did you try what I mentioned in the previous comment? |
Sorry, I had some strange issues: The i686 system had already built the final system Now back to your question:
^ is this expected output? |
... same output if i try same command on my Samsung Chromebook3 (GalliumOS 3.1) |
That's the known issue, Try running |
Just for reference, I booted an Artix Linux LiveCD and got a different output:
Artix uses Glibc though. I'll try a liveCD of Adelie Linux next |
I didnt want to waste a blank DVD to burn a 719MB LiveCD of Adelie Linux, so installed Adelie Linux on an old Thinkpad x61s. Yes, Adelie does output users when try Looks like, my bootscripts are not correctly running utmps? |
Unfortunately, that seems to be the case. |
Any updates to this issue? |
Its still on my to-do list. For my MLFS builds, i use pkgtools. I'm currently creating build scripts because some packages, like bzip2 have a broken install target. As a workaround, I manually copy files to my DESTDIR directory. Once i get the scripts done, I will just quickly update the scripts as I update MLFS repo. This should speed up building and testing. So far I'm at 54 scripts done with 39 to go. |
In my honest opinion, and based on my experience, Artix currently has the best s6 + s6-rc implementation, and I'd suggest that you spend some time understanding how they've implemented it. They also seem to have the closest vanilla implementation compared to the likes of Adelie (which uses OpenRC) and Obarun (which literally added an entire layer over s6/s6-rc). The only thing that Artix lacks is musl and utmps, and I think combining the knowledge gained from understanding both implemenations can get a working s6/s6+rc on musl with utmps fully working. The first glaucus release also used s6/s6+rc on musl (with utmps available and being linked to, but still not working), but I'm working on fixing that now. |
I tried to look into Obarun's 66 toolset/utilities but... couldn't figure out where the sources are and how to extract 66 from Obarun to use in in MLFS. It boasts that it makes it easier to work with S6+S6-rc. If I remembered correctly, my bootscripts are loosely based on what I understood from Obarun. I might scrap the Adelie Linux install on my x61 and install Artix for more s6+s6-rc research. If curious: |
I'd say Obarun's implementation is kinda their own thing now, even their s6/s6-rc stuff were archived and are no longer maintained in favor of 66. I recommend you study Artix's and Adelie's implementations more carefully. I think even alpine has s6/s6-rc packages now (but I believe they're not intended to be run as PID 1, but they're still considered valuable resources. Both Adelie's and Alpine's s6/s6-rc packages are maintained by Laurent Bercot himself as well. |
I rewrote my bootscripts by copying and modifying bootscripts form Artix and service scripts from Adelie Linux. My MLFS build boots after so many attempts but still no users listed for |
Ugh. I forgot to check apkbuilds of Adelie ! I missed a configuration option Adelie Linux stores the utmps ‘server socket’ in |
Oh it's a good thing that you checked. Artix doesn't use utmps (because it has glibc), and
But this shouldn't be needed with utmps because utmpd/wtmpd are provided. |
For Adelie, My build boots with that directory empty. I will check the configure options for all s6 packages and try again... current state of bootscripts does yield an error with udevadm so I might just rewrite from scratch instead of merging Artix’s boot scripts and Adelie’s utmps service scripts |
I'm very pleased with what we've accomplished here. Hopefully, we can tackle more problems in the future and come up with solutions for them. |
I enabled utmp in elogind and applied Adelie linux's patch to have source look for utmpx.h instead of utmp.h Now I got this warning during logins: Not sure if elogind needs more patching as |
For future reference: Apparently |
Strange. I forgot to patch the
System is using musl version 1.2.2 |
What!? Are you sure about that? |
Yeah. While building elogind for CMLFS, I noticed elogind was attempting to access I also know w was working because when I first booted a CMLFS build I had errors for utmps. W wasn’t working since utmps was using the wrong dynamic linker. After recompiling utmps, w was working. |
Apparently a WTMPX file was added: https://www.mail-archive.com/[email protected]/msg01560.html Upon checking #define WTMPX_FILE "/var/log/wtmp" What are your thoughts? |
According to the
|
I am currently building MLFS with updated sources.... including utmps-0.1.0.2. So i will try to skip some patching and see how effective this change may be |
Good luck with that, I still think we need to patch |
Oh also:
|
You are right, still need to patch those paths in musl libc headers... perhaps change paths to:
|
I rebuilt MLFS with latest SW as of June 2021... I accidentally packaged the whole rootfs instead of just my stage directory (where i fakeroot install)... which bricked the MLFS build.... nothing works (first bash couldnt resolved symbols then no commands and be found) unless i prefix every command with I get to util-linux and build fails. Same build instructions as before (no issue from what i can remember):
Not sure why util-linux needs
Then i check that header, as it belongs to musl (version 1.2.2 in this build):
wth. I removed that header, as i thought I am using skarnet's utmps to provide utmpx and not use musl's So i check
I thought musl only had stubs for utmp because it's hard to secure an implementation. Starting with musl-1.2.2, should I not remove headers |
Looking back at the beginning of this discussion, i should only need to remove musl's |
@dslm4515 So it seems that this is still an issue... After
What are your thoughts on this? Also is |
It seems that newer versions of I opened an issue upstream to track this. Perhaps we can have support for |
Thank you for bringing it up. I still have issues getting wtmp and/or utmp working. File itself is empty. But 'w' still works (somewhat-- lists users via ssh sessions but not on ttys? Maybe forgot to turn on support in shadow for utmpx?). S6-Linux-init no longer has a built in boot script for running utmps daemon, so I'm trying to figure it out. S6+S6-RC booting appears complex to me... tempted to back to runnit. But I do need to develop test(s) to make sure utmp/wtmp works. For me, I like to stay away from systemd. I've been using seatd and turnstile instead of logind/elogind for a year or two so far. |
No worries, thought I'd ask for your input on this.
True,
I believe Chimera is moving in the right direction. I have to say your projects are somewhat similar. |
I would like to think, I developed CMLFS first before Chimera, but of course that doesnt matter. lol
I think, I noticed that with by latest build of CMLFS. I can't remember. I'm using that build now to update BMLFS and see what breaks. I am behind on the 'base' repo, MLFS.
Yes,I did check that... I haven't saved my boot scripts to a git repo yet. But seems my script seems to work as |
Worse case scenario, I may end up [in far future] installing systemd/logind in |
The Musl Libc does not have utmp functionality built-in like glibc.
Perhaps skarnet’s utmps should be built before coreutils? Without it, some commands like
last
will report/dev/null/utmp is not a directory
The text was updated successfully, but these errors were encountered: