You are not logged in.

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

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


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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 & twoion 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 glasses

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


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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  ops

EDIT3: grrr...

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


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

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: 8,759
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)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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.


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
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


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

^ Many thanks!


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
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.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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).


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

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

Does MOTD run shell commands?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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:~$

“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
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.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

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


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

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: 4,677
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.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

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

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
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)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

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

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
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.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#21 2018-03-11 14:13:14

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

johnraff wrote:

no need for the .sh, as it's sourced, not executed directly

Yes, of course, thanks — I can't believe I added that

Doesn't /etc/profile only source scripts in /etc/profile.d/ that end with .sh?

Last edited by Head_on_a_Stick (2018-03-11 15:12:49)


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#22 2018-03-12 06:13:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

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

Head_on_a_Stick wrote:
johnraff wrote:

no need for the .sh, as it's sourced, not executed directly

Yes, of course, thanks — I can't believe I added that

You didn't. I put it in, then forgot. ops
(It shouldn't need the shebang #!/bin/sh though.)

Doesn't /etc/profile only source scripts in /etc/profile.d/ that end with .sh?

Right! I don't know why the .sh restriction was added, but in base-files between Lenny and Squeeze that profile.d code got put in, and this section of the FAQ, denigrating profile.d, got taken out:

base-files_5lenny FAQ wrote:

* Questions about "profile.d":

Q. Why does Debian not have a "profile.d" directory, like other distributions?

A. Because no Debian package needs it. Debian policy says: "A program
must not depend on environment variables to get reasonable defaults".
This policy has been very successful so far. If the default install
had a profile.d, people might think it's ok to use it for a Debian
package, when in fact policy does not support such thing.

Q. Ok, but I still think it would still be a nice thing to have, would
not make sense to have a profile.d by default, even if no Debian
package uses it?

A. No. As explained before, there is the risk of assuming that it's
"officially supported". If you need a profile.d directory, you may
still create one in your machine and modify your /etc/profile
accordingly to enable it. Since this is a configuration file,
its contents will be preserved in upgrades.

Q. Ok, but if I do that I will have to merge my changes every time
the /etc/profile provided by base-files changes.

A. That should not be a big problem. The default /etc/profile provided
by base-files is quite minimal on purpose, and it is not expected to
change drastically from one Debian release to the next one.

So it now seems to be grudgingly acceptable to use profile.d, at least for our simple conditional message. We'll be careful not to set any envvars Aunty Debian!

Last edited by johnraff (2018-03-12 08:19:10)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#23 2018-03-12 09:00:07

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

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

I've provisionally added this to /etc/profile.d in bunsen-configs:

# /etc/profile.d/bunsen.sh
# BunsenLabs message

if [ ! -f "${HOME}/.config/bunsen/bl-setup" ] && [ "$TERM" = "linux" ]; then
    echo "
There seem to be no configuration files for the BunsenLabs desktop.
Please run 'bl-user-setup' if you'd like to generate them.
"
fi

I found the extra spacing a bit too assertive, so toned the formatting down to resemble the other login messages.
@HoaS does that look OK on your machine?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#24 2018-03-12 20:02:11

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

^ Looks good but I would prefer it double-spaced (ie, with a blank line between the sentences).


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#25 2018-03-13 06:06:43

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

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

johnraff wrote:

I found the extra spacing a bit too assertive

Er, so it seems we don't quite agree on that point.

I just imagined some advanced user getting increasingly annoyed being reminded of some install they had no intention of doing, so just tried to blend our message in with the others. "You have mail" doesn't exactly stand out either. At least ours has preceding and trailing blank lines.

I think there's a case for leaving the whole thing out, to be honest. CLI users shouldn't need too much hand-holding.

Last edited by johnraff (2018-03-13 06:07:54)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

Board footer

Powered by FluxBB