LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, LiMo, Maemo, MeeGo, Openmoko, Ubuntu Mobile, WebOS, Firefox OS, Open Mobile Alliance and other similar projects and products.
A reminder that LQ now has a dedicated Android sister site: AndroidQuestions.org

Notices

Reply
 
LinkBack Search this Thread
Old 10-21-2013, 09:59 AM   #1
JoseCuervo
Member
 
Registered: May 2007
Location: Delaware
Distribution: Ubuntu Server 12.04, Ubuntu 12.04.3, Tails 0.22, Kali
Posts: 59

Rep: Reputation: 16
Minimal USB Linux Install


Hey guys, my ISY professor wants the smallest possible footprint on a USB possible, and the fastest possible time to a shell. It is sort of a contest for our class. I did a Kali build that booted very fast, and a DSL/knoppix build that was tiny, but he's not impressed. He said that I should be thinking kilobytes, not megabytes.

The requirements: I can use any resources I want. The USB needs to boot into a shell that has dd and vi available.

I've tried looking into LFS, core, and Arch, but I'm not quite sure how to customize or strip out parts that I don't need. I've also done extensive googling and searching on LQ. Does anyone have any experience with a mobile OS that loads almost nothing but init and bash?
 
Old 10-21-2013, 10:39 AM   #2
rtmistler
Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 754
Blog Entries: 6

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
Sounds like your professor covered how to change kernel options and compile the kernel. Instead of looking for "the one" distribution which has it done for you; you should start with a distribution that works for your architecture and customize it to remove all the non-essentials. I'd say look at the differences and similarities between the very fast one and the very small one and try to marry those together.

Note also that configuring the kernel sets up a bunch of code inclusion/exclusion flags affecting the amount of features compiled. But perhaps one can go further than the flags ...

Bear in mind that there are different variations of the shell, dd, and vi available in source form; hence you can rewrite them and discard portions which take up a lot of space. Bear further in mind that a command shell needs to support solely the necessary commands which here sound to be "dd" and "vi".

And this is clearly a case where you follow the mantra of The Commander (see below).
 
Old 10-21-2013, 11:01 AM   #3
JoseCuervo
Member
 
Registered: May 2007
Location: Delaware
Distribution: Ubuntu Server 12.04, Ubuntu 12.04.3, Tails 0.22, Kali
Posts: 59

Original Poster
Rep: Reputation: 16
My professor covered no such thing! He's great though, he gives us something way over our head, and two weeks later we're confident on it.

Update: I have TinyCore installed in 9MBs, and boots (to a GUI!) in <4.5 seconds. I'm working on Core to a USB now, and I'm going to start stripping that down when I get it running. Thanks for the quick response!
 
Old 10-21-2013, 01:23 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Slackware
Posts: 14,880
Blog Entries: 2

Rep: Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806Reputation: 3806
All you need is a kernel, a shell (Ash from Busybox should be fine) and copies of vi and dd (of course with the needed libraries). Assembling that is pretty easy, for example following this tutorial: http://doc.slitaz.org/en:scratchbook:start
I have made special purpose systems with about 5MB of size this way, but with using only the kernel drivers and Busybox modules you really need you might get that even smaller.
 
Old 10-21-2013, 02:46 PM   #5
jheengut
Member
 
Registered: Sep 2006
Location: Providence, Moka Mauritius
Distribution: Slackware, OpenSuse, Debian, Fedora, Mageia, Ubuntu, RedHat, BSD, Gentoo, Puppy
Posts: 173
Blog Entries: 2

Rep: Reputation: 2
asm. mikeos

go for http://[URL="http://asm.sourceforge.net/"]asm.sourceforge.net/[/URL] or mikeos http://mikeos.berlios.de
 
Old 10-21-2013, 07:37 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 10,255

Rep: Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256Reputation: 1256
Tell him to get QNX. Full GUI on 1.44m floppy.
A bit of work and you can get menuetos on a usb in 1.38m. Plus syslinux.

I was thinking of what TobiSGD suggested. You build a custom kernel with the bare bones drivers for your system and some minimal cli. Since he didn't say you needed any apps, you don't need busybox.

Some of the newest compression can be used on a new kernel.
 
Old 10-21-2013, 09:59 PM   #7
jamison20000e
Senior Member
 
Registered: Nov 2005
Location: infinity; (randomly born:) Milwaukee, WI, US, Earth
Distribution: any UNIXish that works well on my cheapest with mostly KDE, Xfce or CLI but open ;-)
Posts: 1,104
Blog Entries: 2

