_whitelogger has joined #crux-musl
<dlcusa> emmett1, SiFuh: I have the MUSL setup completed with its default kernel and grub config. Initial issues are needing to get the root filesystem mounted rw and getting networking set up which setup never asks about). Compiled rc appears to be doing its job as expected, but I'm early in the testing.
SiFuh has quit [Remote host closed the connection]
SiFuh has joined #crux-musl
farkuhar has joined #crux-musl
<SiFuh> farkuhar: https://dpaste.com/6SG7DUZHX.txt satisfied?
<farkuhar> SiFuh: That should be fine. An absolute path to /usr/bin/setfont would be more consistent with the other commands, though.
<SiFuh> Yeah, I was planning to later on with a most called commands. At the moment, I am still stuck on the runlevel issue.
<dlcusa> I did an "init S" and was prompted for the root password immediately.
<dlcusa> Of course, there was no active network interface.
<SiFuh> dlcusa: It's pretty quick at shutting everything down.
<SiFuh> farkuhar: Alright, FONT is done, and also added the full path. I added you big scary fsck screen line in. /* Then display the big scary fsck screen */ For fun. I removed the // ukky mentioned that was only there temporarily anyway. I have added more printf functions but commented out for debug purposes. I tested rc.local, rc.modules, rc.shutdown and rc.fix and they work perfectly. I have see nothing
<SiFuh> wrong with them all. I have added a tweaked version of the RUNLEVEL and PREVLEVEL in and fixed the rc.single and rc.shutdown to support reading them. Also changed the shut down features to use sys/reboot.h rather than calling for commands directly.
<SiFuh> a tweaked version of ukky's RUNLEVEL and PREVLEVEL*
<SiFuh> Oh and I found fclose(vgdisplay) when it should be pclose(vgdisplay)
<dlcusa> My best guess is dracut did not include the necessary modules for enp10s0 to become available. I'll have to learn more about that, and my time for this is rapidly drying up.
<dlcusa> And I'll be AFK for the rest of the day, offered as punctuation to the foregoing availability info.
<SiFuh> Heh, I uploaded the wrong one. Fixed now.
<ukky> SiFuh: why do you have AI-generated comments in your code? All of them can be removed without affecting readability of your code.
<SiFuh> I didn't
<SiFuh> I added them myself so I can see where I am at and what I am doing.
<SiFuh> ukky: It's a test version. I will strip it down when it is production ready.
<ukky> SiFuh: okay
<SiFuh> ukky: I am assuming youa re talking about this crap /* String pointers */
<ukky> SiFuh: yes. But not only those. Like 99% of comments just explain what next C-statement does. That C-statement is so obvious that the previous comment is not required.
<SiFuh> ukky: I need to remove the comments from this line prevlevel = getenv("PREVLEVEL"); 727. Silly me
<SiFuh> ukky: Yes, but I can find it faster when scrolling through.
<SiFuh> Some sections are slightly similar and I don't want to edit the wrong sections.
<ukky> In rc.c, trim_whitespace() does not tream leading spaces. The function trims only trailing spaces. You have two options to fix that: a) Shift string to the left by amount of leading spaces; or b) Pass pointer to pointer as argument to the function
<SiFuh> ukky: Something like this? https://dpaste.com/9YSPZVKJ2.txt
<SiFuh> Hmm maybe not, wait..
<ukky> Handbook has to mention that 'CONFIG_DEVTMPFS=y' is a must-have option when sysvinit and UDEV is used. Both shell-rc and C-rc should check for this option before mounting /dev.
<SiFuh> Okay, I think I got it. Add this if (*str == '\0') { return; } Just before /* Trim trailing space */
<SiFuh> Hmm checking might be difficult if you don't have /proc/config.gz
<farkuhar> The modular kernel config that's provided on the ISO already has CONFIG_DEVTMPFS=y. I'd be surprised if the user later disabled it without considering the consequences. As for the users who strike out on their own with `make menuconfig`, sure, the Handbook could be expanded to mention this setting.
<SiFuh> Using the pedantic shit to compile. Heh
<ukky> Handbook mentions CONFIG_DEVTMPFS in a note about config from ISO.
<ukky> On my system CONFIG_DEVTMPFS is not required. CONFIG_TMPFS is used for /dev instead.
<SiFuh> ukky: Why did you take that path?
<ukky> SiFuh: I do not use code from SystemD. UDEV is SystemD creation.
<SiFuh> dev /dev tmpfs defaults 0 0 <-- Like that?
<SiFuh> ukky: oooooo I didn't know. She we should dump udev
<ukky> SiFuh: This is my /dev: mdev-tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=10240k,mode=755)
<SiFuh> farkuhar: So I guess outlaw cruxial crucial will have to drop udev
<ukky> What are you gonna use instead? Static /dev, like BSD?
<SiFuh> Sure. Hahaha
<SiFuh> ukky: What do you suggest/recommend?
<ukky> I use mdev from busybox.
<SiFuh> Hmmm eudev mdev devtmpfs udevd
<ukky> eudev and udev is the same thing.
<ukky> udevd is part of udev
<SiFuh> So if we want to keep it simple, we'd have use devtmpfs
<SiFuh> Could always make udev ports/opt and comment out the udev stuff in rc.c
<SiFuh> And the BASH rc
<SiFuh> Or a BASH function that will use udev if it is installed
<ukky> SiFuh: Yes. You can just expose devtmpfs via /dev. And you need to think what should be done for hotplug devices.
<SiFuh> Well I don't hotplug that I am aware of.
<ukky> USB devices
<SiFuh> I only use USB drives but I manually mount those.
<ukky> You will not have symlinks for those. UDEV handles them
<SiFuh> I only remember using udev for a Wi-Fi dongle a few years ago. What are these symlinks you speak of?
<SiFuh> I just do this. mount /dev/sda1 /mnt/
<SiFuh> And I have a whole pile of shell scripts to do it for me depending on the name of the USB drive.
<ukky> udev might create symlinks to help identify your device by serial number, for example
<farkuhar> Heh, I just pre-populate /etc/fstab with dedicated mount points and the associated options, and then call /bin/mount with a single argument (the mount point). That way it automatically passes the correct filesystem arguments to /bin/mount.
<SiFuh> On OpenBSD, I use hotplugd like this. https://dpaste.com/FQTJC4DSX.txt
<ukky> udev also maintains some directories in /dev, I forgot, like disk-by-path, or disk-by-label
<SiFuh> But I still manually mount drives in OpenBSD with my shell scripts.
<SiFuh> farkuhar: So what do you think. Default to devtmpfs and those who want udev can install it from opt and the rc shell script can autodetect if udev is being used?
<ukky> No auto-detection. rc.conf should say DEVMGR=none|udev|mdev
<SiFuh> ukky: I did think of that.
<farkuhar> I agree, no need to try auto-detecting anything. We can't guarantee that the user will have /proc/config.gz available for inspection by rc.
<SiFuh> Well that's 4 of I guess in agreeance. serpente agrees too.
<SiFuh> farkuhar: /proc/config.gz or the location of the config or .config or the name of the config. And you need to detect kernel version and it would be pretty dumb to expect the user to keep /usr/src/linux-$(version)/.config
<SiFuh> And I am not aware of any other way to detect that.
<farkuhar> SiFuh: Of all those possibilities, only /proc/config.gz is guaranteed to correspond to the configuration of the running kernel. Any leftover .config on the filesystem might be outdated.
<SiFuh> gzip: /proc/config.gz: No such file or directory
<SiFuh> Hehe
<SiFuh> I don't configure that option due to security reasons
<ukky> /proc/filesystems can be used to check if devtmpfs is available
<ukky> And I agree with SiFuh, /proc/config.gz should not be referenced anywhere, as user might disable it.
<SiFuh> ukky: Funny you mentioned /proc/filesystems I had a bit of an issue with figuring out how to get devtmpfs out of it in the rc.c
<SiFuh> nodevdevtmpfs
<ukky> Skip optional "nodev", then skip mandatory "\t", then you have your filesystem keyword.
<SiFuh> ukky: I figured it out last week. But thanks anyway ;-)
<ukky> SiFuh: If I knew you already fixed your code I would not spam the channel
<SiFuh> All good
<SiFuh> ukky: And for the record. sAI sucks at code. I only use it find when I missing a } or some errors.
<ukky> SiFuh: No idea, I do not use AI at all, especially when coding.
<SiFuh> Well it is a waste of time to even try. zorz_ knows too.
<SiFuh> Ask it to find a missing brace and it reqrites your damned code and then forgets out important parts and moves shit around that will just never work.
<SiFuh> rewrites*
<SiFuh> forgets/leaves*
<ukky> A friend of mine was trying to sell me the idea, but after a few questions I figured it is total Bravo Sierra.
<SiFuh> Heh.
<SiFuh> Similar here.
<ukky> So, no, I prefer to introduce my own bugs to the code, at least I'll be able to fix them knowing my code.
<SiFuh> Or it goes in circles. Try this and this and this. Then next question it repeats the same tests you already provided. I was laughing a few weeks hack when I was checking a script of mine. It said it had problems and it provided me with my exact same code unchanged as a solution.
<SiFuh> hack/back
<ukky> There is also copyright issues when using AI. So, AI probably is not a good idea, as coder has to mention the source.
<SiFuh> Hahaha the world is mad
<ukky> The world for people with patents is even crazier.
<SiFuh> Here many people use it to do their work. And it is so full of errors and just wrong. I can tell if they have used sAI to write a letter to correct their English because Malay's are not really good at writing with emotion and when they use the sAI it doesn't have it either.
<SiFuh> They lose the fluidity of speech as well. Sounds very much robotic
<ukky> A few messages more and farkuhar will ban us
<SiFuh> ukky: Like some of those patents that are just thoughts and provide no real working examples.
<SiFuh> And I even saw in the Chinese patent database patents for recipes. Recipes for making alcohol or food.
<SiFuh> Shouldn't even be legal. 'Oh I might patent a loaf of bread'
<ukky> SiFuh: No, I meant patent sharks, which file patent infrigement case to make a deal with you, so you pay them money.
<ukky> s/infrigement/infringement/