Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: artix-cgroups scripts contain bashisms [not anymore] (Read 370 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

artix-cgroups scripts contain bashisms [not anymore]

The shellscripts which are part of artix-cgroups contain bashisms (like using keyword `source` instead of `.`). Since I use Dash as a symlink for /bin/sh, after artix-cgroups was installed by a recent update, my system refused to boot.

I understand Artix (and Arch) symlink /bin/sh to bash by default, but I think it would be best practice to either explicitly use /bin/bash or otherwise keep scripts POSIX.

The following files contain bashisms:
Code: [Select]
/usr/lib/artix/binfmt.sh
/usr/lib/artix/mount-cgroups.sh
/usr/lib/artix/sv-cg.sh

/usr/share/artix/cgroups/util-cg.sh

Re: artix-cgroups scripts contain bashisms

Reply #1
Quote
Since I use Dash as a symlink for /bin/sh
Sadly, I recall seeing it stated explicitly that such a move is not supported by the distro. At least under Arch Linux, and probably the same applies here. The given rationale was that so many packages contain scripts that assume bash upstream.

Nevertheless, I also urge the developers (and everyone!)
Quote
to either explicitly use /bin/bash or otherwise keep scripts POSIX

Re: artix-cgroups scripts contain bashisms

Reply #2
This bit me as well.

I think it is reasonable to expect scripts with /bin/sh hashbang to be Bourne-shell compatible, even if it is not officially supported at the distro level.

Re: artix-cgroups scripts contain bashisms

Reply #3
I fucked myself gloriously with this one, I also use dash, my system does boot and automatically logs in and starts X, but the keyboard is unresponsive after that, only answering to Sysreq's commands, meaning that I can't even change the tty to disable auto login and symlink /bin/sh to bash. So I'm basically stuck.

EDIT: For some esoteric reason, my USB is not showing on the boot order, even though I don't use it for anything else besides installing Linux, meaning I can't even chroot and fix everything. My only hope is seeing if I can install Artix on my USB this Sunday at my college's computer, even though I have work to do before then, ha.

Re: artix-cgroups scripts contain bashisms

Reply #4
Whether this can work depends on the bootloader you use and many other things.
But if you can edit the kernel command line while the bootloader is starting try adding
Code: [Select]
 init=/usr/bin/bash
to it.
Which, if you get a prompt, should give you enough access to your root partition to fix things

Re: artix-cgroups scripts contain bashisms

Reply #5
So I'm basically stuck.
Whether this can work depends on the bootloader you use and many other things.
But if you can edit the kernel command line while the bootloader is starting try adding
Code: [Select]
 init=/usr/bin/bash
to it.
Which, if you get a prompt, should give you enough access to your root partition to fix things

I don't use a bootloader, just an EFISTUB so that was a no deal either way (besides, my partition is encrypted, not sure I'd have the necessary tools to even open it that way), thankfully my good neighbor let me flash an iso to my USB with their laptop (I might've emptied it for a project and forgot to put another OS in there after), so I was able to symlink it back to bash.

 

Re: artix-cgroups scripts contain bashisms

Reply #6
The package was just updated, I seems it no longer contains any bashisms, as far as I could tell with the checkbashisms script