You are not logged in.

#1 2012-07-11 12:03:27

mich04
Member
From: Illinois - United States
Registered: 2011-10-25
Posts: 369

Arch linux with Puppy sized programs

Hey there,
So I have been exploring cutting down programs to achieve minimal space. Puppy Linux is my inspiration. especially guy dog http://www.murga-linux.com/puppy/viewtopic.php?t=72576. I am wondering if anyone else has been trying this out. I tried to use puppy linux, but Arch has the best package management system as far as ease of use. I even tried aptosid yesterday. even though it was "easier" to install and got me a working system quickly the package management is dirty to look at.

This whole idea is going back to https://bbs.archlinux.org/viewtopic.php?id=135336, I was able to run arch off a flash drive very easily, and am able to create ram disk to move partitions into ram but i still would like to get arch cut down.

Here is a comparison of a problem in my mind. I install fluxbox. 15 mb (not dwm small, but small) then I go and install firefox.....151 MB.....why is it so big? Why is it that puppy linux is able to fit a whole system under 200 mb? These are the questions I would like to discuss. I am cutting down on all my code in configuration files...and trying to automate cli programs like wireless-tools so that I can full functionality without using a gui front...Any thoughts?


I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.

Offline

#2 2012-07-11 12:25:10

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,521
Website

Re: Arch linux with Puppy sized programs

The small distros use different programs, it's as simple as that.

Firefox is big.  Ive never seen one of the "micro" distros with firefox.  Midori is often used instead.

Also busybox is often used in place of core utils and ash in place of bash.  You can cut down on the apps, but I doubt an arch system would run on busybox/ash.

FYI Slitaz may be another good reference.

Edit: I suppose in addition to using different programs, they also use compilation options fitting their purpose.  In a sense though this is still different software.

Last edited by Trilby (2012-07-11 12:46:39)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#3 2012-07-11 13:01:26

Gusar
Member
Registered: 2009-08-25
Posts: 3,409

Re: Arch linux with Puppy sized programs

The trick is to trim packages to nothing but the absolutely necessary. Arch pretty much does a "make install" for every package. This gives you everything, including static libs, headers, documentation, localization, and stuff. That's why Arch packages are large. Now compare that to how Slitaz does it - it's recipes aren't that much different from PKGBUILDs, but instead of doing "make install", they manually copy just the files they want into the pkg dir.

@Trilby: You can't get rid of bash (initscripts, netcfg, PKGBUILDs are all bash), but you can replace coreutils and most of util-linux and a few other things with busybox. This does save you space, but you save a lot more by removing headers, documentation and such.

Offline

#4 2012-07-11 13:19:15

mich04
Member
From: Illinois - United States
Registered: 2011-10-25
Posts: 369

Re: Arch linux with Puppy sized programs

Guy dog has firefox as the web browser if you look at guy dog it actually has a good set of programs, I do trim scripts and remove all the documentation down to just the few lines that I need, I will look furthuer into the subject.

I really need to dig more into guy dog. Iguleder, has done a wonderful job on it. running openbox, wbar, tint2, firefox.....the whole thing is around 105 MB......it has an x server (arch x server 50 mb) and such and will run on any of my computers when installed on a usb drive. Arch will not run on all my computers as easily...if they only pull the certain files they need why does Arch not do this?

I am also not trying to put down the developers because I am obviously still using Arch, only because of the package management and the ability to configure everything myself.


I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.

Offline

#5 2012-07-11 13:22:32

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,521
Website

Re: Arch linux with Puppy sized programs

You may also want to look into stripping binaries.  And I do mean 'look into it' don't just take my advice and strip everything.  I know just enough to know this can cut down binary sizes a bit - often a very good bit.  I don't know what the potential side-effects or pitfalls are aside from making debugging more difficult.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#6 2012-07-11 13:23:13

mich04
Member
From: Illinois - United States
Registered: 2011-10-25
Posts: 369

Re: Arch linux with Puppy sized programs

ok, I was thinking about this. The ability to cut down a program and still keep all the fat trim would be pretty hard. those smaller distros do tend to stay back a few upgrades that is what probably gives them the ability to cut things down..


I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.

Offline

#7 2012-07-11 13:51:30

Psykorgasm
Member
From: England, UK
Registered: 2011-11-24
Posts: 158

Re: Arch linux with Puppy sized programs

What about using upx on all binaries/scripts/.so files? I use it for a few things, mainly some standalone programmes/games and it will usually give ratios of 40-50% - you could probably half the overall size of these files with this, which could be a good start for a major slim-down overall. Never tried this myself I don't know if it will break anything (it shouldn'd?).

Last edited by Psykorgasm (2012-07-11 13:51:57)

Offline

#8 2012-07-11 13:57:23

Gusar
Member
Registered: 2009-08-25
Posts: 3,409

Re: Arch linux with Puppy sized programs

mich04 wrote:

if they only pull the certain files they need why does Arch not do this?

Because Arch is KISS. Trimming packages would require that Arch also ship the full versions of the same packages for those who do need all the stuff, it'd require having -dev packages like Debian and Fedora do, and such. That's too much hassle for Arch. It's simply a matter of philosophy.

@Trilby: The Arch packages are already stripped. What does help though is recompiling everything with -Os instead of the -O2 Arch uses.

@Psykorgasm: Using upx would actually be counterproductive. One, for a LiveCD/USB, you pack everything into a compressed squashfs image, and packing already compressed stuff results in a bigger image than doing compression at image creation. Two, upx compressed binaries use more ram at runtime.

Last edited by Gusar (2012-07-11 14:06:19)

Offline

#9 2012-07-11 14:00:00

mich04
Member
From: Illinois - United States
Registered: 2011-10-25
Posts: 369

Re: Arch linux with Puppy sized programs

@Psykorgasm I thought about that I think this topic has a better solution if I were to go that route...I just feel as though that the base of Arch could be tweaked to allow for less dependencies, if I were to install abi word right now it would take around 235 MB after all the dependencies..

https://bbs.archlinux.org/viewtopic.php?id=4924


I love computers, networking and Arch Linux. Sometimes I might ask a stupid question, but please have grace with me like I would with you.

Offline

#10 2012-07-11 14:20:03

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: Arch linux with Puppy sized programs

Psykorgasm wrote:

What about using upx on all binaries/scripts/.so files? I use it for a few things, mainly some standalone programmes/games and it will usually give ratios of 40-50% - you could probably half the overall size of these files with this, which could be a good start for a major slim-down overall. Never tried this myself I don't know if it will break anything (it shouldn'd?).

You could also try to use fusecompress on the root filesystem. (initialize it from an uncompressed initramfs)

Online

#11 2012-07-11 15:46:02

Terminator
Member
From: Belgium
Registered: 2012-05-07
Posts: 265

Re: Arch linux with Puppy sized programs

mich04 wrote:

... if I were to install abi word right now it would take around 235 MB after all the dependencies..

For user programs like abiword, it is often possible to reduce the number of dependencies by compiling it yourself. You can often pass flags to configure to disable some dependencies. If you do that, you probably want to create a package for it so that it can be installed with pacman. See https://wiki.archlinux.org/index.php/Creating_Packages.

Offline

#12 2012-07-11 15:47:25

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: Arch linux with Puppy sized programs

I did this in the past, to be able to run a media center off of a way to small usb drive.

If you want to optimize, remember to make measurements so you know you get the big gains first :-)

I'd start off by (obviously) removing programs that are part of base, but maybe not needed. The recent discussion (which eventually went nowhere) on arch-dev-public might be a good starting point: http://mailman.archlinux.org/pipermail/ … 23059.html.

Secondly, I would consider if any big programs that are pulled in as dependencies could possibly be removed. I did this in the past, and found for instance that I could remove perl (50MB) as it was only used by a small script in openssl that I happened to know was not needed on my system.

I wouldn't go down the route of recompiling or exchanging programs for lightweight alternatives (swapping bash with dash saves you 4MB, but who knows how many new bugs you  get?), unless you really know it will make a big difference.

Lastly, you can use a disk analyzer to see if any folders, such as /usr/include, /usr/share/man or /usr/share/locale take up a lot of your space. If you deem you don't need them, just add a hack to remove them completely.

Lastly, if there are huge programs (firefox) that you really want, then it might be worth looking into how you could possibly ./configure them to be smaller (hopefully you can get hold of the PKGBUILD equivalent of the distro you referred to).

Just my 2 cents.

Offline

Board footer

Powered by FluxBB