LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux
User Name
Password
Bedrock Linux This forum is for the discussion of Bedrock Linux.

Notices


Reply
  Search this Thread
Old 07-03-2016, 08:11 AM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 650
Blog Entries: 131

Rep: Reputation: 188Reputation: 188
bedrock: character set oddness in console


In bedrock, If I type lsblk while in a console (in other words, I do not run startx) the output has what looks like some graphics corruption.

If I type startx and run a term and run lsblk again, I get no corruption. I in fact see that the corrupt parts were the characters used to show the branching of the tree of devices. Not ascii characters.

Furthermore, if I ">" redirect the output while in the console, then startx and then view the captured output, the "corruption" is gone.

Obviously something with character sets. Correct in term, incorrect in the console.

Beyond this, I can't figure out what is going on. Has anyone else had this happen?

This is in a 64 bit bedrock with Slackware 64 as the global & rootfs strata.

Last edited by jr_bob_dobbs; 07-03-2016 at 08:13 AM.
 
Old 07-04-2016, 02:29 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,630

Rep: Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265
this the capabilities of the terminal itself. Probably the console is not so powerful, cannot display those characters, but a full featured graphical terminal will be able to do that.
 
Old 07-04-2016, 02:44 AM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,257
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
Totally unfamiliar with bedrock, but it sounds like your console locale is not setup for unicode characters.

I think you need to pass "vt.default_utf8=1" boot parameter. In lilo.conf this would do it, not sure how grub would do that:

Code:
append = " vt.default_utf8=1 "
Also, if you have a file /etc/profile.d/lang.sh, what is in it? Try using this for the LANG attribute:

Code:
export LANG=en_US.UTF-8
 
Old 07-04-2016, 02:16 PM   #4
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Are you also using Slackware's init? If so, Bedrock Linux just gets all the relevant bits from Slackware. I suspect locale stuff is not properly set up to support those characters. In which case, astrogeek is spot on. Be sure to use the explicit path

Code:
/bedrock/strata/slackware/etc/profile.d/lang.sh
as that'd be a local file.
 
Old 07-05-2016, 07:34 AM   #5
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 650

Original Poster
Blog Entries: 131

Rep: Reputation: 188Reputation: 188
Astrogeek. Dude, gave me the clue I needed. Thank you.

There is indeed a file /etc/profile.d/lang.sh. An excerpt from that file:
Code:
# en_US is the Slackware default locale:
export LANG=en_US

# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#export LANG=C

# There is also support for UTF-8 locales, but be aware that
# some programs may possibly misbehave under UTF-8.  In those
Now, that file in slackware is in turn called by /etc/profile. However, at some point during the hijack-install of bedrock, I overwrote /etc/profile with the bedrock version, which does *not* call anything in /etc/profile.d. Oops! The bedrock rc.conf file sets the language to LANG=en_US.UTF-8, which some programs in slackware, including lsblk, can have trouble with, based on comments in the original /etc/profile and my own recent experience.

By changing the /etc/profile to call scripts in /etc/profile.d, I got lsblk to display correctly. Bonus: there is a good chance that other problems, as yet undiscovered, are fixed by running things in profile.d.

The bedrock /etc/profile uses busybox but (so far) seems to interpret the .sh files without problems.

@ParadigmComplex: I'm using slackware's init but /etc/profile is run at login time. I'm not referencing /etc/profile nor /etc/profile.d/* as local files. It seems to run OK, though. I think this is because slackware is both the rootfs and global stratum?

Last edited by jr_bob_dobbs; 07-05-2016 at 07:50 AM.
 
Old 07-05-2016, 10:35 AM   #6
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 179

Rep: Reputation: Disabled
Quote:
Now, that file in slackware is in turn called by /etc/profile. However, the hijack-install of bedrock overwrote /etc/profile with its own version, which does *not* call anything in /etc/profile.d. Oops! The bedrock rc.conf file sets the language to LANG=en_US.UTF-8, which some programs in slackware, including lsblk, can have trouble with, based on comments in the original /etc/profile and my own recent experience.
Your analysis of what's happening with /etc/profile is correct, but I think you're missing why things are set up this way. I also think it's the wrong way to solve the problem you're having.

Bedrock Linux overriding the stratum's /etc/profile is key in how Bedrock Linux works. Amongst other things, it enforces the same LANG everywhere. The idea is you set it in /bedrock/etc/rc.conf instead of the per-distro specific ways. Without this you can end up in situations where one terminal (e.g. xterm) uses one keyboard layout but another (e.g. xfce4-terminal) uses another keyboard layout, which is usually undesirable and very confusing. Instead of breaking Bedrock Linux's enforcement of LANG in /etc/profile, try just setting the LANG item in /bedrock/etc/rc.conf instead.

You are correct that Bedrock Linux doesn't currently respect /etc/profile.d/* items. Amongst other things, I believe this breaks bash completion. I've been meaning to fix this... I'll see if I can get it done properly for the upcoming release. There's a non-trivial aspect of doing it correctly that I need to be careful about. If you want to do it yourself, just make sure it happens *before* the bulk of the Bedrock Linux code in /etc/profile there so Bedrock Linux overrides whatever it picks up.

Quote:
By changing the /etc/profile to call scripts in /etc/profile.d, I got lsblk to display correctly. Bonus: there is a good chance that other problems, as yet undiscovered, are fixed by running things in profile.d.
Yes, but you also might have broken some of the standardization/interaction stuff for Bedrock. I'd recommend reverting that (or changing it so Bedrock Linux's bits are done later and override whatever was in /etc/profile.d) and fixing the issue another way - either changing /bedrock/etc/rc.conf to use en_US sans utf8, or fixing the vt to support utf8.

Have you tried astrogeek's recommendation of

Code:
append = " vt.default_utf8=1 "
in lilo?

Quote:
The bedrock /etc/profile uses busybox but (so far) seems to interpret the .sh files without problems.
It's usually sourced by a shell instead of run directly as a stand-alone executable. That first hashbang line is ignored as a comment. It'll probably use Slackware's /bin/sh or /bin/bash when booting, if I had to guess.

Quote:
@ParadigmComplex: I'm using slackware's init but /etc/profile is run at login time. I'm not referencing /etc/profile nor /etc/profile.d/* as local files. It seems to run OK, though. I think this is because slackware is both the rootfs and global stratum?
We may be on different pages - either you're missing a nuance of how Bedrock Linux works here, or I'm misunderstanding you. "Referencing ... as local files" doesn't make sense in this context.

Sadly, while much of Bedrock Linux "just works", there is a bit of under-the-hood stuff that you'll need to know for situations like this. The docs describe it here, but linking you to this earlier didn't seem to help. I'll try to rephrase here:

- Bedrock Linux lets you use software from a variety of distros.

- If different distros need to have have different files at the same path to ensure everything works (e.g. Debian and Ubuntu will have different /etc/apt/sources.list files), you'll end up with multiple instances of these files. These files are called "local" files. To differentiate between different instances of these local files Bedrock Linux has a piece of metadata associated with them called the file's "stratum". So you could have a (debian, "/etc/apt/sources.list") and a (ubuntu, "/etc/apt/sources.list") - by specifying Debian or Ubuntu you can indicate to which /etc/apt/sources.list you are referring.

- Some files should be the same for all distros. For example, consider your ~/.bashrc file. These are called "global" files. You'll only have at most one instance of each. These actually have the stratum metadata as well - they all get tagged as "global".

