Introducing StripSlack, a minimal configuration of Slackware
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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).
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.
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.
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
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.
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.
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.
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.
#!/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.
#!/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.
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.
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:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.