LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-22-2018, 07:19 PM   #106
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925

Right, it's obviously not the most productive activity to spend more time on this, but the only food for thought that I can generate is that using PKNAME in lsblk will produce e.g. the following (the two relevant awkward lines and the two surrounding them for context; the last two columns are KNAME and PKNAME):

Code:
/media/sharelnx      5652783544 ext4   sda16 sda
                   429878721024        sda14 sda
/media/veracrypt1  429453652880 ntfs   dm-0  sda14
/media/vm10         56518922624 ext4   sda9  sda
So, the logic would be: if PKNAME is not the parent device name (sda in this case), then KNAME=PKNAME. For -p, the previous line would be discarded anyway as it has no mountpoint. For -o, you could maintain a variable which stored the partition numbers of any partitions that were affected by the rule above and then filter these out of the results.

That's all I could find having a look through the lsblk options available, but perhaps you will find a neat trick at some point in the future.
 
Old 03-22-2018, 07:36 PM   #107
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
for simplicity, what I did was take the fields in the order where they are always with data, so I could space separate them.

Note that I suspect I will probably end up using the -P option, then getting the resulting Pairs of key value because that's far more precise and error free than the method I used yesterday.

Examples, I'll add these to the debugger:

Code:
lsblk  -r --output NAME,PKNAME,TYPE,RM,FSTYPE,SIZE
NAME PKNAME TYPE RM FSTYPE SIZE
fd0  disk 1  4K
sda  disk 0  74.5G
sda1 sda part 0 ext3 23.5G
sda3 sda part 0  1K
sda5 sda part 0 ext3 14.7G
sda6 sda part 0 ext4 7.6G
sda7 sda part 0 ext3 9.9G
sdb  disk 0  931.5G
sdb1 sdb part 0 swap 15.6G
sdb2 sdb part 0 ext4 293G
sdb3 sdb part 0 ext4 29.3G
sdb4 sdb part 0 ext4 244.1G
sdb5 sdb part 0 ext4 146.5G
sdb6 sdb part 0 ext4 97.7G
sdb7 sdb part 0 ext4 48.8G
sdc  disk 1  14.9G
sdc1 sdc part 1 vfat 14.9G
sr0  rom 1  1.4G
sr1  rom 1  1024M

lsblk  -P --output NAME,PKNAME,TYPE,RM,FSTYPE,SIZE
NAME="fd0" PKNAME="" TYPE="disk" RM="1" FSTYPE="" SIZE="4K"
NAME="sda" PKNAME="" TYPE="disk" RM="0" FSTYPE="" SIZE="74.5G"
NAME="sda1" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext3" SIZE="23.5G"
NAME="sda3" PKNAME="sda" TYPE="part" RM="0" FSTYPE="" SIZE="1K"
NAME="sda5" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext3" SIZE="14.7G"
NAME="sda6" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="7.6G"
NAME="sda7" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext3" SIZE="9.9G"
NAME="sdb" PKNAME="" TYPE="disk" RM="0" FSTYPE="" SIZE="931.5G"
NAME="sdb1" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="swap" SIZE="15.6G"
NAME="sdb2" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="293G"
NAME="sdb3" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="29.3G"
NAME="sdb4" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="244.1G"
NAME="sdb5" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="146.5G"
NAME="sdb6" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="97.7G"
NAME="sdb7" PKNAME="sdb" TYPE="part" RM="0" FSTYPE="ext4" SIZE="48.8G"
NAME="sdc" PKNAME="" TYPE="disk" RM="1" FSTYPE="" SIZE="14.9G"
NAME="sdc1" PKNAME="sdc" TYPE="part" RM="1" FSTYPE="vfat" SIZE="14.9G"
NAME="sr0" PKNAME="" TYPE="rom" RM="1" FSTYPE="" SIZE="1.4G"
NAME="sr1" PKNAME="" TYPE="rom" RM="1" FSTYPE="" SIZE="1024M"
If you paste in both of those I can see what's available.

The trick is to find the way to get the report to list your thing on one line, not as a second line under one line. Now, I can code in a very custom fix, but those get really bloated when they only apply to one literal situation.

Last edited by h2-1; 03-22-2018 at 07:39 PM.
 
