LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.

Notices


Reply
  Search this Thread
Old 10-21-2013, 09:59 AM   #1
JoseCuervo
Member
 
Registered: May 2007
Location: North Carolina
Distribution: RHEL 7, CentOS7
Posts: 82

Rep: Reputation: 18
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
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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: North Carolina
Distribution: RHEL 7, CentOS7
Posts: 82

Original Poster
Rep: Reputation: 18
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: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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, Lubuntu
Posts: 352
Blog Entries: 16

Rep: Reputation: 51
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
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
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: ...uncanny valley... infinity\1975; (randomly born:) Milwaukee, WI, US( + travel,) Earth&Mars (I wish,) END BORDER$!◣◢┌∩┐ Fe26-E,e...
Distribution: any GPL that work on freest-HW; has been KDE, CLI, Novena-SBC but open.. http://goo.gl/NqgqJx &c ;-)
Posts: 4,888
Blog Entries: 2

Rep: Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567Reputation: 1567
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: North Carolina
Distribution: RHEL 7, CentOS7
Posts: 82

Original Poster
Rep: Reputation: 18
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
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
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
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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: Debian / Fedora / Ubuntu / OpenBSD
Posts: 46

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: Slackware, Devuan, Android
Posts: 132

Rep: Reputation: 243Reputation: 243Reputation: 243
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



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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile

All times are GMT -5. The time now is 05:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration