You are not logged in.

#1 2018-03-03 14:25:46

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

[Helium-dev] TTY boot option & startx fails to configure desktop

OK, we have a problem with the popular TTY boot option: if that is selected from the first boot then running `startx` from the console login results in this:

2018-03-03-142028_1280x800_scrot.th.png

This happens because the display manager is used to copy over all of the XDG_CONFIG_DIR files for the first login to configure the desktop. — is it possible to call `bl-user-setup` from the autostart file instead?

EDIT: note the most excellent Muppet-inspired hostname, thanks to Mrs. HoaS for that smile

EDIT2: how will the autostart file work if it isn't in $HOME? D'oh! roll

Let me think on this...

Last edited by Head_on_a_Stick (2018-03-03 15:40:13)

Offline

#2 2018-03-03 17:02:59

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

I have a potential solution for the TTY login problem.

If the bl-user-setup script is tacked to the top of `startx` and placed earlier in $PATH, like this:

# cat /usr/bin/{bl-user-setup,startx} > /usr/local/bin/startx && chmod +x /usr/local/bin/startx

then the final line in bl-user-setup (`exit 0`) is removed to allow the `startx` script to run afterwards this is the result of issuing the (modified) `startx` command from a fresh TTY login:

2018-03-03-165824_1280x800_scrot.th.png

So perhaps a dpkg-divert for /usr/bin/startx to our own version?

The stock startx script does even suggest this sort of improvement:

alpine:~$ sed 12q $(which startx) 
#!/bin/sh

#
# This is just a sample implementation of a slightly less primitive
# interface than xinit. It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default. The system xinitrc should probably do things like check
# for .Xresources files and merge them in, start up a window manager,
# and pop a clock and several xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#
alpine:~$

EDIT: no, that breaks the modified `startx` script after the first run because of this line:

[[ -f "$HOME/.config/bunsen/bl-setup" ]] && exit 0

https://github.com/BunsenLabs/bunsen-co … -setup#L37

More thought is required...

EDIT2: use the break & continue builtins to selectively copy the $XDG_CONFIG_DIR stuff, perhaps?

I'm a little out of my depth here tbh.

Last edited by Head_on_a_Stick (2018-03-03 17:44:00)

Offline

#3 2018-03-03 18:36:17

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

I've split this issue out from the alpha ISO thread.

Offline

#4 2018-03-03 19:53:52

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

This version of /usr/local/bin/startx seems to work as desired:

https://github.com/Head-on-a-Stick/conf … 7ba/startx

(With humble apologies to johnraff & nobody for mauling their beautiful script in such an awful way, I know no better.)

That will copy the files from /usr/share/bunsen/skel but only if "${HOME}/.config/bunsen/bl-setup" does not exist; the conventional `startx` script has been tacked onto the end of that test.

EDIT: that version of `startx` also has the benefit of not being runnable by root (or under sudo) and the readonly lines satisfy my curly bracket fetish 8)

Last edited by Head_on_a_Stick (2018-03-03 20:13:50)

Offline

#5 2018-03-06 07:35:38

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

No, a custom startx is a stupid idea.

I think a simple message to the user is enough:

EDIT: changed [[ to [

EDIT2: missed the curly brackets  :8

EDIT3: grrr...

Last edited by Head_on_a_Stick (2018-03-07 07:38:25)

Offline

#6 2018-03-06 17:09:16

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Head_on_a_Stick wrote:

EDIT: note the most excellent Muppet-inspired hostname, thanks to Mrs. HoaS for that smile

hostname.th.png

big_smile

Offline

#7 2018-03-06 21:45:40

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

^ lol

Final version:

Is that enough?

If somebody likes to boot to a console screen then they probably know what they're doing, right?

This won't work because ~/.profile won't have the check in it until after `bl-user-setup` is run, I am such a ****wit sometimes roll

Last edited by Head_on_a_Stick (2018-03-07 07:42:18)

Offline

#8 2018-03-07 07:43:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Does anybody have a better idea than my custom startx version?

I really can't think of any other way around this.

Offline

#9 2018-03-07 09:04:04

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Drop a file in /etc/X11/Xsession.d/? At that point $HOME is set. (No - see below)

It might be nice to offer the user some choice in whether to run bl-user-setup though. Someone might be going in with a tty precisely to work round some bug with it.

Or, just append that above message (maybe turn down the urgency a little bit?) to the log-in message that appears on ttys?

/etc/profile looks in /etc/profile.d/ if it exists:

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

...so create that directory and put a snippet in there?
Yup - that works. Put yout code in /etc/profile.d/bunsen.sh


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#10 2018-03-07 21:24:20

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

^ Many thanks!

Offline

#11 2018-03-08 04:21:03

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

^although the fact that Debian don't ship /etc/profile.d/ by default suggests there might be a Better Way™ somewhere.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#12 2018-03-08 07:33:11

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Yes, perhaps a simple MOTD would be enough, that would show on TTY1 after a console login (as you suggested above).

Offline

#13 2018-03-08 08:20:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Does MOTD run shell commands?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#14 2018-03-08 21:27:17

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

No but I was just thinking of a generic message to be printed without a test:

No desktop? Run this command:

bl-user-setup

But perhaps that's a little lame hmm

I've just tested this and it works as expected:

alpine:~$ cat /etc/profile.d/bunsen.sh                              
#!/bin/sh
if [ ! -f "${HOME}/.config/bunsen/bl-setup" ] && [ "$TERM" = "linux" ]; then
	echo '
	Oh dear, there are no configuration files for our desktop.

	Please run `bl-user-setup` to generate them, thanks!

	'
fi
alpine:~$

Offline

#15 2018-03-09 03:16:04

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

...and a file in a *.d directory lets us avoid having to dpkg-displace an existing file.

Bearing in mind the users who have deleted ~/.config/bunsen/bl-setup for their own mysterious reasons, and those who've installed bunsen-configs but nevertheless don't want their $HOME populated hmm.png, perhaps tweak the message a bit?

There seem to be no configuration files for the BunsenLabs desktop.

Please run `bl-user-setup` if you'd like to generate them.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#16 2018-03-09 07:34:54

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

^ Yes, good idea, that looks perfect to me.

Offline

#17 2018-03-09 10:55:06

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

I liked the

Oh dear,

lol

Offline

#18 2018-03-10 05:16:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

^I did too actually, but thinking of users for whom not having the files is quite intentional...

...for example, someone might have a properly configured desktop user, but also have a different user who only uses the CLI.
Not so weird really.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

#19 2018-03-10 12:06:19

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Is there a case for replacing 50_bunsen.conf with this adding version of /etc/profile.d/bunsen.sh:

#!/bin/sh
if [ ! -f "${HOME}/.config/bunsen/bl-setup" ]; then
   /usr/lib/bunsen/configs/bl-user-setup
fi

This would remove our dependence on LightDM for the first-run configuration.

EDIT: or maybe even just:

#!/bin/sh
/usr/lib/bunsen/configs/bl-user-setup

Given that the script already includes the test.

EDIT2: no, it could only be used as well as 50_bunsen.conf, which doesn't make much sense.

Bad idea then hmm

Last edited by Head_on_a_Stick (2018-03-10 23:12:03)

Offline

#20 2018-03-11 04:46:48

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,657
Website

Re: [Helium-dev] TTY boot option & startx fails to configure desktop

Anyway I'll add the above /etc/profile.d/bunsen (no need for the .sh, as it's sourced, not executed directly) to bunsen-configs as that's the package which supplies bl-user-setup and all the skel config files.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Offline

Board footer

Powered by FluxBB