- Everything defaults to local. The exceptions which should be global are configured in /bedrock/etc/strata.conf and /bedrock/etc/strata.d/* (which may refer to /bedrock/etc/frameworks.d/*). You can run "bri -c <stratum> bind ; bri -c <stratum> share ; bri -c <stratum> union" to see all of the global files for a given stratum.

- If some process tries to do something with a local file, Bedrock Linux does some pretty nifty logic to figure out from context which one should be provided. It's *usually* correct. For example, if Debian's apt-get tries to open /etc/apt/sources.list Bedrock Linux will give it the Debian one. If you run "reboot", you'll get the "reboot" executable associated with the current init system.

- If some process tries to do something with a global file, what file to give it is obvious, as there's only at most one instance of such a file. Just give it that one.

- In certain situations when you try to do something with a local file Bedrock Linux can't tell from context which instance of the file you you want. Even a bright human looking over your shoulder as you type may not be able to tell. If you run "vim /etc/apt/sources.list" which /etc/apt/sources.list do you want, Debian's or Ubuntu's? To solve this you can explicitly tell Bedrock Linux which one you want by prefixing the path with "/bedrock/strata/<stratum-name>". So if you want to edit Debian's /etc/apt/sources.list with vim you should run "vim /bedrock/strata/debian/etc/apt/sources.list".

- If you don't specify which local file, Bedrock Linux will guess the one that matches the process trying to use the file. So if you use Debian's vim to edit "/etc/apt/sources.list" you'll get Debian's, and if you use Ubuntu's vim to edit "/etc/apt/sources.list" you'll get Ubuntu's. If you used Slackware's vim to edit "/etc/profile.d/lang.sh", you edit Slackware's "/etc/profile.d/lang.sh", but it's best not to rely on that in case you later try to do something like using Slackware's vim to edit Debian's "/etc/apt/sources.list" by doing "vim /etc/apt/sources.list".

- "/etc/profile.d/lang.sh" is a local file. To indicate you explicitly want Slackware's instance of it, you should edit "/bedrock/strata/slackware/etc/profile.d/lang.sh".

- "/etc/profile" is a global file; every process from every distro sees the same file here. This is part of how Bedrock Linux enforces things like the same locale everywhere. You can edit it with just "/etc/profile" - Bedrock Linux will know you mean the global instance.

That make sense? If not, do let me know where it lost you and maybe I can resolve the confusion.

I'd really like to be able to make that part "just work" such that you never had to manually prefix with "/bedrock/strata/<stratum>" or worry about this, but I don't think it's even theoretically possible. It'd also be nice if I could explain it more succinctly.
 
1 members found this post helpful.
Old 07-06-2016, 12:58 PM   #7
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 650

Original Poster
Blog Entries: 131

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by ParadigmComplex View Post
Your analysis of what's happening with /etc/profile is correct, but I think you're missing why things are set up this way. I also think it's the wrong way to solve the problem you're having.
Understood. Thank you.

Quote:
Bedrock Linux overriding the stratum's /etc/profile is key in how Bedrock Linux works. Amongst other things, it enforces the same LANG everywhere. The idea is you set it in /bedrock/etc/rc.conf instead of the per-distro specific ways. Without this you can end up in situations where one terminal (e.g. xterm) uses one keyboard layout but another (e.g. xfce4-terminal) uses another keyboard layout, which is usually undesirable and very confusing. Instead of breaking Bedrock Linux's enforcement of LANG in /etc/profile, try just setting the LANG item in /bedrock/etc/rc.conf instead.
Yikes: I don't want to break things. OK: I have made this change. In the bedrock rc.conf:
Code:
LANG=en_US

Last edited by jr_bob_dobbs; 07-06-2016 at 01:02 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bedrock not using brsh.conf, dropped to bedrock's /bin/sh Siljrath Linux - Distributions 2 08-25-2014 05:47 AM
Exit KDE 4.6.5 to Console and Character Set Becomes Symbol(?) tronayne Slackware 3 01-19-2012 06:41 PM
input of a character from console without pressing enter Bonny Programming 8 10-28-2008 04:50 PM
Alternate character set on console ronald-be Programming 2 11-07-2006 11:35 AM
Set text (runlevel 3) console character width davee Linux - Newbie 2 11-16-2003 03:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration