WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to remove functionality from TinyCore  (Read 5331 times)

Offline ajax

  • Newbie
  • *
  • Posts: 6
How to remove functionality from TinyCore
« on: December 02, 2010, 10:00:12 AM »
Can anyone shed some light on how to remove features from TinyCore?  I'm running TinyCore 3.2.  If I press the "tab" key twice at the terminal command prompt, I get a list of over 200 commands that are available to me.  I want to remove about 90% of these commands: things like "which", "telnet", "uniq", etc.  I realize these are all included in the BusyBox collection of utilities, but I do not want them in the OS at all.  Also, MiniCore is not option because I do require X Windows to be running.  So, I guess what I am asking is "how do I remove every executable that is not in the dependency chain for X Windows".  It's not that I'm concerned about the size of the tinycore.gz file.  I just want the least amount of functionality in a functioning X windows system.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to remove functionality from TinyCore
« Reply #1 on: December 02, 2010, 10:47:55 AM »
While there may be good reasons to remove unused functionality, the difficulty is in identifying which files are used by the system and which are not. That may require a lot of analysis and testing. Telnet is not used by Tiny Core scripts, but which and uniq definitely are.

Are you interested in retaining TC-specific functionality or is your objective an unmodifiable X-windows environment?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to remove functionality from TinyCore
« Reply #2 on: December 02, 2010, 12:29:26 PM »
Since busybox is a single executable, removing the symlink for a specific function does not change the size or functionality of the system.
The function is still in busybox and can still be invoked as an argument.  Ex: 'busybox telnet'.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to remove functionality from TinyCore
« Reply #3 on: December 02, 2010, 01:50:11 PM »
Yes, recompiling busybox is the only way to permanently remove the ability to invoke functionality.

tc@box:~$ busybox|tail +15|sed 's/,/\n/g'|sort -u|wc -l
232

There are 231 applets included in the current busybox, so that will take some effort to analyze.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to remove functionality from TinyCore
« Reply #4 on: December 02, 2010, 04:23:18 PM »
You might start to configure busybox with 'make oldconfig', using the busybox config file from the repo and then disable features with 'make menuconfig', or start with 'make allnoconfig' and respectively enable features.

BTW, AFAIK the busybox in MC is the same as in TC.
« Last Edit: December 02, 2010, 08:30:57 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline ixbrian

  • Retired Admins
  • Sr. Member
  • *****
  • Posts: 436
Re: How to remove functionality from TinyCore
« Reply #5 on: December 04, 2010, 01:44:55 AM »
This isn't a perfect method, but you can identify some of the busybox applets that are likely not used in the base system applications/scripts by doing the following.  Boot up "base norestore", and then run this script ("busybox --list" is a new busybox feature so this script will only work on very recent versions of Tiny Core)

Code: [Select]
#!/bin/sh
for applet in `busybox --list | grep -v "\["`; do
        count=`sudo find / -xdev -type f | grep -v "/bin/busybox" | grep -v "/etc/services" | sudo xargs egrep -w $applet | wc -l`
        if [ $count -eq 0 ]; then
                echo "$applet"
        fi
done

When I run this in 3.3, I get the following list of busybox applets that are likely not used in the base system applications or scripts and could be possible candidates for removal if you are trying to recompile busybox to  make it smaller :

Code: [Select]
addgroup
arp
arping
bunzip2
bzcat
cal
chrt
chvt
cksum
comm
crontab
deallocvt
delgroup
deluser
dhcprelay
diff
dnsd
dnsdomainname
dumpkmap
dumpleases
egrep
eject
ether-wake
fakeidentd
fbset
fdflush
fgconsole
fgrep
freeramdisk
ftpget
ftpput
fuser
halt
hexdump
inetd
insmod
ipcrm
ipcs
linux32
linux64
linuxrc
loadfont
logname
logread
losetup
lsmod
mesg
microcom
nameif
netstat
nohup
nslookup
openvt
patch
pgrep
ping6
printenv
pscan
rdate
renice
rev
rmmod
rpm
rpm2cpio
setarch
setconsole
setkeycodes
sha1sum
split
start-stop-daemon
sulogin
tail
taskset
telnet
telnetd
traceroute
unix2dos
unxz
unzip
uptime
uudecode
uuencode
vconfig
vlock
whoami
xzcat
zcip
« Last Edit: December 04, 2010, 01:48:07 AM by ixbrian »

Offline ajax

  • Newbie
  • *
  • Posts: 6
Re: How to remove functionality from TinyCore
« Reply #6 on: December 14, 2010, 02:46:28 PM »
Thank you all for the responses.  ixbrian, thanks for the script identifying the removal candidates.  I'll update this thread after I try it out and see if I can recompile busybox with those removed.