Old 03-22-2018, 07:40 PM   #108
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Code:
NAME PKNAME TYPE RM FSTYPE SIZE
sda  disk 0  931.5G
sda2 sda part 0 ntfs 50G
sda16 sda part 0 ext4 5G
sda14 sda part 0  400G
veracrypt1 sda14 dm 0 ntfs 400G
sda9 sda part 0 ext4 50G
sda12 sda part 0 ext4 20G
sda7 sda part 0 swap 7G
sda10 sda part 0 ext4 60G
sda5 sda part 0 ext4 20G
sda17 sda part 0 ext4 5G
sda1 sda part 0 ntfs 100M
sda15 sda part 0 ntfs 4.9G
sda13 sda part 0 ntfs 40G
sda8 sda part 0 ext4 114.9G
sda11 sda part 0 ext4 50G
sda6 sda part 0 ext4 20G
Code:
NAME="sda" PKNAME="" TYPE="disk" RM="0" FSTYPE="" SIZE="931.5G"
NAME="sda2" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ntfs" SIZE="50G"
NAME="sda16" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="5G"
NAME="sda14" PKNAME="sda" TYPE="part" RM="0" FSTYPE="" SIZE="400G"
NAME="veracrypt1" PKNAME="sda14" TYPE="dm" RM="0" FSTYPE="ntfs" SIZE="400G"
NAME="sda9" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="50G"
NAME="sda12" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="20G"
NAME="sda7" PKNAME="sda" TYPE="part" RM="0" FSTYPE="swap" SIZE="7G"
NAME="sda10" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="60G"
NAME="sda5" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="20G"
NAME="sda17" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="5G"
NAME="sda1" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ntfs" SIZE="100M"
NAME="sda15" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ntfs" SIZE="4.9G"
NAME="sda13" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ntfs" SIZE="40G"
NAME="sda8" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="114.9G"
NAME="sda11" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="50G"
NAME="sda6" PKNAME="sda" TYPE="part" RM="0" FSTYPE="ext4" SIZE="20G"
 
Old 03-22-2018, 07:43 PM   #109
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by h2-1 View Post
The trick is to find the way to get the report to list your thing on one line, not as a second line under one line. Now, I can code in a very custom fix, but those get really bloated when they only apply to one literal situation.
Yup. I couldn't achieve that.
 
Old 03-22-2018, 07:57 PM   #110
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
For efficiency, I always have the loop tools exit on success, and since you can't 'look ahead', the only way to find the match would actually be to not exit the loop.

Let's put this one on the todo list, it's not easy.

pinxi 2.9.03-12 finishes up the man installers, to avoid forcing man installs on people who just want to test pinxi alone, I've added the --man switch, which is required for a non master branch man install. master as usual always installs man with -U.

So now it's become truly trivial to update and check man pages, that's been a real problem for me for years re testing, I'd have to do a real inxi release, then check the man pages on various systems, then edit them, then do another update, now I can just get the new one a second or two after I commit it with a single command.

so since pinxi is a branch release: pinxi -U --man
results in pinxi update and man install/update, from github.

pinxi -U 3 --man
results in grabbing both the pinxi and man versions from the dev server, smxi.org, which can be useful on old systems with expired ssl stuff, github doens't allow non ssl access due to attacks they have suffered.

Last edited by h2-1; 03-22-2018 at 08:00 PM.
 
Old 03-22-2018, 08:04 PM   #111
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by h2-1 View Post
For efficiency, I always have the loop tools exit on success, and since you can't 'look ahead', the only way to find the match would actually be to not exit the loop.

Let's put this one on the todo list, it's not easy.

pinxi 2.9.03-12 finishes up the man installers, to avoid forcing man installs on people who just want to test pinxi alone, I've added the --man switch, which is required for a non master branch man install. master as usual always installs man with -U.

So now it's become truly trivial to update and check man pages, that's been a real problem for me for years re testing, I'd have to do a real inxi release, then check the man pages on various systems, then edit them, then do another update, now I can just get the new one a second or two after I commit it with a single command.

so since pinxi is a branch release: pinxi -U --man
results in pinxi update and man install/update, from github.

pinxi -U 3 --man
results in grabbing both the pinxi and man versions from the dev server, smxi.org, which can be useful on old systems with expired ssl stuff, github doens't allow non ssl access due to attacks they have suffered.
Absolutely. You have a lot left on your plate anyhow.

pinxi -U --man it is then.
 
Old 03-22-2018, 08:36 PM   #112
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Just a quick note that I installed the man with --man and the resultant man pinxi produces a man page containing lots of escape sequences (showing as e.g. ^L characters). Is there something obvious I'm missing?

Code:
NAME
       inxi  - Command line system information script for console and IRC

SYNOPSIS
       ^LBinxi^LR - Single line, short form. Very basic output.

       ^LBinxi ^LR[^LB-AbBCdDfFGhHiIlmMnNopPrRsSuw^LR] ^LR[^LB-c NUMBER^LR] ^LR[^LB-v NUMBER^LR]

       ^LBinxi ^LR[^LB-t ^LR(^LBc^LR or^LB m^LR or^LB cm^LR or^LB mc NUMBER^LR)] ^LR[^LB-x -OPTION^LR(^LBs^LR)] ^LR[^LB-xx -OPTION^LR(^LBs^LR)] ^LR[^LB-xxx -OPTION^LR(
^LBs^LR)]

Note also that I had to use sudo ./pinxi -U --man - it worked fine but then again I started from scratch (after a git clone of the latest version) and I am not sure whether in the future that will in fact set some of my pinxi files to root ownership if it actually has to update. My pinxi installation is currently in a user-owned folder on my desktop. Perhaps I should install it in a root-owned directory in order to allow proper updating *and* man installation with the same command.

Last edited by hydrurga; 03-22-2018 at 08:50 PM.
 
Old 03-22-2018, 08:52 PM   #113
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
no, nothing obvious. I fear this may depend on your $SHELL since my tests with Bash shell as $SHELL worked perfectly.

of course, this is what pinxi is for. I'm glad I made it --man and not default.

Actually, there's a subtle thing, I forgot, on pinxi -U --man it will show 'gz' if it's coming from the gzip source, which is smxi.org, and it will not say 'gz' if it's coming from the file based github source.

yes, you have to use sudo to install man page, it goes to /usr/local/share/man/man1 for pinxi, or any manually installed inxi.

pinxi.1.gz has to be root owned since all the man pages are in root owned files.

paths to man are set in the system, pinxi/inxi uses that to verify if the /usr/local path is in the man path collection.

let me check my permission checks there, I may not have gotten them totally right, but yes, actually, they are.

It checks to see that the directory exists, that it is writable by current pinxi user, etc, and will show error if not.

So it's not going to install the man file to root owned unless it can, otherwise it exits with error and lets you know.

I'll test this on some remote installs, but unfortunately, my installs are all similar so they won't reflect any possible real differences.

But I'll verify the pinxi -U --man updater, which is a feature that's now some minutes old, heh.
 
Old 03-22-2018, 08:54 PM   #114
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
GREAT news, ok, not great, but it reproduced, which is step one.

echo is evaling the escapes, I see what it is, I wasn't sure this would work.

I'll do another try, you did nothing wrong, and I'm not sure why my main system doesn't show the problem.

It's actually very risky rolling out new features as quickly as i'm doing, in normal inxi dev cycles, I spend days researching, and weeks implementing what I am currently doing almost daily.
 
Old 03-22-2018, 08:59 PM   #115
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
It's because on the system it works I'm using perl downloaders, which aren't default.

The issue is caused by using the other downloaders, which is easy to figure out.
 
Old 03-22-2018, 09:08 PM   #116
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
this should be corrected in 2.9.03-13

I bypassed the stdout and download directly to the man location, then I have gzip compress the file, replacing it with the gz'ed version.

I'm not clear why the perl native downloader did not cause this issue, but that's fine, I'm glad you saw it before this spread.

pinxi is working really well for testing, I'm sold on it. Now that the man installer works that will make testing man trivial.

Last edited by h2-1; 03-22-2018 at 09:11 PM.
 
Old 03-22-2018, 09:33 PM   #117
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
2.9.03-14

Looking good now, thanks.
 
Old 03-22-2018, 10:01 PM   #118
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
thanks for noticing it, that would have been embarrassing. Glad I didn't move pinxi to inxi next.

I'm by the way now finding an immediate benefit, I commit a man edit, then just update, with --man, and there it is.

Now, obviously I could also just gzip -c -9 pinxi.1 > man/file/path/pinxi.1.gz but that means I have to be in the right directory, remember the path, all in all far too much, which is why I almost never did it.

Now I just pinxi -U --man and presto, latest man is there! I like it.
 
1 members found this post helpful.
Old 03-23-2018, 06:21 PM   #119
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
@h2-1, I'm planning on providing you with those suggested man page edits as a .odt file with Track Changes. Is that ok with you? If so, I'll need a way of getting it to you. I can't seem to find your email address anywhere...
 
Old 03-23-2018, 06:30 PM   #120
h2-1
Member
 
Registered: Mar 2018
Distribution: Debian Testing
Posts: 556

Original Poster
Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
I honestly don't know what track changes are, I know odt. Are there so many errors? sigh.

Note: I just updated the man page because I decided to get rid of most of the --alt values and replace them with easier to remember variants, like --no-ssl, --no-host, --host, --dmidecode. I found that even though I made those, I couldn't remember them as just integer arguments, so it's pretty unlikely anyone else would.

This change is also in the help menu. pinxi 2.9.04-03

Last edited by h2-1; 03-23-2018 at 06:56 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox: are we its informal beta-testers? FeyFre Slackware 29 11-21-2011 02:15 AM
Beta Testers Needed msound General 18 07-28-2006 10:22 AM
looking for beta testers grizzly General 5 03-20-2004 11:24 AM

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

All times are GMT -5. The time now is 11:42 PM.

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