IRC channel logs

2024-01-23.log

back to list of logs

<Googulator>it would be much better to just ship that one file
<fossy>tbh, i'd be happy just including https://hg.mozilla.org/releases/mozilla-beta/file/tip/security/nss/lib/ckfw/builtins/certdata.txt as the distfile (Well tied to a commit)
<stikonas>well, right now just GTS Root R1 certificate is sufficient to download rest of ca-certificates
<stikonas>but that's depending on them keeping to the same cert
<fossy>mm, ca certificates are one of those things that will inheriently break at some point in the future :\
<stikonas>indeed...
<stikonas>but by shipping just one we risk breaking a bit more frequently
<stikonas>as server admins in general are free to change certificate providers
<fossy>"An unfortunate blemish is that we number build scripts from 1, but repo tarballs from 0 - it would be nice to standardize on a single indexing convention."
<fossy>Googulator: you make a good point, actually
<fossy>not one i had ever thought of, to be honest!
<fossy>i had in my brain, pass1.sh is "1st pass", pass2.sh is "2nd pass", ...
<fossy>and revision is a counter, so it should start from 0
<fossy>but you're right, it's not very logical
<stikonas>just add 1 to revision?
<fossy>yeah perhaps revision should start at 1
<oriansj>wouldn't the let's encrypt certificate work too? as we could host an updated set of root certs which then we update on a yearly basis, should limit the breakage.
<oriansj>as they tend to give lots of warning to root cert changes.
<stikonas>yeah, we could host ca-certificates there...
<Googulator>fossy, stikonas: can you please review https://github.com/fosslinux/live-bootstrap/pull/415 for any pregen files I may have missed?
<nimaje>hm, there is an incomplete public domain libc, maybe some of it can be integrated into meslibc
<nimaje> https://github.com/dryc/libc11/
<matrix_bridge><Andrius Štikonas> nimaje: is it not smaller than meslibc?
<matrix_bridge><Andrius Štikonas> Looks like meslibs is far more complete
<nimaje>I didn't look how they compare, I expected that it at least has some stuff that meslibc has not, but it also has a tabel of libc comparisions at the bottom of the readme
<matrix_bridge><Andrius Štikonas> Well there might be some things. But then you can just steal them from any other libc
<Googulator>Mikaku: are virtual consoles (i.e. Ctrl+Alt+F2) supported in Fiwix?
<Mikaku>Googulator: yes, up to 12 virtual consoles
<Googulator>Is there a way to activate them before we can build kbd?
<Mikaku>they are already enabled, you just need to run *getty on them
<Googulator>live-bootstrap has no getty...
<Googulator>I was thinking the equivalent of "openvt -- bash -i"
<Googulator>but before we have openvt built
<Mikaku>kernel won't give you such a service, this belongs to user land
<Googulator>I mean, what is the "magic" (some system call or IOCTL I presume) that getty does to enable Ctrl+Alt+F[n]-ing to that console? I presume simply opening the relevant TTY and trying to talk over it isn't enough.
<Googulator>i.e. one can't just redirect I/O to /dev/tty2 and expect Ctrl+Alt+F2 to work
<Mikaku>well, yes, you need to open(/dev/tty2", ...) to be able to read/write on it
<Googulator>But is that enough to enable the key combination?
<Mikaku>oh yes, you can redirect anything you want there, it will work
<Googulator>AFAIK on Linux it's not
<Googulator>you have to issue a "magic" IOCTL, otherwise Linux will ignore Ctrl+Alt+F2
<Mikaku>Linux doesn't permit you to switch to an unopened virtual console, but as soon as you redirects something to them then you can switch to it
<Mikaku>Fiwix permits you switch to any virtual console, don't need to previously redirect something to it
<Mikaku>I tested on the old Linux version 2.0, don't know if this changed on newer Linux kernels
<Googulator>strange, I seem to remember testing (on a newer kernel), simply doing "echo test > /dev/tty2" doesn't enable Ctrl+Alt+F2
<Mikaku>well, define 'enable'?
<Googulator>Ctrl+Alt+F2 remains ignored after that simple test
<Mikaku>you mean that you cannot switch to tty12?
<Mikaku>err .. tty2
<Googulator>No, or at least not via the key combo
<Mikaku>then they changed it
<Mikaku>with older kernels it worked as it
<Googulator>If I then use openvt or getty on it, I can then switch, and see that "test" did in fact get printed - but some poorly documented "magic" is clearly needed
<Googulator>oriansj: do you know why bash-2.05b was picked for the early shell, from all versions?
<matrix_bridge><Andrius Štikonas> Googulator: I kind of know
<Googulator>2.05b is unfortunately the last version not to support "set -E"
<Googulator>which is needed for the interactive trap
<matrix_bridge><Andrius Štikonas> We picked it because guix used that in bootstrap
<matrix_bridge><Andrius Štikonas> And meslibc was known to build it
<matrix_bridge><Andrius Štikonas> You could try to update it
<matrix_bridge><Andrius Štikonas> But set -E might need new stuff in libc
<Googulator>-i mode is kind of broken right now because of this - it doesn't crash, but has a nasty side effect of checksum failures not trapping until the 2nd bash is built
<Googulator>so "-i" will spuriously succeed if one of the early packages has a bad checksum without --update-checksums
<matrix_bridge><Andrius Štikonas> We should try to rebuild bash earlier....
<matrix_bridge><Andrius Štikonas> Once musl and I guess autotools are avaable
<Googulator>Strangely there is a pass2 script included with bash-2.05b, but it's unused
<Googulator>and I haven't seen any point in the history where it was used
<matrix_bridge><Andrius Štikonas> There was I think
<matrix_bridge><Andrius Štikonas> But short...
<matrix_bridge><Andrius Štikonas> Oh maybe https://github.com/fosslinux/live-bootstrap/commit/da9a2c6c50f9fafff4ea3b8393443f469f5f0d81
<Googulator>looks like redirecting bash to /dev/tty2 does work in Linux
<matrix_bridge><Andrius Štikonas> Googulator: https://github.com/fosslinux/live-bootstrap/commit/16cd5be62610fbc5e0eae90358cf0c15ca72316c
<matrix_bridge><Andrius Štikonas> It was used in this commit
<matrix_bridge><Andrius Štikonas> But prob reverted later
<rickmasters>Doing an earlier bash 5 was reverted because I couldn't get it to build on Fiwix. That was holding up kernel bootstrap integration.
<rickmasters>Some discussion here: https://logs.guix.gnu.org/bootstrappable/2023-03-05.log
<rickmasters>I gave up here: https://logs.guix.gnu.org/bootstrappable/2023-03-08.log
<Googulator>Mikaku: testing multiconsole now in Fiwix 1.5.0-lb1 - looks like there's a weird bug
<Googulator>Bash did start on the 2nd console, but the build output gets printed on whatever console I switch to
<Googulator>instead of staying on tty1
<Mikaku>Googulator: did you set the console to /dev/tty0?
<Mikaku>if the output is redirected to /dev/console then it will appear on the current tty
<rickmasters>It turns out that I removed the rebuild of bash 2.05b in the commit for kernel-bootstrap:
<rickmasters> https://github.com/fosslinux/live-bootstrap/commit/ecf99ab08b09c0da98af8e136c99867d8392f8bd#diff-349a44bc9ca6b335170dd658fd6b664e26d96a15e24d3ec29289c11b55f04bf3
<stikonas>perhaps you had some issue
<rickmasters>Unfortunately, I cannot remember why I did that. It may have been a mixup with how we reverted bash 5 in that location.
<stikonas>and didn't have time to investigate
<stikonas>or maybe some mixup
<stikonas>in any case, might be worth attempting to readd it
<stikonas>or try newer bash...
<rickmasters>It may be that I somehow discovered we didn't really need to rebuild it and thought it was simpler without it.
<rickmasters>stikonas: Do you remember why we rebuilt it? It involved transitioning to run2.sh to it wasn't without complication so I'm assuming there was a reason in the first place for it.
<stikonas>well, yeah, rebuild is optional
<stikonas>oh it was just to have interactive bash earlier
<stikonas>it's better for error handlign
<stikonas>you get a shell to investigate
<stikonas>rather than just error out with subprocess error
<rickmasters>ok, so there was something in a dependency that enabled that?
<matrix_bridge><Andrius Štikonas> Well, just new libc
<matrix_bridge><Andrius Štikonas> Meslibc does not have required headers
<matrix_bridge><Andrius Štikonas> And first version is built with custom makefile and minimal features
<rickmasters>I can try to add back the rebuild.
<lrvick>Is there any particular reason for the whole coreutils/curl stack in live-bootstap and friends? I have been building kernel, binutils, gcc, musl, and even all the way up to rust 1.74 with just busybox as a base.
<lrvick>given I hashlock everything even busybox wget has been fine
<rickmasters>lrvick: not sure I understand. live-bootstrap can build from "scratch" so it won't presume having busybox to start with.
<rickmasters>The idea is to strictly limit the seed binaries to start with. Currently that's down to a single binary boot sector and everything else must be source code.
<rickmasters>Of course there is a ton of python code to prepare the boot disk image but in theory that could be done "manually".
<stikonas>lrvick: busybox is not easy to build
<stikonas>probably a lot of requirements on libc
<rickmasters>stikonas: So bash-2.05b does not rebuild on Fiwix. There are faults in configure, related to signals.
<stikonas>oh I see
<stikonas>so ./configure exists with non-zero code?
<stikonas>or some other failure mode?
<rickmasters>It's general protection faults. Its funny because I was complaining about the upgrade to bash 5 but bash 2 didn't work either.
<rickmasters>Its making me think that I dropped the rebuild on accident and somehow thought it was working...
<rickmasters>I'm not sure. But I can give it another shot. I've got more time now.
<stikonas>sure, that would be very helpful
<stikonas>I would look myself, but quite busy with all other bootstrapping stuff...
<rickmasters>Actually it's faults in configure and then later it faults on bison -y -d ./parse.y
<stikonas>hmm, sounds like quite a few issues...
<rickmasters>Yeah, it's gonna take a while.
<Googulator>Mikaku: I believe the main build is running with no redirection at all
<Googulator>When Fiwix is booted via kexec-fiwix, it executes /init (explicitly set via custom_kernel.h), which is actually a binary of kaem
<Googulator>It defaults to then running the script kaem.x86
<Googulator>sorry, kaem.run
<Googulator>kaem itself doesn't support redirection
<stikonas>yeah, it can't support that easily
<stikonas>we want it to run on simple kernels too (i.e. builder-hex0)
<Googulator>kaem.run calls /steps/1.sh (actually a kaem script, not a bash one), which builds bash, then calls the next stage as "bash /steps/2.sh"
<Googulator>again, no redirection
<Googulator>2.sh then sources /steps/improve/open_console.sh, which hooks up a "fake-interactive" bash shell directly to tty2
<Googulator>the exact command is bash -c 'while true; do printf "[early Bash - use Ctrl+D] $(pwd) # "; $(cat /dev/tty2); done' &> /dev/tty2 &
<Googulator> /dev/console is never touched
<Googulator>in fact, the file /dev/console doesn't even exist until right before open_console.sh is sourced
<Googulator>so it appears Fiwix is wrongly defaulting to /dev/console instead of /dev/tty1 for init output
<Googulator>hmm, it could actually be kexec-fiwix instead that messes up
<Googulator>in kexec-fiwix, we pass "console=/dev/ttyS0" in qemu mode
<Googulator>but in bare metal mode (where virtual terminals are actually relevant), we pass no "console=" at all
<Googulator>relying on internal default
<Googulator>and the internal default is /dev/tty0
<Googulator>which is apparently a shorthand for the current console, just like /dev/console (?)