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 01-28-2015, 08:44 AM   #76
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,098

Rep: Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175Reputation: 4175

Quote:
Originally Posted by kikinovak View Post
The question was raised as to whether or not to include some development tools (gcc, make, kernel-source, ...). While the user who raised this may have a point, I think the better solution to keep things sane is to build stuff on a dedicated (virtual) build machine, and then only use the server to actually run the stuff.
it has been my choice for many years mainly for two reason:
- "what there isn't doesn't break";
- in the remote case of a break-in, I prefer to leave less tools possible available to the attacker (compilers being the most valuable ones).
 
1 members found this post helpful.
Old 01-29-2015, 01:10 AM   #77
viewtiful_jon
LQ Newbie
 
Registered: Apr 2014
Posts: 12

Rep: Reputation: 4
Hey @kiki, I found a typo in the "stripslack.sh" file, Line 55:

"| Checking for packages to te removed from your system..."

Also, in that same script, would it make more sense to use slackpkg for the removal process instead of removepkg? This would allow the user to review the package list in the same way they can review the list before the install step later on in the script.
 
1 members found this post helpful.
Old 01-29-2015, 03:52 AM   #78
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by viewtiful_jon View Post
Hey @kiki, I found a typo in the "stripslack.sh" file, Line 55:

"| Checking for packages to te removed from your system..."

Also, in that same script, would it make more sense to use slackpkg for the removal process instead of removepkg? This would allow the user to review the package list in the same way they can review the list before the install step later on in the script.
I corrected the typo and followed your suggestion. Now the removal process uses slackpkg instead of removepkg. I also added a paragraph in the README explaining how to import and run the stripslack.sh script.
 
Old 01-29-2015, 05:03 AM   #79
c94p67
LQ Newbie
 
Registered: Aug 2014
Posts: 16

Rep: Reputation: Disabled
@kikinovak

This is great. I have never actually tried to make a minimal system for slackware. I always just went balls deep. This seems to be working nicely though.
896 MB install. That is a hell of a lot better than 8 GB+

As a sidenote, your howto could include how to chroot and generate the initrd. Or even better, include it in your stripslack.sh script.

Code:
 

mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys

chroot /mnt /bin/bash

/usr/share/mkinitrd/mkinitrd_command_generator.sh | bash
And dont forget to run lilo after adding initrd.gz to /etc/lilo.conf like i did hehe

I might put this on my server.

Last edited by c94p67; 01-29-2015 at 05:05 AM.
 
Old 01-29-2015, 07:04 AM   #80
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by c94p67 View Post
As a sidenote, your howto could include how to chroot and generate the initrd. Or even better, include it in your stripslack.sh script.
I thought about it, but decided against it. There's a fat chance StripSlack will only be interesting for seasoned Slackware users. And those already know how to do that kind of stuff. Correct me if I'm wrong.
 
Old 01-29-2015, 08:19 AM   #81
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
I think this little project has reached a point where the next logical step is thinking more in depth about the system's coherence, e. g. dependencies.

So far, I've been using the little script depcheck.sh for this task, but it's rather crude. I didn't create it from scratch, but actually took the inspiration from the first of the three scripts on this page.

I'm a bit undecided about this subject, so I guess I'm open for suggestions and/or contributions for depcheck.sh.
 
Old 01-29-2015, 04:26 PM   #82
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
The script uses ldd. I wonder if using readelf, instead, would be cleaner. I might play around with this some this weekend. If I come up with anything worth noting, I can share it here.
 
1 members found this post helpful.
Old 01-29-2015, 05:04 PM   #83
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by j_v View Post
The script uses ldd. I wonder if using readelf, instead, would be cleaner. I might play around with this some this weekend. If I come up with anything worth noting, I can share it here.
That would be nice. This is not a field I'm very competent in. I only know the basics.
 
Old 01-31-2015, 04:40 PM   #84
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
I have the sketch of a script started:

Code:
#!/bin/sh
# getdeps_dir.sh -- create a list of dependencies for each directory on the command line

FILE=/usr/bin/file
GREP=/bin/grep
READELF=/usr/bin/readelf
SED=/bin/sed
SORT=/bin/sort
UNIQ=/bin/uniq

if [ $# -eq 0 ]; then
    printf '%s: no arguments\n' ${0##*/}
    exit 1
fi

for p in "$@" ; do
    [ -d $p ] || continue
    for f in $p/* ; do
        if $FILE $f | $GREP -Eq 'ELF .* dynamic' ; then
            $READELF -d $f | $SED -n '/NEEDED/s/.*\[\(.*\)\].*/\1/p'
        fi
    done
done | $SORT | $UNIQ
This is only my starting point and (for now) based on slackwiki script. I'm thinking of playing around with scanning a repo and saving dependencies per package. Ideas welcome.
 
1 members found this post helpful.
Old 01-31-2015, 05:16 PM   #85
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by j_v View Post
I have the sketch of a script started:

Code:
#!/bin/sh
# getdeps_dir.sh -- create a list of dependencies for each directory on the command line

FILE=/usr/bin/file
GREP=/bin/grep
READELF=/usr/bin/readelf
SED=/bin/sed
SORT=/bin/sort
UNIQ=/bin/uniq

if [ $# -eq 0 ]; then
    printf '%s: no arguments\n' ${0##*/}
    exit 1
fi

for p in "$@" ; do
    [ -d $p ] || continue
    for f in $p/* ; do
        if $FILE $f | $GREP -Eq 'ELF .* dynamic' ; then
            $READELF -d $f | $SED -n '/NEEDED/s/.*\[\(.*\)\].*/\1/p'
        fi
    done
done | $SORT | $UNIQ
This is only my starting point and (for now) based on slackwiki script. I'm thinking of playing around with scanning a repo and saving dependencies per package. Ideas welcome.
I would say finding "raw" dependencies should be sufficient. There's always 'slackpkg file-search libsomething.so.something' to find the corresponding package. Keep It Simple.
 
1 members found this post helpful.
Old 01-31-2015, 05:59 PM   #86
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
heads-up

Just a reminder:

The Salix project provides one small text file for each package that lists its dependencies among the other Slackware packages.

Here are links for Slackware version 14.1:
deps for 64-bits (x86_64)
deps for 32-bits (i486)

These links are to a specific mirror, the list of mirrors is there.

I think that these .dep files we could easily answer a question like "is this set of packages consistent, or do some of them miss dependencies"?

It nobody's done that yet, I'll try tomorrow as a learning exercise.

You can check other works of gapan, aka George Vlahavas in that field here.
 
Old 01-31-2015, 06:12 PM   #87
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
Just a reminder:

The Salix project provides one small text file for each package that lists its dependencies among the other Slackware packages.

Here are links for Slackware version 14.1:
deps for 64-bits (x86_64)
deps for 32-bits (i486)

These links are to a specific mirror, the list of mirrors is there.

I think that these .dep files we could easily answer a question like "is this set of packages consistent, or do some of them miss dependencies"?

It nobody's done that yet, I'll try tomorrow as a learning exercise.

You can check other works of gapan, aka George Vlahavas in that field here.
These dep files are not exactly complete. I understand that this thread is about a minimal Slackware install, but do not depend on them for anything beyond that. If one were to want to continue to build on top of StripSlack, say add a DE or WM, the X.org packages that are required are omitted from these deps. Just throwing that in there from experience. I do like that they have provided them, and they have proved useful to me when I built my own custom Slackware install, but again, don't depend on them after StripSlack.

Last edited by Skaendo; 01-31-2015 at 06:30 PM.
 
1 members found this post helpful.
Old 01-31-2015, 06:15 PM   #88
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
Quote:
Originally Posted by kikinovak View Post
I would say finding "raw" dependencies should be sufficient. There's always 'slackpkg file-search libsomething.so.something' to find the corresponding package. Keep It Simple.
Thanks. Good point. So, using what I have so far, I ran from the command line:
Code:
$ for f in $(./getdeps_dir.sh $(echo $PATH | sed 's/:/ /g')) ; do /usr/sbin/slackpkg file-search $f ; done | sort | uniq
This takes a little while on a full installation (2-5 minutes on my 3.3ghz 6 core, I didn't time it). In a stripped down install, it should run much quicker. I also think that it might be better to run this in a multistage process, saving the output from the getdeps script; this would chew on much less ram:
Code:
$ libsfile=$(mktemp /tmp/getdeps.XXXXXX)
$ pkgsfile=$(mktemp /tmp/pkgdeps.XXXXXX)
$ getdeps_dir.sh $(echo $PATH | sed 's/:/ /g') > $libsfile
$ while read -r library ; do /usr/sbin/slackpkg file-search $library >> $pkgsfile ; done < $libsfile
$ rm $libsfile
$ sort $pkgsfile | uniq > pkg_deps.txt
$ rm $pkgsfile
Do you think it's going too far using the file-search? I could also easily bundle this into a single script, perhaps even improving performance some as well as reducing system load.

Last edited by j_v; 01-31-2015 at 06:35 PM.
 
Old 01-31-2015, 06:19 PM   #89
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
Quote:
Originally Posted by Skaendo View Post
These dep files are not exactly complete. I understand that this thread is about a minimal Slackware install, but do not depend on them for anything beyond that. If one were to want to continue to build on top of StripSlack, say add a DE or WM, the X.org packages that are required are omitted from these deps. Just throwing that in there from experience. I do like that they have provided them, and they have proved useful to me when I built my own custom Slackware install, but again, don't depend on them after StripSlack.
Very valid point. Also to concider is interpreters like perl, python, lua, tcl, tk... etc, etc... tracking dependencies there gets a bit more complicated.
 
1 members found this post helpful.
Old 01-31-2015, 06:36 PM   #90
viewtiful_jon
LQ Newbie
 
Registered: Apr 2014
Posts: 12

Rep: Reputation: 4
In the past, I've tried making a minimal set of Tagfiles based on the Salix dependency files, but I found it didn't quite work out. As mentioned previously, certain development tools don't have full dependencies (IIRC "autoconf" and "automake" don't list "m4" as a dependency, despite the SlackWare package descriptions saying it is one). Also, fully tracing the Salix dependency files begins to move the system towards the heavier side, which, while not exactly a problem, is somewhat counter to the exercise at hand.
 
2 members found this post helpful.
  


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
Minimal configuration to run XWindows client software? FeyFre Slackware 4 03-06-2012 12:11 PM
Need minimal Samba configuration with guest r/w share instructions daggett Linux - Server 1 11-09-2011 03:22 PM
help plz, redhat entreprise 3 minimal hardware configuration akadidm Linux - Hardware 3 06-12-2006 05:35 AM
Minimal Slackware hsimah Linux - Newbie 5 01-06-2006 09:03 PM
Minimal Slackware? Allen614 Slackware 26 03-21-2004 03:17 AM

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

All times are GMT -5. The time now is 02:01 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