Crux Linux!

The place to discuss Linux and Unix Operating Systems
Forum rules
Behave
Post Reply
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Crux Linux!

Post by Grogan »

When I was looking for a new non-gaming OS, with automated builds, and fought with Gentoo, Crux seemed dead and hadn't had any activity in years. By coincidence, I followed a link to https://crux.nu/ and saw:
News

2025-04-21: CRUX 3.8 released

CRUX 3.8 has been released! Please check out the Release Notes, the ChangeLog and the Handbook, and download CRUX 3.8 right here.
I completely missed that, I'm glad to see it back again. I may not be able to rely on its longevity (or frequency of updated builds for things) like I can with Gentoo, but I really liked Crux and I'm going to ditch Gentoo in favour of this. I really dislike fighting with Gentoo. I have everything set up now so nothing bothers me, but it still hinders me.
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Crux Linux!

Post by Zema Bus »

I might have to take a stab at that :)
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

This could be problematic for me, as it installs glibc 2.40 and gcc 14.2. This means no binaries compiled on Arch (or previously compiled on Gentoo like my stuff in /opt or /usr/local) will run. There are things I compile on Arch for both systems, firefox being the most significant.

There IS an updated ISO but I don't know how up to date. The current one is May 31, which I have downloaded.

https://crux.ninja/updated-iso/

Also I have to find a way to drop in a kernel config during the install. I don't want to go through it all from scratch, I don't need that exercise, it's just tedium (I don't need to "learn", I've been configuring kernels for decades). I hope there are util-linux binaries in the install environment, like mount. There'd have to be, whether I get the opportunity to manually mount and copy a file.
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Crux Linux!

Post by Zema Bus »

One idea I had when I was considering this previously was to add some files to the iso (in my case, my kernel and modules compiled in Slackware to expedite things) so that they'd be accessible during the installation.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

It occurred to me that what I want to do, is simply skip the kernel and bootloader. I'm pretty sure I'm at the console and I have to cd into /usr/src/linux and make menuconfig etc. so I can just not do that. After the install and configuration, instead of booting it, I'll just boot to Arch, and mount the partition and drop in my kernel image and my modules tree. It's going to be the exact same kernel anyway, as I intend to compile the kernels on Arch and install to both as I've been doing for ages.

It should just boot after that. At that point the only change in grub.cfg will be to rename the stanza from Gentoo to Crux :ugeek:
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

Well... fuck this silly crap. Something is wrong with the ISO. It boots and everything, but when I start "setup" it immediately fails on "Directory /media/crux not found. Aborting". It's not a bad download, it's a bad image (that updated ISO). I checked md5sum of the ISO right on the USB stick (Ventoy), so it wasn't a truncated copy either.

Of course, I find this out AFTER formatting my Gentoo partition. I can restore that from tarball backup (created last night) but it pisses me off enough that I'm not going to bother with this exercise, I'm just going to blast Gentoo back on there. Fuck... I woke up early to get started on this today, too.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

Ahh I see what's going on. Because of the stupid way this is set up, it thinks the media is on /dev/sda2 which it mounts at /media. It's the ventoy boot partition. sda1 is the partition that contains the bootable ISOs on the Ventoy stick. It shouldn't be trying to mount that either.

It shouldn't be mounting outside of its image that I'm booted with, that's really stupid.

I can't do anything about that, so I'd have to write the ISO directly to a stick. That's bullshit, I've installed many things, Windows and Linux distros on different computers, from that Ventoy stick. I'm unwilling to tear down this stick, and I don't want to go out, so I sacrificed my music stick from the car for now. It's taking a while to write the image to that crappy thing with dd, especially with sync (but I don't want to be second guessing buffering and write caching here)

Code: Select all

dd bs=4M if=crux-3.7-updated.iso of=/dev/sda status=progress oflag=sync
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I got it done, that worked and it only took about a minute to install the core packages. I'm going to compile everything else from ports (and then glibc, gcc and all again later... I'm going to have to figure out how to customize builds of system packages because I'm going to need glibc 2.41 and gcc 15.1 (for libstdc++) if I want to be able to run the common binaries I compile for both OSes)

I didn't install grub or do the kernel and I'm going to mount the partition and finish the setup from Arch now (where I can paste :-) ). As near as I can figure, the only thing I need to chroot for since I'm not installing grub or kernel is locale-gen but I can do that after getting the system booted for the first time (it'll be C.UTF-8 until I do that).
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

Nice filesystem layout... no usrmerge and it uses lib (with lib64 a symlink) like Arch instead of the bass ackwards way that most distros do it where lib is 32 bit. I'm not going to have any lib32, but I like "lib" vs. lib64.

Code: Select all

[nicetry crux]# ls -l
total 84
drwxr-xr-x  2 root root  4096 Jun  3 14:12 bin
drwxr-xr-x  2 root root  4096 May 31 01:10 boot
drwxr-xr-x  4 root root  4096 May 31 01:10 dev
drwxr-xr-x 19 root root  4096 Jun  3 14:12 etc
drwxr-xr-x  2 root root  4096 May 31 01:10 home
drwxr-xr-x  7 root root  4096 Jun  3 14:12 lib
drwxr-xr-x  2 root root  4096 Jun  3 14:12 lib32
lrwxrwxrwx  1 root root     3 May 31 01:10 lib64 -> lib
drwx------  2 root root 16384 Jun  3 13:03 lost+found
drwxr-xr-x  2 root root  4096 May 31 01:10 mnt
drwxr-xr-x  4 root root  4096 May 31 01:10 opt
drwxr-xr-x  2 root root  4096 May 31 01:10 proc
drwxr-x---  2 root root  4096 May 31 01:10 root
drwxr-xr-x  2 root root  4096 May 31 01:10 run
drwxr-xr-x  2 root root  4096 Jun  3 14:12 sbin
drwxr-xr-x  2 root root  4096 May 31 01:10 sys
drwxrwxrwt  2 root root  4096 May 31 01:10 tmp
drwxr-xr-x 11 root root  4096 May 31 02:21 usr
drwxr-xr-x 12 root root  4096 May 31 02:19 var
Nice old school system, with a simple init script setup in /etc/rc.d
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I have it booting now and got everything right on the first go, despite not following their instructions :twisted:

The core install didn't install any firmware, so I just copied my /lib/firmware/amdgpu and rtl_nic directories (the only ones I use) from Arch along with the kernel and modules. I just manually install and update those from the current linux-firmware tarballs from kernel.org and I'd rather not have that be a system package anyway.

I did decide to chroot (from Arch) because I forgot to run passwd on the root account (and that doesn't end well, I'd be unable to log in because of PAM policies) and I generated my locale at the same time.

The network setup is easy, and I dropped in a udev rule for it to use eth0 instead of that stupid enp5s0 nomenclature that I hate. That's even stupid, because if the bus numbering changes (e.g. install a PCI-E card in a slot, like an NVME adapter or something) that's broken whereas my rule uses the MAC address.

Now I have to create my user (I'll just use useradd/groupadd my way), set up my bash environment... then start building packages (oh, is that all). I'll get openssh built first so I can work from the other box.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I just had ONE brainfart, but it's a big one. That "updated ISO" is Crux 3.7. Dated May31, it let me forget that the latest version of Crux is 3.8. Also, the U.S. mirror I was using doesn't have 3.8 which helped confuse me.

So I installed Crux 3.7 with the latest updates for that :lol:

So I've pretty much got to start over. I'll preserve the work I've done in /etc at least.

P.S. with everything already worked out (and edited files in /etc dropped in) that only took about 5 minutes to get back to where I was after making a new USB stick with the RIGHT iso this time. Everything is much the same, still the old school filesystem layout and stuff in 3.8
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

openssh is already installed in core, so all I had to do was add "sshd" to the services line in /etc/rc.conf (and I dropped in my sshd_config and ssh_config files from Arch, as they have edits and added directives). I'll recompile it later.

It's this simple:

Code: Select all

#
# /etc/rc.conf: system configuration
#

FONT=default
KEYMAP=us
TIMEZONE=Canada/Eastern
HOSTNAME=nicetry
LANG=en_US.UTF-8
SYSLOG=sysklogd
SERVICES=(lo net crond sshd)

# End of file
However, what's not simple is compiling xorg. There's no "meta" or anything, I'd have to script it myself to build the ports in order. Or maybe just list them all on the command line in the right order with "pkgmk -i -d". I'm not sure how I'm going to do this yet. I downloaded all the ports with "ports -u" but I have to sort those deps before I can do much else.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

It's actually not SO bad, I can use prt-get to resolve dependencies

Code: Select all

prt-get depinst xorg-server
Is pulling in a lot of it. For example it's going to build Mesa, and before that it has to compile LLVM etc. (I'll get those fixed up later, my way... the Pkgfiles look pretty easy to edit and this build system isn't going to break my balls like Gentoo's)

This isn't all, but after that, I'll find something else in xorg that has a lot of dependencies in the Pkgfile and it will build those components too :-)
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Crux Linux!

Post by Zema Bus »

Pretty slick installation :thumbsup:
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I got xorg all compiled and fluxbox for something simple to test with. They didn't have fluxbox, I had to go and get. Moreover, I had to get it with git because the release tarball won't compile.

No web browser or anything yet though, I'm going to have to upgrade glibc and gcc so I can run my firefox builds. I was debating just compiling a firefox here for now, but might as well concentrate on that first.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

It's starting to take shape. I built gimp right away, because I wanted it to build a shit tonne of dependencies. That even builds Rust because of librsvg. All the xdg desktop stuff and gtk+ machinery that I'm going to need to compile XFCE (I'm going to do a manual build of 4.18 to /opt/xfce). I don't much like Gimp 3.0 and I may remove it and build 2.10 for /usr/local but for now...

I had a bit of trouble with it. My end result wouldn't run, it was crashaborting because it couldn't load the schemas in /usr/lib/glib-2.0 for some reason. I think it was a case of something needing to be recompiled because the first compile was missing functionality because it wasn't there yet (configured without it). I recompiled glib, gtk3 and gimp again after that and it worked. They don't make reinstalling packages easy, it just tells you its already installed. You have to use "update" and force. -fr is force rebuild, with just -f it would force the already built package to reinstall.

Code: Select all

prt-get update -fr packagename
Another thing that's a pain in the ass with prt-get are "footprint" changes. The package has to have the same directory listing (directories and filenames) or it will refuse to install. At that point the package is built and you can manually install it with pkgadd though, but it fails and interrupts the operation and you then have to start it again to build the rest of the deps and the package. If you know about it you can use "-if" (ignore footprint) but it's more likely you'll find out then. For example, I don't have zsh installed, so my Rust build didn't create the zsh completion file. Therefore the footprint failed.

I've given up on maintaining Arch binary compatibility, it's not practical with this system, too much work. I could keep Gentoo up with it by using testing versions of ebuilds (and a few workarounds even at that) but this won't move fast enough.

Anyway, I've got my eyes back. My file manager and terminal (they didn't have urxvt) and stuff and my shell environment set up the way I like it. I'm a bit disoriented without those things. What I like about fluxbox is that it's usable for me out of the box, with just a few edits to the menu file. I always use that green gradient style ("Outcomes", it's my favourite) that has always been there.

Open image in new tab. The fonts look like shit at this scaling.

crux-with-flux.jpg
crux-with-flux.jpg (606.19 KiB) Viewed 437 times
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I build the firefox port in contrib (the one in opt is firefox-bin... I don't do binary repacks) with some edits to the Pkgfile. It looked pretty straight forward, so I thought I might as well use it to get node.js and cbindgen etc. built for it. I enabled alsa because this is just going to be a pure ALSA system, no pusaudio or pullwire. Because I can.

After a bit of poking with alsamixer (channels muted) I have audio in youtube. At this time firefox is the only thing I have that uses audio.

I copied over my gtk styling and ~/.mozilla directory. Even though this is the exact same version, 139.0.1, release channel, it STILL wouldn't use my profile, I had to manually connect it in the .ini files. They really want you to start firefox with a fresh profile so they can expose you to their gimmicks.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I thought I was going to get away without installing Wayland too, but forgot that firefox would then be unable to build the cairo-gtk3-x11-wayland toolkit. That gets to use DMABUF_WEBGL on both x11 and wayland.

So I had to rebuild my gtk3 after installing wayland and wayland-protocols. I also had to rebuild mesa again, as it didn't get libva support on the first build (I want vaapi video acceleration), and also (while I haven't gone to use it yet) didn't build the amd vulkan drivers. Mesa got built early, as a dependency for xorg-server and things like that aren't actually build dependencies, the port is configured to enable it IF vulkan-loader is installed at the time, which it won't be in that early build.

Again, basemark web 3.0 earned its Wheaties for showing me that I had problems.
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Crux Linux!

Post by Zema Bus »

Looks good. What I do to get Firefox to use my existing profile is rename it to the one it had just created but editing the .ini files works too. Gimp 3 seems a little better now than when it was first released.
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

Oh... heheh... I never even thought of that. That is easier than editing the .ini files (it's actually a bit confusing) :eh:

P.S. What I did today, I was in no mood for it, was just change everything in both .ini files to the name of my good profile (and deleted the new one). This way whatever it picks, it has no choice. From now on I'll just rename the directory!
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I'm pretty much all set for now (still lots to do, but I'm functional). I have XFCE 4.18.0 now, I built it from tarballs and sent it to /usr/local (I was too lazy to set up a whole environment for it in /opt/xfce). Just the parts of it I use. This time, no xfce4-pulseaudio-plugin volume control so I did what I did on my last LFS system, I put an icon where the volume control used to be that just launches alsamixer in a terminal. Fast and lean, this system is to be.

I was curious to see if they had the new XFCE in ports, and they don't have XFCE at all! They did back years ago. I'm sure someone somewhere has one, but it's not even in contrib. That's mean :-)

