Re: [gentoo-user] Bash prompt colours

2021-12-06 Thread Frank Steinmetzger
Am Fri, Dec 03, 2021 at 02:43:54PM + schrieb Peter Humphrey:

> > > > Hello list,
> > > > 
> > > > Is there a way to set the colour of a bash prompt according to
> > > > whether the user has SSH'd in?
> > > > […]
> > > When you are connected via SSH, the environment variable
> > > SSH_CONNECTION is set. I store the color in a variable and set it to
> > > yellow if `[[ -n "${SSH_CONNECTION}" ]]`. I can't give you the exact
> > > snippet since I use Zsh, but it should be possible to use a variable
> > > as color in bash's prompt?
> > > 
> > > Kind regards, tastytea
> > 
> > This link expands upon tastytea's idea:
> > 
> > https://unix.stackexchange.com/questions/217270/change-ps1-color-when-> 
> > connected-to-other-host-via-ssh
> 
> Thank you both. Now I just have to shoehorn it into /etc/bash/bashrc on the 
> SSH server...

I expanded on that idea somewhat further. When I am in midnight commander
and press Ctrl+O to open a fullscreen shell, I sometimes forget after a
while that it was an mc shell, and so blindly quit it with ctrl+D, which
also kills the mc process. So a long time ago I expanded my PS1 in ~/.bashrc
for those shells to show the number of backgrounded processes and “subshell
type” like so:


__jobsprompt() {
PS1_JOBS_COUNT=`jobs -p | wc -l`
if [ $PS1_JOBS_COUNT -eq 0 ]; then
PS1_JOBS_COUNT=
else
PS1_JOBS_COUNT="$PS1_JOBS_COUNT "
fi
[ "$MC_SID" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}MC "
[ "$RANGER_LEVEL" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}R "
}

if [[ -z "$PROMPT_COMMAND" ]]; then
PROMPT_COMMAND=__jobsprompt
else
PROMPT_COMMAND="$PROMPT_COMMAND ; __jobsprompt"
fi

PS1="$CBPURPLE\u$CDGRAY@$CBGREEN\h$CRESET $CBBLUE\w 
$CRED"'$PS1_JOBS_COUNT'$CRESET"


Those $C… strings of course being shell codes for colours (CB…=bold). Note
the single quotes within the string. PS1 shall contain the actual string
'$PS1_JOBS_COUNT', so that the variable is expanded anew in every prompt.

-- 
Grüße | Greetings | Qapla’
Please do not share anything from, with or about me on any social network.

I just took an IQ test. The results were negative.


signature.asc
Description: PGP signature


Re: [gentoo-user] LLVM and friends is not compatible.

2021-12-06 Thread Dale
Wols Lists wrote:
>
>
> That's exactly what I was doing !!!
>
> I roll my own kernel, make install quite happily shoves it in whatever
> /boot it finds.
>
> If I tell genkernel to create an initramfs, provided I let it stomp
> all over the LIVE /boot, it works fine. As soon as I try and stop it,
> by saying "don't automount /boot", or "don't actually install the
> initramfs", all hell breaks loose.
>
> In the past, genkernel's always worked fine for me. That's why I use
> it - dracut looks a lot more complicated ... but when genkernel throws
> a hissy fit and craps all over my system because I won't let it do
> what IT thinks is best, then it makes you want to dump the lot.
>
> What else in gentoo has the same craptastic logic? --keep-going is the
> same - it doesn't do what it says ...
>
> Oh well, if SourceMage works for me, then I'll probably dual-boot for
> a while and we'll see what happens ...
>
> Cheers,
> Wol
>
>


Wol, I think you been around long enough to know if it is broken, I'll
find it.  I use dracut and figuring it out the first time is interesting
when you have more than one kernel installed but once you get it right,
and make a note of how to use it, it works really easy.  I do all my
kernel stuff the manual way.  I run make oldconfig, then compile with
make all && make modules_install and then manually copy the image to
/boot with my own name that the tools allow.  I then use dracut to build
the init thingy.  After that, I rename the init thingy to match the
kernel and update grub.  If the names don't match, grub won't find the
init thingy.

This is the note I have in my cheat sheet. 


dracut --kver 4.14.19-gentoo #like in /usr/src.  In /boot, init & kernel
must match. 


The key to knowing you did it right, when you update grub, it will find
both the kernel and init thingy and list them.  The naming is what is
critical. 

If I can do this, you should be able to.  I might add two things.  I did
once long ago have a init thingy to fail.  Only once and it was fairly
early on.  It could have been dracut, it could have been me.  The most
critical things is the kernel version when running dracut and names
matching for the kernel and init thingy in /boot. 

Example commands and output.

dracut --kver 5.10.46-gentoo  # The kernel version comes from /usr/src
but leave off "kernel-" if you have it.  I use gentoo-sources here. 
Example output:


root@fireball / # dracut --kver 5.10.46-gentoo
dracut: Executing: /usr/bin/dracut --kver 5.10.46-gentoo
dracut: dracut module 'dash' will not be installed, because command
'/bin/dash' could not be found!
dracut: dracut module 'mksh' will not be installed, because command
'/bin/mksh' could not be found!
dracut: dracut module 'systemd' will not be installed, because command
'/lib/systemd/systemd' could not be found!
dracut: dracut module 'systemd-ask-password' will not be installed,
because command 'systemd-ask-password' could not be found!
dracut: dracut module 'systemd-coredump' will not be installed, because
command 'coredumpctl' could not be found!
dracut: dracut module 'systemd' will not be installed, because command
'/lib/systemd/systemd' could not be found!
dracut: dracut module 'systemd-initrd' depends on 'systemd', which can't
be installed
dracut: dracut module 'systemd-modules-load' will not be installed,
because command '/lib/systemd/systemd-modules-load' could not be found!
dracut: dracut module 'systemd-repart' will not be installed, because
command 'systemd-repart' could not be found!
dracut: dracut module 'systemd-sysctl' will not be installed, because
command '/lib/systemd/systemd-sysctl' could not be found!
dracut: dracut module 'systemd-sysusers' will not be installed, because
command 'systemd-sysusers' could not be found!
dracut: dracut module 'dbus-broker' will not be installed, because
command 'dbus-broker' could not be found!
dracut: dracut module 'rngd' will not be installed, because command
'rngd' could not be found!
dracut: dracut module 'network-wicked' will not be installed, because
command 'wicked' could not be found!
dracut: dracut module 'btrfs' will not be installed, because command
'btrfs' could not be found!
dracut: dracut module 'dmraid' will not be installed, because command
'dmraid' could not be found!
dracut: dracut module 'mdraid' will not be installed, because command
'mdadm' could not be found!
dracut: dracut module 'cifs' will not be installed, because command
'mount.cifs' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command
'iscsi-iname' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command
'iscsiadm' could not be found!
dracut: dracut module 'iscsi' will not be installed, because command
'iscsid' could not be found!
dracut: 95nfs: Could not find any command of 'rpcbind portmap'!
dracut: dracut module 'nvmf' will not be installed, because command
'nvme' could not be found!
cat: /sys/power/resume: No such file or directory
dracut: dracut module 

Re: [gentoo-user] LLVM and friends is not compatible.

2021-12-06 Thread Wols Lists

On 06/12/2021 19:26, Laurence Perkins wrote:

Genkernel is pretty...  special...  It's handy if your system is set up the way 
it expects.  If not, well, then its utility drops off quickly.

 From what you're describing, my suggestion would be to simply only use it for initramfs 
generation and do the kernel make yourself.  That shouldn't "stomp all over" 
anything except maybe a previous initramfs for the same kernel.


:-)

That's exactly what I was doing !!!

I roll my own kernel, make install quite happily shoves it in whatever 
/boot it finds.


If I tell genkernel to create an initramfs, provided I let it stomp all 
over the LIVE /boot, it works fine. As soon as I try and stop it, by 
saying "don't automount /boot", or "don't actually install the 
initramfs", all hell breaks loose.


In the past, genkernel's always worked fine for me. That's why I use it 
- dracut looks a lot more complicated ... but when genkernel throws a 
hissy fit and craps all over my system because I won't let it do what IT 
thinks is best, then it makes you want to dump the lot.


What else in gentoo has the same craptastic logic? --keep-going is the 
same - it doesn't do what it says ...


Oh well, if SourceMage works for me, then I'll probably dual-boot for a 
while and we'll see what happens ...


Cheers,
Wol



RE: [gentoo-user] LLVM and friends is not compatible.

2021-12-06 Thread Laurence Perkins

>>  
>>  -Original Message-
>>  From: Wols Lists  
>>  Sent: Monday, December 6, 2021 11:02 AM
>>  To: gentoo-user@lists.gentoo.org
>>  Subject: Re: [gentoo-user] LLVM and friends is not compatible.
>>  
>>  On 06/12/2021 17:51, Laurence Perkins wrote:
>>  > Source Mage is a spinoff of Sourceror and is kind of the opposite of 
>> Gentoo.
>>  
>>  Well, I read the philosophy thing where it said it wasn't comparable with 
>> gentoo ...
>>  > 
>>  > Gentoo is a source-based distro for people who want things to mostly just 
>> work like with the binary distros, but also want to do customizations and 
>> optimizations easily.
>>  
>>  Unfortunately, I can be a bit gruff and not suffer fools gladly. Having had 
>> a run in with the bug-wranglers over an issue that completely screwed up my 
>> boot (nothing to do with gentoo, admittedly), but that exposed idiotic 
>> decisions / other bugs in genkernel, I think I want to look elsewhere.
>>  
>>  Let's take a 2x2 truth table - do I have a boot partition, do I have 
>> "automount boot" switched on. Three of the four options stomp all over the 
>> live boot partition. The fourth fatal errors with "wah wah why won't you let 
>> me stomp all over your live boot partition".
>>  
>>  The REASON I don't want it stomping all over that partition is the last 
>> time a distro (SUSE) did it, it completely trashed my boot leading to 
>> several hours debugging and messing about in the systemd rescue shell to get 
>> it bootable again. If anybody is going to trash my live boot, I'd rather it 
>> was me, not an Artificial Stupidity software manager.
>>  
>>  The wranglers' solution was simply to "use the no-install option" - except 
>> that that promptly crashed with "can't find input files". Huh? 
>>  Changing the OUTPUT destination makes the INPUT files disappear? wtf?
>>  > 

Genkernel is pretty...  special...  It's handy if your system is set up the way 
it expects.  If not, well, then its utility drops off quickly.

From what you're describing, my suggestion would be to simply only use it for 
initramfs generation and do the kernel make yourself.  That shouldn't "stomp 
all over" anything except maybe a previous initramfs for the same kernel.

Or else use dracut, it works decently for initramfs generation as well and lets 
you specify output location so you can copy things to /boot manually if you so 
desire.

Or, depending on how complex your system actually is, just creating your own 
initramfs isn't terribly difficult.  Since it seems like you're wanting 
explicit control over everything that might be the option that will keep you 
happiest in the long-run.

Because initramfs generation is really the only complex part of the process.  
The rest is just a wrapper for "make && make install && make modules_install" 
with a few extras of marginal utility like archiving your .config files.



>>  > Source Mage is a distro for Linux From Scratch folks who are tired of 
>> maintaining their own package manager.  They don't change*anything*  from 
>> upstream in their packages, (which makes it really easy to keep "updated" on 
>> their end) but the package manager does have a lot of nice features for 
>> easily storing whatever patches and configuration changes you choose to make 
>> in order to get it running on your system.
>>  
>>  Well, if I have to get into maintaining emerge to get it to behave 
>> sensibly, I might as well try somewhere else and see if it's an improvement.
>>  > 
>>  > If you've always wanted to try LFS but tracking package files and patches 
>> and configs and so-forth seemed daunting then it's definitely an awesome set 
>> of tools.
>>  > 
>>  > Otherwise it's kind of a lot of work...
>>  > 
>>  Well, given that I've got oodles of space (just added 3TB to my mirror to 
>> give myself a 5TB raid-5 /home lvm, along with 1TB root/ lvm, I've got 
>> plenty of space to play with distros. And I was shocked - 32GB of
>>  DD4 was just over £100, so my new system now has 11TB of hard drive, 32GB 
>> of RAM, and a hefty 4-core Ryzen processor :-)
>>  
>>  And the bits from shop screw-up mean the new raid testbed I'm building will 
>> be a reasonably hefty system too - 4x1TB drives for hammering with raid, 3TB 
>> backup drive, 16GB ram - just the thing for learning to kernel program :-)
>>  
>>  And seeing as I won't care about trashing it by mistake, I'll be playing 
>> with KVM, and all those other fancy technologies to try and run multiple 
>> distros stacked on top of each other :-)
>>  
>>  Cheers,
>>  Wol
>>  
>>  

Source-mage is definitely worth experimenting with if you want to get more into 
the nuts-and-bolts of how to create your own distro without necessarily going 
full LFS.  I haven't used it personally in a long time though since I kind of 
need to actually *use* the computer rather than just constantly maintaining it. 
 :D


LMP


Re: [gentoo-user] LLVM and friends is not compatible.

2021-12-06 Thread Wols Lists

On 06/12/2021 17:51, Laurence Perkins wrote:

Source Mage is a spinoff of Sourceror and is kind of the opposite of Gentoo.


Well, I read the philosophy thing where it said it wasn't comparable 
with gentoo ...


Gentoo is a source-based distro for people who want things to mostly just work 
like with the binary distros, but also want to do customizations and 
optimizations easily.


Unfortunately, I can be a bit gruff and not suffer fools gladly. Having 
had a run in with the bug-wranglers over an issue that completely 
screwed up my boot (nothing to do with gentoo, admittedly), but that 
exposed idiotic decisions / other bugs in genkernel, I think I want to 
look elsewhere.


Let's take a 2x2 truth table - do I have a boot partition, do I have 
"automount boot" switched on. Three of the four options stomp all over 
the live boot partition. The fourth fatal errors with "wah wah why won't 
you let me stomp all over your live boot partition".


The REASON I don't want it stomping all over that partition is the last 
time a distro (SUSE) did it, it completely trashed my boot leading to 
several hours debugging and messing about in the systemd rescue shell to 
get it bootable again. If anybody is going to trash my live boot, I'd 
rather it was me, not an Artificial Stupidity software manager.


The wranglers' solution was simply to "use the no-install option" - 
except that that promptly crashed with "can't find input files". Huh? 
Changing the OUTPUT destination makes the INPUT files disappear? wtf?


Source Mage is a distro for Linux From Scratch folks who are tired of maintaining their 
own package manager.  They don't change*anything*  from upstream in their packages, 
(which makes it really easy to keep "updated" on their end) but the package 
manager does have a lot of nice features for easily storing whatever patches and 
configuration changes you choose to make in order to get it running on your system.


Well, if I have to get into maintaining emerge to get it to behave 
sensibly, I might as well try somewhere else and see if it's an 
improvement.


If you've always wanted to try LFS but tracking package files and patches and 
configs and so-forth seemed daunting then it's definitely an awesome set of 
tools.

Otherwise it's kind of a lot of work...

Well, given that I've got oodles of space (just added 3TB to my mirror 
to give myself a 5TB raid-5 /home lvm, along with 1TB root/ lvm, I've 
got plenty of space to play with distros. And I was shocked - 32GB of 
DD4 was just over £100, so my new system now has 11TB of hard drive, 
32GB of RAM, and a hefty 4-core Ryzen processor :-)


And the bits from shop screw-up mean the new raid testbed I'm building 
will be a reasonably hefty system too - 4x1TB drives for hammering with 
raid, 3TB backup drive, 16GB ram - just the thing for learning to kernel 
program :-)


And seeing as I won't care about trashing it by mistake, I'll be playing 
with KVM, and all those other fancy technologies to try and run multiple 
distros stacked on top of each other :-)


Cheers,
Wol



RE: [gentoo-user] LLVM and friends is not compatible.

