Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

custom linux for embedded system with Perl

by morgon (Priest)
on Dec 29, 2010 at 07:44 UTC ( [id://879573]=perlquestion: print w/replies, xml ) Need Help??

morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

sorry for abusing this forum a bit, but as I have made far better experiences here than in several linux-forums I thought I give it a try.

In the forseeable future I may need to build a custom linux system for an embedded hardware (x86 compatible, 512MB RAM, 32GB flash) that will run Perl cgi-scripts.

It needs to contain (among a few other things) apache, mysql and Perl.

I wonder if someone could recommend a current distribution to use as a starting point to build such a system (I don't have any experience with such a task unfortunately)?

My current idea is to use something like Gentoo or Arch and try to slim that down as much as possible, but I would like to get some recommendations from people that have more experience with such things.

If you could point me to some forum that would be more appropriate I would also be thankful.

Many thanks!

  • Comment on custom linux for embedded system with Perl

Replies are listed 'Best First'.
Re: custom linux for embedded system with Perl
by moritz (Cardinal) on Dec 29, 2010 at 09:07 UTC
    Half a gig of RAM isn't all that small, the laptop I used in 2007 had similar characteristics. And Debian Sarge and Etch worked fine on it, even with a GUI.

    So I think a good first step would be to start with a minimal installation of your favorite Linux distribution, and only resort to "extra slim" alternatives if the need arises. If it does, Damn Small Linux might be worth looking at, though I don't know how well it is suited for server applications.

      I am not worried at all about the RAM size.

      But I need to build a whole system that does not consume more than 32GB of disk space and that I think will take some tinkering which is why I thought that maybe starting with source-based distros would be easier than trying to slim down Debian.

      As I find such things not that fascinating I'd rather avoid going down too many blind alleys...

        My Mandriva desktop from which I'm typing this has about 9.5 gigs in /home (data and some programs) and about 9.5 gigs in the rest of the system.

        In that 9.5 gigs I have lots of things installed. That includes 3D games. I have multiple database systems installed. There are two office suites. I have many graphics, audio, video, and animation editing packages installed. I keep around about a dozen different web browsers for testing. There's a mail server, a web server, an SSH server, and a DNS server. There are (at least) three perl installations on the system right now. There are at least six versions of the JRE installed. WINE and DOSBox are on there, along with some software written for Windows (the DOS "drive" mounts from my home directory though). Then there's all the logs, spools, docs, and other non-program data that's in the system.

        If you're having trouble fitting a Linux distribution, your code, and your data onto 32 gigs of space, then there's something very wrong or your code and data are very large.

        With 32 GB to play with this wont be a problem. You could easily create a proof of concept build containing everything you need using the Debian netinst CD within Virtualbox (or similar product).

        32 GB disk space is quite a lot, too. For what you want to do, a Debian base install plus the few extra packages you need should not require more than 2-5 GB.

        But I need to build a whole system that does not consume more than 32GB of disk space and that I think will take some tinkering

        Not at all. My non-minimalistic Debian installation takes 11GB, which includes all latex packages (quite a lot), a graphical environment, apache2, postgresql, a news spool, an office suite and so on.

        I don't use the distributions like SuSE or RedHat, but I'm pretty sure that even they will fit nicely onto 32GB hard disc.

Re: custom linux for embedded system with Perl
by Corion (Patriarch) on Dec 29, 2010 at 08:20 UTC

    If you don't need a full Perl, you can likely save quite some space by looking at staticperl. Alternatively, you can install just miniperl or microperl. You won't be able to install any modules that require XS after the master installation, and I'd be careful to always point out that this is not a "full Perl", but if you're pressed for space, that might help.

    Debian also ships the Perl documentation separately, so looking at what they leave out might also help.

Re: custom linux for embedded system with Perl
by ELISHEVA (Prior) on Dec 29, 2010 at 16:36 UTC

    I'm not sure how you would get even close to 32GB for an Linux OS unless you are adding oodles of features and have lots of cute graphics files or mountains of data. Did you have 32G reserved for the OS or for the OS + Data?

    According to Debian the installed size of Apache server is 100K. The installed size of MySQL client is 50K and MySQL server is 88K. Perl is part of the OS. So your packages add less than 250K.

Re: custom linux for embedded system with Perl
by JavaFan (Canon) on Dec 29, 2010 at 16:58 UTC
    Is there a Linux system out there which doesn't fit in 32GB, even with all packages installed? I've a hard time calling a system with 512Mb RAM and 32 Gb "embedded".

    Last time I looked at Linux distros, they all have "live-CDs", and full installations that fit in just a few CDs.

    Only a few years ago, I build Linux systems for boxes with 8Mb memory, 25Mb of disk space, with the option of installing it from a floppy disk. Obviously, Perl didn't fit. What did fit was a kernel (same kernel used elsewhere in the company - standard kernel + 1500 bugfixes), a few drivers for exotic hardware, busybox, a couple of C programs I had written or modified, and an init script. This wasn't based on any existing distro.

    My current idea is to use something like Gentoo or Arch and try to slim that down as much as possible, but I would like to get some recommendations from people that have more experience with such things.
    With 32 Gb of disk space, why bother slimming down? Just go through /etc/init.d/rc? and don't start what you don't want running.

    But this isn't really a Perl question, is it?

Re: custom linux for embedded system with Perl
by rowdog (Curate) on Dec 30, 2010 at 00:18 UTC

    As others have pointed out, you have plenty of resources to run a normal distro. If you do run into major constraints, you might want to check out Openembedded and T2 SDE.

Re: custom linux for embedded system with Perl
by TechFly (Scribe) on Dec 29, 2010 at 16:38 UTC
    Have a look at slax. It has scripts that make the build easier, and includes modules for many things. It is based on Slackware. That is my favorite linux for most things, but it is not quite the same as the rest. http://www.slax.org/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://879573]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found