It doesn't come with a lot of stuff like that. They do give you the tools and dependencies to build whatever you want though (and a very reasonable packaging system).

I dropped in my ~/.config/xfce4 and with my gtk style in place, it looks just like home. I even got gimp to use my style, by selecting System though it's ucking fugly. Maybe if I add more tool buttons that will look better (If I can still do that)


xfce4-crux.jpg
xfce4-crux.jpg (341.77 KiB) Viewed 345 times
User avatar
Zema Bus
Your Co-Host
Posts: 1115
Joined: Sun Feb 04, 2024 1:25 am

Re: Crux Linux!

Post by Zema Bus »

Very nice! :)
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I don't like that terminal, but does alsamixer ever look good in XFCE Terminal. I just switched my "terminal" program back to that in XFCE settings (which will affect "run in terminal" shortcuts only) because alsamixer against a white terminal is unreadable. I was just using the very light weight xterm for that because I normally never see it anyway in the background.

alsamixer-xfterm.jpg
alsamixer-xfterm.jpg (120.4 KiB) Viewed 324 times
User avatar
Grogan
Your Host
Posts: 2049
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Crux Linux!

Post by Grogan »

I did a proper build of firefox (with clang and PGO+LTO) to /opt/firefox today. Building the port was just a shakedown cruise to get things in order. I've got a good build of LLVM 20.1.6, I had everything but lld (the LLVM linker) for this build. The port builds with gcc and links against system libraries (which saves space, but it's more fragile that way).

Firefox doesn't need anything but PATH no matter where you put it, it just loads its own libraries in the program dir or built in libxul when built my way (and the binaries from mozilla.org are that way too).

Oddly, it didn't try to invalidate my profile this time. Normally even moving the ruddy thing with a symlink causes profile regeneration.

I COULD build this on Crux for Arch, but that would necessitate enabling both pulseaudio and alsa and installing pulseaudio to a non-system directory and using CPPFLAGS and LDFLAGS variables so the build can use it, but I don't want to deal with pulseaudio at all. I used to do that on the old computer where Firefox took near 3 hours for the full PGO+LTO build, but it only takes half an hour here so it doesn't hurt to have to do it twice.

I removed the port with "pkgrm". I like the way that works in crux, pkgadd and pkgrm are the back end and they just unconditionally install and remove packages, they don't do any dependency checking on their own (prt-get does that). pkgrm doesn't even give you any output, it just removes all the files from the specified package (only). They warn you about it... "don't accidentally type "pkgrm glibc" instead of "pkgrm glib" in their example :lol:

I quite like this distro, it doesn't fight me like gentoo or even Arch for that matter.
Post Reply