Rep: Reputation: 259Reputation: 259Reputation: 259
I like this thread, plus.

Last edited by jamison20000e; 10-21-2013 at 10:00 PM.
 
Old 10-22-2013, 12:33 AM   #8
JoseCuervo
Member
 
Registered: May 2007
Location: Delaware
Distribution: Ubuntu Server 12.04, Ubuntu 12.04.3, Tails 0.22, Kali
Posts: 59

Original Poster
Rep: Reputation: 16
Those are all interesting avenues, I'm definitely going to aim for the 1~2 Mb range now. I'm running the boot speed tests in VMWare Player, and I've been using a USB2.0 stick. I'll be moving the installs to a USB3.0 just in case it helps, though I doubt it, because the read speed on both is significantly higher than the size of these tiny operating systems. I'll post updates as I shrink the installs or run into problems. Thanks again guys!
 
Old 10-22-2013, 12:57 AM   #9
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,001

Rep: Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003Reputation: 1003
probably not suitable for you but one floppy is enough: http://www.linuxlinks.com/Distributions/Floppy/ (a few of them may work with usb too).
 
Old 10-22-2013, 07:33 AM   #10
rtmistler
Member
 
Registered: Mar 2011
Location: Milford, MA. USA
Distribution: MontaVista, Ubuntu, MINT
Posts: 754
Blog Entries: 6

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
Quote:
Originally Posted by jefro View Post
Tell him to get QNX. Full GUI on 1.44m floppy.
A bit of work and you can get menuetos on a usb in 1.38m. Plus syslinux.

I was thinking of what TobiSGD suggested. You build a custom kernel with the bare bones drivers for your system and some minimal cli. Since he didn't say you needed any apps, you don't need busybox.

Some of the newest compression can be used on a new kernel.
I thought this was a school assignment, no GUI, boot the kernel as small and fast as possible; requires a command shell supporting dd and vi.

I would give the instructor a micro-micro kernel and a shell which couldn't even perform ls. You don't even need a frame buffer, let alone GUI! No network, no swap space. The fun part, and the assignment, is how minimal can you go, not how cool you can make it.
 
Old 10-25-2013, 04:26 AM   #11
agentsteel
Member
 
Registered: Oct 2012
Location: France
Distribution: Arch / Debian / OpenSUSE / Ubuntu
Posts: 42

Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by JoseCuervo View Post
Hey guys, my ISY professor wants the smallest possible footprint on a USB possible, and the fastest possible time to a shell. It is sort of a contest for our class. I did a Kali build that booted very fast, and a DSL/knoppix build that was tiny, but he's not impressed. He said that I should be thinking kilobytes, not megabytes.

The requirements: I can use any resources I want. The USB needs to boot into a shell that has dd and vi available.

I've tried looking into LFS, core, and Arch, but I'm not quite sure how to customize or strip out parts that I don't need. I've also done extensive googling and searching on LQ. Does anyone have any experience with a mobile OS that loads almost nothing but init and bash?
With Buildroot you can generate a tiny Linux system (kernel + embedded initramfs), then just copy this kernel onto your usb drive and make it bootable

I did some tutos some time ago, they may still be relevant (Buildroot has evolved quite a bit since), see more here :
http://agentoss.wordpress.com/2011/0...ing-buildroot/
 
1 members found this post helpful.
Old 10-25-2013, 05:08 AM   #12
Pastychomper
Member
 
Registered: Sep 2011
Location: Scotland
Distribution: Debian
Posts: 42

Rep: Reputation: 6
This may be my ignorance talking, but I understand Grub includes (some?) filesystem access and normally loads Stage 2 from somewhere outside the MBR. What's to stop you building a custom Grub with some of the bootloading parts removed, and a minimal vi and dd to run from the Grub command line?

Failing that, how about a minimal Freedos with vi.exe and dd.exe?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
minimal linux distro for USB (just CLI and command line tools) shuuichi Linux - Newbie 8 10-15-2013 03:59 PM
minimal linux install fotoguy Linux - Software 17 05-25-2013 12:37 AM
Adobe Air, minimal install and onto a USB Stick drydo Linux - Newbie 0 05-20-2009 11:43 AM
How to install minimal Linux on USB nugroho2 Linux - Newbie 1 10-26-2008 01:04 PM
mount USB CDROM - minimal install ColKurtz Linux - General 3 07-08-2005 06:59 AM


All times are GMT -5. The time now is 09:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration