Linux.com

Community Blogs



Creating a custom live distro for a target appliance

After a long period of absence from the site I'm back with a lot of work done on custom embedded appliances and Linux custom live CD creation. This is the first article of an hopefully good series of topics related to custom CD/USB creation, but before entering into too much details on it I'd like to answer a common question about this: “why do you go there ?”

 

Motivation

Here is the short version:

  • I'd like to have a minimal system without too much software dependencies

  • It has to be really small and run on tailored devices with memory and CPU constraints

  • It's not a desktop system, software and general requirements don't change, no additional software installation is needed after initial startup

  • Startup configuration and installation has to be quick (no user interaction)

  • I'm a geek and I tend to revert/control everything I've around me

  • Because it's fun and it's nice to learn something

Here's the long version:

  • I'd like to learn more from a live CD/USB creation

  • I'd like to have a small footprint installation

  • this appliance has to run without external user interaction, no administration needed or available for it; it has to be reliable and survive to: power losses, HD malfunction, general HW failures, bad usage or tough environment temperatures, holy bible plagues, …

  • the appliance has to be replaceable quickly, something like a swap with an identical device. Linux OS “boot media” has to be exchangeable and easily upgradeable by a common user without IT skills

  • It has to run completely on RAM (ram disk and configuration), if something goes wrong I'd like to “fix” my problems with just a reboot (restore factory defaults)

  • No video/console available, this device has: a power cable, an ethernet cable

  • low spec CPU power needed, I just need to run few apps on it (Samba and few more), I don't need 1000 cores for basic things

  • Because it's fun and it's nice to learn something

 

Requirements

So you're may wondering about what kind of task I'd like to achieve, it's pretty simple: an home server NAS with just few custom constraints, here are:

  • Has to run from RAM (disk+memory) as previously reported, I don't want to configure or modify my needs too quickly (after first installation)

  • It has to be cheap, at least until I don't get enough money for a custom made ARM device, for the entire project I've spent 80$ / 60€

  • I pay my electricity bill so it has to adsorb less watts as possible (a pentium class device is not my choice for a 24/7 machine)

  • It has to have enough CPU power to sustain few CPU intensive jobs (asterisk, P2P programs, online UPnP video/audio decoding and streaming, samba), I've used MIPS/ARM devices for this particular task but even if they're more appealing when you talk about power usage you've few troubles with CPU intensive tasks (UPnP, video/audio streaming or torrent for example)

  • I need USB ports

  • Hardware may fail, heat and dust are big problems, I'd like to have a machine without moving parts, I don't want to use an HD for the Linux installation, I don't want to have a fan over the CPU or the power supply, I'd like to rely on removable media so if there's something wrong I may move my installation to a similar machine

  • Linux root system resides in an USB stick, it has to be read only and load the system on boot. USB sticks have an “infinite life” (a sort of) if you use them as read only devices, they're even cheap and easily replaceable for an average user without IT skills

  • If you've an HW failure you may recover everything with just these swap parts: a standard ATX power supply, a similar mobo+cpu, a cheap usb stick

  • Linux installation in just 100Mb or maybe something more, I've a lot of 128Mb usb sticks to waste so I've cut my distro to stay around 100Mb

  • I'd like to attach an external USB drive with my own media (photo, films, music, …), this media is just read from “home clients” (read: media stations connected to TVs), sometimes someone (me) uploads contents on it or does entire backups of it

  • It has to be expandable easily: adding a web cam, a sound card, an Internet audio/video streaming with icecast should be possible without too much troubles

  • It has to be close to x86 architecture to be cheap, believe me: I'm an embedded specialist and I'd like to stay with ARM/MIPS devices when they're available, I like to deal with toolchains and cross compile installations but my device has to be really cheap, it's hard to beat the price I've mentioned

  • I don't wanna waste too much time on it, it has to be ready as soon as possible

  • It's not just a NAS, it's an “home server”, I've web apps, Internet audio/video streams, files, UPnP (and more...) on it, I've used a lot of NAS-like distro but I'd like to have something more

 

 

Hardware

For this particular project I've chosen to use an ATOM CPU: single board, single core, desktop, no particular peripherals (I only need the USB bus and the ethernet card), no frills and damn cheap. There are plenty of them available everywhere, I've just chosen the cheaper one with USB ports and 1 Ethernet, overall cost: 80$ (you may find something cheaper across 50-60$)

 

The Plan (Plan 9 from outer space)

This is just an intro for a series of articles describing my own initial project, now I've expanded it to something else but at least I'd like to describe why I'm doing this and what kind of results I'd like to have, when I've started it I've wasted a lot of time on research (hw/sw) but now I've a more clear path to my own personal appliances. Here's what I've did:

  • Building a minimal image
  • Trying to use a RAM disk

  • Run the entire distro from a RAM disk (so read only media)

  • Trim it to minimal memory (user memory) consumption, XOrg is not needed

  • Packaged and automated it (some scripting)

  • Build the installation media (my USB stick)

 

Follow all these chapters to read the entire post

 

 

 

I'd like to interact with you and have your opinions as well, feel free to collaborate and discuss my own opinions, especially if they're different from mine

 

Ben

 

 

openSUSE Weekly News 168 is out!

We are pleased to announce our openSUSE Weekly News #168.

In this Issue:

  • openSUSE 11.4 still going strong
  • Linux Foundation 20th Anniversary of Linux Campaign and Video Contest
  • Adrian Schröter: Policy proposal for Factory: Make source of tar balls trackable
  • Frédéric Crozat: GNOME 3 live image release 0.2.0 is out
  • and many more ...

You can download it there:

We hope you enjoy the reading :-)

Older content can be found there.

Flattr this

 

openSUSE Weekly News 167 is out!

We are pleased to announce our new Issue 167 of openSUSE Weekly News.

This Week:

  • Mingle today is an interesting Article about connect.opensuse.org
  • SUSE Studio: Upgrade your older appliances to 11.4
  • Virtual Releaseparty
  • Lord of the Rings Online with wine
  • and many more ...

Available under: http://en.opensuse.org/Archive:Weekly_news_other_sources#Issue_167


No we hope you enjoy the reading :-)

Comments, News and Wishes can send to  This e-mail address is being protected from spambots. You need JavaScript enabled to view it .

 

openSUSE Weekly News 166 is out!

Geeko

We are pleased to announce our new Issue 166 of openSUSE Weekly News.

 

Available under:

 

 

No we hope you enjoy the reading :-)

 

Comments, News and Wishes can send to This e-mail address is being protected from spambots. You need JavaScript enabled to view it .

 

 

To add new library path in ubuntu 10.10

To add new library path, create new file in /etc/ld.so.conf.d folder and open it in your favorite editor

$ sudo gedit /etc/ld.so.conf.d/newlib.conf


Add the path to file and save it

/path/to/new/lib


Run 'ldconfig' to update the necessary links and cache

$ sudo ldconfig

 

 

Terminal is not fully functional - in Ubuntu 10.10

If this error/warning appears, means the terminal is dumb. It can be verified by executing following command at terminal:

$ echo $TERM
dumb

update the following packages from 1:0.26.0-ubuntu1 to 1:0.26.0-ubuntu2, and restart application:

  • libvte

  • python-vte

I found this solution at http://guake.org/ticket/249 and it solves my problem related to Guake.

 

In ubuntu make sure you have selected Important security and Recommended updates at

System > Administration > Synaptic Package Manager > Settings > Repositories > Updates

Otherwise latest packages will not be available for installing and update.

 

 

 

Arch Steps Up - Debian Takes a Backseat

I recently did some soul searching regarding my GNU/Linux philosophy. I found that I wasn’t being true to myself.

For years now, I’ve run Slackware Linux as my primary operating system and a second, fully updated version of Debian as my  secondary OS. I’m a firm believer in simplicity and stability. I enjoyed both of those qualities in Slack and Deb, of course. They are both rocks when it comes to stability. I’ve never had a crash in either operating system that was due to the OS itself. Any crashes were usually caused by something stupid that I had done.

All that being said, while contemplating upgrading from Debian Lenny to Squeeze, I had an epiphany. Slackware and Debian are not very much alike, other than their common quality of stability. Where Slack has a relatively small application set; Debian’s repos are huge. Where Slack uses close to the newest versions of its software; Debian uses versions that are typically three to four releases old (VERY stable and proven stuff).

It was always difficult for me to sync Slack’s apps with Debian’s in my primary and secondary operating systems because of the discrepancy in releases; especially so with Mozilla apps like FF and TB. This got me thinking… maybe Debian, even though it had always been my fall-back operating system, might not be serving my purposes that well after all. Is there something better out there for what I want to do?

As most of you know, I have five tester slots on a dedicated drive just for trying out and learning other distributions of GNU/Linux. No, I don’t do virtual. I like to REALLY install and set up operating systems. Virtual computing is like virtual sex. It works, but it’s not nearly as much fun (or as messy). In one of my tester slots there is almost always an installation of Arch Linux. Why Arch? Well, it’s a cool distribution. That’s why.

Seriously, Arch is a very stable, very robust distribution of GNU/Linux. It’s been around about ten years now. It’s a fork of the old Crux branch of the Linux Tree. I started playing around with Arch about three years ago, I think. I was impressed right off the bat. One of the greatest things about Arch is its outstanding support community, particularly the wiki. There is an abundance of information for Arch users of all sizes and shapes. Support is a good thing!

As a result of all this deep thinking and philosophizing, I decided to install Arch as my official secondary operating system. I spent the past three days installing and setting it up. I’m using it now to post this article. I have everything set up to closely match my Slackware installation. I keep both sync’d (manually) and updated. If my Slack craps out, I can always boot Arch and seamlessly carry on until I fix my Slack. Odds of Slack crapping out? Null. You never know, though.

Give Arch a try. You might be impressed. For a very good tutorial on installing Arch, see securitybreach’s tutorial at Scot’s Newsletter Forums – Bruno’s All Things Linux.

My Arch w/ Xfce Desktop Environment

Later…

~Eric

*A repost from my Nocturnal Slacker blog (@Lockergnome.com)

 

 

 

SimplyMEPIS 11.0 Beta 1 needs testing help; it is a great distribution

I have seen a couple of sites mention problems with the Beta 1 implementation of SimplyMEPIS.  Perhaps that was news to them for the simple reason that MEPIS has an excellent reputation for quality.  I would like to point out the need to test, and the need to provide equally high quality feedback for the developers, not only of SimplyMEPIS, but for whatever software you happen to use.

Personally, I have been a big fan of the MEPIS community since May 2003 and I have installed and tested nearly every build since I first heard of the project.  One reason that I have done so is that I am consistently impressed with the high quality of the software.  Even when there are defects in various components in the early builds, the remaining components are well put together, and many times, even early builds work well.  The few times I have encountered issues, I've jumped right in, provided my hardware configuration and a clear description of the issues I have encountered and how to reproduce them, and in every single case, the very next build resolved the issue.

My friends, that's how many of us, whether we are developers or not, can be active contributors to the free software movement.  Some of us can develop, but many more of us can test, evangelize, write documentation, or help others with issues.  The collective work that we donate helps keep free software alive and vibrant.

I hope that many of you will want to test out SimplyMEPIS and help iron out the remaining issues so that the next release maintains the high standard it has set for itself, and even improve upon it.  Warren Woodford is an outstanding developer, but even he cannot do it all on his own.  In fact, he gets most of the components of his software from others.  What he does so well is integrate it and put it all together.  Let's help him do his job well, and in return, he will deliver us yet another excellent example, not only of his work, but that of the MEPIS Lovers Community.

Special mention, in fact, should be given to the MEPIS Lovers Community, one of the finest free software communities.  The helpful attitudes and the desire to keep pettiness to a minimum and helpfulness at a maximum is perhaps not unique to the MEPIS Lovers, but it is as strongly modeled there as in any forum that I've seen, so they deserve to be highly commended along with Warren for making MEPIS such a solid, stable, well designed, well documented, useful system.  It takes more than one: Linux started the kernel, the GNU project created many utilities, developers from all interests developed excellent applications, and great system integrators put it all together, with the help and support of their communities.  Everyone plays an important role, so let's remember our own roles and do what we can to support and promote freely available software.

 

Security tip: Avoid fork bombing on popular distro (check your system)

Few days ago I've talked with another Linux technician, a very smart guy with great experience and competence, in a skill test I've seen an expression like this:

:(){ :|:& };:

I didn't realized it was a shell fork bomb, maybe because it was 9.00pm and I was dealing with tech problems from 8.00am, I was thinking about some voodoo regular expression and I've realized what it was after a while (when I finally decided to connect my brain). I've tested it on a console shell in an Ubuntu Laptop machine and after few seconds I've had a frozen Linux system. A quite common system (Core 2 duo, 2 Gb RAM) may saturate the environment with dumb processes in just 10-20 secs so be carefully about it if you want to make a short test.

This happens because on certain Linux distro, mostly popular ones, there are no limits set for maximum number of processes a user may have. For example if you run:

ulimits -u

you can discover maximum number of processes a user may run on a system (run ulimits -a to discover all current limits in your system).

To avoid this little and annoying problem you need to manually set user maximum number of processes in your kernel if you compile it, or you may edit this file (/etc/security/limits.conf) and add a line like this:

*    hard    nproc    1000

to limit for example the number of processes to 1000 for an user, Please note "1000" is just an example, limit it to whatever you need.

I've checked other Linux systems around me in these days but I didn't seen this alarming output reported from my Ubuntu 10.10 “stock” distro

~$ ulimits -u
unlimited

The desktop I'm using for my every day work has Gentoo running on it, no troubles are reported for this, the same for Debian (Lenny) machines, Slackware (13.1) and few LFS I've around; so I'm pretty comfortable with what I'm using now (except for that laptop where I've now set the ulimit).

You may need to set maximum number of processes accordingly with your computer usage but at least you need to set to something different than “unlimited”.

I hope someone working on “major or popular distros” will read this simple post and will add these basic settings to their all purposes kernels to avoid these things, it could be embarrassing if you want to promote your system instead of other closed source windows operating systems.

I'm glad to read your comments here, please report your current ulimits configurations (ulimit -a) so we may publish some sort of open document related to standard kernels on major distros. Please put:

  • Distro name and version (if applicable)

  • Kernel name and version (uname -a) if you're not using a ready made one

  • Ulimits output (ulimits -a)

  • If you've manually set something on /etc/security/limits.conf please report even this setting

 

 

Hope it helps someone

 

Andrea (Ben) Benini

 

 

Kubuntu to OpenSUSE : A short story

I'll make this one short as it is late and that I don't want to go into endless details right now about my experience with Kubuntu 10.04.

In short, it hasn't been very successful. Too random bugs. Package manager sometimes refuse to launch, network management failed after suspend to ram, sometimes it didn't even go pass the boot screen. In short : It gets the jobs done, but it's not stable enough. It's a combination of small annoyances.

I have now installed OpenSUSE 11.3 on my laptop. As expected, the wireless card did not work out of the box. For everyone who have a System 76 Pangolin Performance and want to have the network working, here's a nano-turbo-brief how-to to make it work. It doesn't apply only to OpenSUSE.

A dmesg with some filtering gave me this info about the wireless card in Kubuntu:

"Linux kernel driver for RTL8192 based WLAN cards"
"rtl819xSE 0000:06:00.0: firmware: requesting RTL8192SE/rtl8192sfw.bin"

Basically, you need to get the Realtek RTL819xSE driver from their Web site and compile it. The 8192se driver is here. Now, all you need to do is install the kernel headers, the basic compilation tools that comes with your distribution and compile the driver.

On OpenSUSE, I installed gcc, gcc-c++ (although I doubt this one was needed),  make and kernel-devel. Extract the driver somewhere and from the directory in which you extracted the driver, make and make install (you might need root access to do so). Reboot (or modprobe the newly compiled driver and restart networking services) and enjoy.

I didn't need to do anything else for now to get things up and running in OpenSUSE. I have yet to test the Web cam - I see a /dev/video0 entry, but I didn't test it yet in an application. That's about it. So far so good with OpenSUSE. Let's hope it stays that way!

 

openSUSE Weekly News, Issue 146 is available

We are pleased to announce our new Issue 146 of openSUSE Weekly News.

This Week:

 

  • openSUSE ass-kickin’ keynote
  • openSUSE News: The openSUSE Build Service 2.1 released
  • Rares Aioanei: Kernel Weekly News 23.10.2010
  • Make Tech Easier/Tavis J. Hampton: Advanced KDE Administration
  • Nelson Marques: openoffice.org and Libre Office…

 

 

Like ever we have now finshed just the english Version under: http://en.opensuse.org/Weekly_news. From now on startsthe translating Process. You can see the actual results under: http://en.opensuse.org/Weekly_news#Translations. If any Translation is ready the Translation Team moves the Language up to "Available".

 

No we hope you enjoy the reading :-)

 

Comments, News and Wishes can send to This e-mail address is being protected from spambots. You need JavaScript enabled to view it .

 

 
Page 6 of 18

Upcoming Linux Foundation Courses

  1. LFD320 Linux Kernel Internals and Debugging
    03 Nov » 07 Nov - Virtual
    Details
  2. LFS416 Linux Security
    03 Nov » 06 Nov - Virtual
    Details
  3. LFS426 Linux Performance Tuning
    10 Nov » 13 Nov - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board