Quote:
Originally Posted by rkelsen
How did you go with it? Do you have any improvements or suggestions? In particular, was there anything which didn't work for you?
What results did you get?
Sorry for all the questions...
|
Not sure if you still want some feedback but I went down this rabbit hole the other day. I closely followed your blog post and made a few small changes. For me the interesting part isn't so much how small the install is byte-wise, but how few packages can be installed to have a "usable" minimal system with no broken dependencies. This install comes in at 54 packages and 265MB.
A few things I did differently:
* I did not bother with ntp
* Used kernel-huge which negates the need for the mkinitrd package.
* Installed libevent as sftp requires that library.
* After the system was installed, I also saved /etc/localtime as /etc/Eastern, removed glibc-zoneinfo and copied /etc/Eastern back to /etc/localtime.
* I used the same trick to compress the kernel modules and /usr/doc as you did, but I used xz instead of gzip. This saves ~50MB.
* I deleted all of the non-English language man pages. (Could save a few more MB by just deleting the rest since the man-db package is not installed).
Now comes that part that is a little suspect. The system as installed will have some broken dependencies. The way I determined that is with the command:
Code:
find / \( -path /proc -prune -o -path /sys -prune -o -path /media -prune -o -path /mnt -prune \) -o -type f | xargs file | grep -i 'dynamically linked' | cut -d: -f1 | xargs ldd > /tmp/results.txt 2>/dev/null
I looked at /tmp/results.txt to see what was "not found". I determined that a few of the libraries from the aaa_libraries package had missing dependencies, but the libraries were not used by anything so I deleted the following:
Code:
rm /usr/lib64/libcups*
rm /usr/lib64/libldap*
rm /usr/lib64/libtiff*
rm /usr/lib64/libcurl*
rm -fr /usr/lib64/python2.7
rm -fr /usr/lib64/python3.9
At this point the system still has a few broken dependencies. If I recall correctly it was for
/sbin/tc and
/usr/bin/setpriv
I then installed the following in
/usr/lib64/microslack (basically copied from another system with a larger install):
Code:
lrwxrwxrwx 1 ang ang 18 May 7 06:57 libcap-ng.so -> libcap-ng.so.0.0.0*
lrwxrwxrwx 1 ang ang 18 May 7 06:57 libcap-ng.so.0 -> libcap-ng.so.0.0.0*
-rwxr-xr-x 1 ang ang 26928 May 7 06:52 libcap-ng.so.0.0.0*
lrwxrwxrwx 1 ang ang 20 May 7 06:56 libdbus-1.so -> libdbus-1.so.3.19.13*
lrwxrwxrwx 1 ang ang 20 May 7 06:56 libdbus-1.so.3 -> libdbus-1.so.3.19.13*
-rwxr-xr-x 1 ang ang 337752 May 7 06:52 libdbus-1.so.3.19.13*
lrwxrwxrwx 1 ang ang 19 May 7 06:56 libnl-3.so -> libnl-3.so.200.26.0*
lrwxrwxrwx 1 ang ang 19 May 7 06:56 libnl-3.so.200 -> libnl-3.so.200.26.0*
-rwxr-xr-x 1 ang ang 139120 May 7 06:53 libnl-3.so.200.26.0*
lrwxrwxrwx 1 ang ang 24 May 7 06:56 libnl-genl-3.so -> libnl-genl-3.so.200.26.0*
lrwxrwxrwx 1 ang ang 24 May 7 06:56 libnl-genl-3.so.200 -> libnl-genl-3.so.200.26.0*
-rwxr-xr-x 1 ang ang 32192 May 7 06:53 libnl-genl-3.so.200.26.0*
lrwxrwxrwx 1 ang ang 17 May 7 06:50 libpcap.so -> libpcap.so.1.10.1*
lrwxrwxrwx 1 ang ang 17 May 7 06:50 libpcap.so.1 -> libpcap.so.1.10.1*
-rwxr-xr-x 1 ang ang 348504 May 7 06:50 libpcap.so.1.10.1*
lrwxrwxrwx 1 ang ang 20 May 7 06:45 libxtables.so -> libxtables.so.12.4.0*
lrwxrwxrwx 1 ang ang 20 May 7 06:45 libxtables.so.12 -> libxtables.so.12.4.0*
-rwxr-xr-x 1 ang ang 71560 May 7 06:44 libxtables.so.12.4.0*
After that I ran the following and rebooted:
Code:
echo "/usr/lib64/microslack" > /etc/ld.so.conf.d/microslack.conf
rm /etc/ld.so.cache
ldconfig
I then updated the following packages with upgradepkg so that i have a patched system running kernel 5.15.94:
aaa_base gzip kernel-huge kernel-modules openssh openssl-solibs tar util-linux xz
I then installed
wireguard-tools which did not require anything else.
I have another system where I did install ntp and all the requirements for slackpkg. I took the find command from above and wrapped it in a little script that uses slackpkg's file-search feature and finds the packages I need to install. It's not 100% fool-proof as sometimes it does not find the package you need (libXaw is one I recall as the base of the symlink does not actually match the library name). I basically keep running that script until there are no missing dependencies. I think the system came out to about 120 or so packages. Then with httpd and gcc it ballooned to something like 167.
I call it
reconcile.sh
Code:
#!/bin/bash
find / \( -path /proc -prune -o -path /sys -prune -o -path /media -prune -o -path /mnt -prune \) -o -type f | xargs file | grep -i 'dynamically linked' | cut -d: -f1 | xargs ldd > /tmp/results.txt 2>/dev/null
grep 'not found' /tmp/results.txt | sort | uniq | awk '{ print $1 }' | rev | cut -d. -f2- | rev > /tmp/missing-libraries.txt
COUNT=$(wc -l /tmp/missing-libraries.txt | awk '{ print $1 }')
if [ $COUNT == 0 ]; then
echo "No missing dependencies!"
exit
else
echo "We have work to do for the following missing libraries:"
cat /tmp/missing-libraries.txt
echo
fi
while read FILE
do
slackpkg file-search $FILE | grep uninstalled
done < /tmp/missing-libraries.txt | sort -V | uniq | awk '{ print $3 }' > /tmp/needed-packages.txt
echo "The following packages need to be installed:"
cat /tmp/needed-packages.txt
echo
echo "Press any key to continue."
read keystroke
while read PKG
do
slackpkg install $PKG
done < /tmp/needed-packages.txt
Anyway, hopefully someone finds this interesting (My first post in a few years!)