Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got pretty solid Linux experience, but little in the embedded/small system area, and this one has me baffled.

I've agreed to help a friend work on a project using a tiny little x86-compatible SBC. It's supposed to be a data logger and display for a monitoring application, using a bunch of sensors and USB ADCs. It needs an extremely quick boot, so we're playing around with various boot optimizations, disabling services, etc.

The end result he needs is a machine that can boot very quickly into runlevel 2 (no networking, console only, skips all services but what's required for the data logging and display), or boot into runlevel 3 with SSH, etc. and network services including DHCP, to allow remote access and a script to copy the logged data via SCP to another host.

Unfortunately, since this will end up being an embedded system, I need to come up with some way of using an analog hardware input - a switch or button or something - that tells the bootloader/kernel to either boot to runlevel 2 or 3.

Has anyone ever heard of this? Aside from patching either GRUB or the kernel itself to poll some sort of IO (I guess serial, parallel, or some sort of GPIO), any suggestions/ideas?

Thanks, Jason

share|improve this question

I don't know the definitive answer, but I would guess that it is unlikely and / or difficult to do.

So my suggestion is, why not always boot to run level 2 and write a program that checks the serial port (or whatever your using) for the switch condition, ever 10 seconds or so, that will make it change to run level 3. That way you have your fast boot and your ability to change run level without too much messing about.

share|improve this answer
Very good suggestion, thanks. Still not what I'm hoping for, but a good fallback. – Jason Antman Jul 16 '11 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.