2021-12-06 Thread Laurence Perkins
>> 
>> 
>> -Original Message-
>> From: Wol  
>> Sent: Sunday, December 5, 2021 1:59 PM
>> To: gentoo-user@lists.gentoo.org
>> Subject: Re: [gentoo-user] LLVM and friends is not compatible.
>> 
>> On 05/12/2021 21:21, Alan Grimes wrote:
>> > I was playing Superliminal the other day and it wasn't doing too well, 
>> > probably my GPU is too rusty to run it well, and it took down X11. 
>> > Which meant it was time to update packages and reboot
>> > 
>> > Biig mistake...
>> > 
>> > Look, I know a lot of you are in the process of being killed to death 
>> > by the slow acting poison known as the covid 19 vaccine. I'm really 
>> > sorry about that neither myself nor God can do jack shit about that at 
>> > this point.
>> 
>> Let's hope we're not dying from the quick poison known as CoVid-19 (that 
>> said, I do my best to avoid both :-)
>> > 
>> > I also know that one of the several pathologies the poison inflicts is 
>> > a form of brain rot as prion crystals grow and disrupt neural pathways.
>> > =\  It really sucks and I wish things had not gotten to this point.
>> > 
>> > Portage is actually working, to some extent this time so I am actually 
>> > a bit shocked and amazed on that front, it's been ages since it 
>> > actually worked decently well.
>> > 
>> Just make sure you have a working python !!!
>> 
>> > But then a large number of absolutely critical things are now broken.
>> > 
>> > -> Xosview can't find the font it needs (!!! WTF ) None of my 
>> > -> steam games play anymore.
>> > -> The web browser and mail reader that I've been using since the '90s
>> > won't build or run. I've been reduced to using WEBMAIL FOR GOD'S SAKE! 
>> > to post this. I feel unclean.
>> 
>> Well my latest update seems to have fixed Thunderbird (which was randomly 
>> locking up input to the extent it was a Big Red Switch job to recover ...).
>> 
>> > -> Neither python 3.9 nor 3.10 will finish building. It appears they 
>> > -> run
>> > some self-tests which fail and then they just freeze up at 0% CPU 
>> > usage and I never get any clear diagnostic information.
>> > -> GCC-11.2 feels like it is mostly working but might be responsible 
>> > -> for
>> > python failing specific tests as it may have been using trick 
>> > optimizations that were hacks to start with but now don't work with 
>> > the current GCC which is actually working as advertised.
>> 
>> Do you still have Python 3.8? Can you delete 3.9 and 3.10?
>> 
>> Which gcc is default? can you eselect a newer working gcc than your current 
>> version?
>> > 
>> > I think one of the root issues is that llvm-13 deprecated several 
>> > command line options that broke a number of packages that took a great 
>> > many more packages down with them. I first just masked clang-13 but 
>> > that doesn't seem to be enough, I also masked llvm-13 and 
>> > llvm-common-13 and am running --emptytree world AGAIN.
>> > 
>> Well, what I always do then is first an "emerge system" (no extra options), 
>> then an emerge world, then finally an emerge deep newuse world. Just a 
>> little bit each time. Forcing a bit at a time.
>> 
>> The other thing is (as I found out ...) are any default emerge options 
>> screwing you over? I had to comment out my default options to get virtualbox 
>> to emerge update properly, so if you've got any, comment them out and see if 
>> it improves matters ...
>> 
>> I'm going to have more "fun" soon, I think ... I looked at funtoo linux 
>> earlier today, but I think that'll be a no-no - it goes about "wolves owning 
>> their own shit" then craps all over systemd. I get some people don't like 
>> it, but when people say "if you like it we don't want you here" then I am 
>> afraid I don't want to know bigots like that.
>> 
>> I then found SourceMage ... looks very interesting! It's a pretty basic 
>> distro it seems to me, but it also seems to be a distro that doesn't try to 
>> tell its users what to run. So I'll be playing ... and it doesn't give you 
>> all that portage grief! Not that I like the sound of bash ... 
>> :-) but all the basic system tools are written in it. They're very much "no 
>> dependency spaghetti", and that hopefully makes for easier admin...
>> 
>> The only problem is it seems very short-staffed. It's clearly up-to-date as 
>> in there's plenty of recent time stamps, but you have to look for them as 
>> much of the docu is 5, 10 years old ...
>> 
>> Cheers,
>> Wol
>> 
>> 

Source Mage is a spinoff of Sourceror and is kind of the opposite of Gentoo.  

Gentoo is a source-based distro for people who want things to mostly just work 
like with the binary distros, but also want to do customizations and 
optimizations easily.

Source Mage is a distro for Linux From Scratch folks who are tired of 
maintaining their own package manager.  They don't change *anything* from 
upstream in their packages, (which makes it really easy to keep "updated" on 
their end) but the package manager does have a lot of nice features for easily