LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2014, 04:32 PM   #1
siba2893
LQ Newbie
 
Registered: Jun 2014
Posts: 1

Rep: Reputation: Disabled
Make a shell based live USB


Hi Guys could anyone help me with some info of how to make my own distro, well I just need to make a live usb that executes the kernel and a shell with a Hello world message, all by hand, no easy programs. Any help with that?
 
Old 06-11-2014, 04:41 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
I used to keep instructions on how to build the newest kernels/syslinux etc into a bootable embedded linux with busybox. But I've stopped doing it because it was time consuming. It was fun though, So I can empathize with why you would want to do this.

Here is a link to something called Slitaz which claims to let you do the same thing: http://www.slitaz.org/en/doc/scratchbook/ They are very similar,

There is a lot in this example that you can remove if you only want a shell to run and echo a string,.. but going through the entire process might be a great learning tool for you.

Last edited by szboardstretcher; 06-11-2014 at 04:42 PM.
 
Old 06-11-2014, 05:06 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Kind of one step past JEOS, just enough operating system.

I might be tempted to take some installer that easily installs with no window manager. Maybe Debian. Then install that to the usb. Then start deleting almost everything. You will need some bare bones stuff.

Personally I might get a JEOS from somewhere, SuseStudio.com can make one. Still would be a lot more than what you'd need.

Once you get the basic OS on and shell support and maybe a few helper files you can execute some way to make this hello world.

The actual way you requested would be to use LFS. Not really worth the time. Guess you could use Gentoo to make a minimal install.

The good old day floppy distro's like that won't easily boot from usb. Might be able to use syslinux or grub to boot to them maybe.
 
Old 06-12-2014, 05:14 PM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Originally Posted by jefro View Post
The good old day floppy distro's like that won't easily boot from usb. Might be able to use syslinux or grub to boot to them maybe.
You could possibly get them to partially boot, but when the distro starts looking for programs/config on fd0 it will fail. Also, at some point the distro will lose access to the usb as older distros didn't have usb drivers -- especially if they were on floppies.
 
Old 06-12-2014, 07:05 PM   #5
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Check live.debian.net

Instructions on how to create your own live USB. Some pre-cooked versions are command line only and might provide a good starting point.

jlinkels
 
Old 06-13-2014, 10:20 AM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
the 'lb' command really takes away from the experience of building your own distro from scratch though. it magically does most everything for you.
 
Old 06-13-2014, 06:44 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
I know grub can boot floppy images from a hard drive. Not sure about the usb. Since one can get even dos to boot from usb, I'd think that an old linux might boot. I did state that there are easier ways.
 
Old 06-14-2014, 07:29 PM   #8
DJ Shaji
Member
 
Registered: Dec 2004
Distribution: Fedora 22 (Twenty Two!), ArchLinux
Posts: 506
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Actually you can do that with just the kernel and grub. Put a kernel image and a statically linked busybox on a usb drive, install grub, and add a line as follows:

Code:
root (hd1,0)
    kernel=/<kernel image> root=/dev/sdb1 init="/busybox echo hellow world"
Booting the above will accomplish what you want. Although I don't know if init= accepts the argument that I've written here, and because after doing this the kernel will panic because our "init" would exit, it is better to make a small script that would call busybox as echo first and then sleep indefinitely.

EDIT: Also the above assumes grub 0.99 and that the usb drive is the second disk on the system (the local hard disk being the first). Either use values that correspond to your setup or just use UUIDs

Last edited by DJ Shaji; 06-14-2014 at 07:31 PM.
 
Old 06-14-2014, 08:11 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
I'd guess that LFS (linux from scratch) could be used to create the most minimal and one could only add in drivers needed for target hardware.



Think you'd at least need some version of busybox to add in some useful tools maybe.

http://ttylinux.net/


http://superuser.com/questions/30708...sybox-and-bash

Last edited by jefro; 06-14-2014 at 08:12 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Make a autorun USB that executes a shell script on the USB drive? riahc3 Linux - Newbie 47 08-23-2012 03:14 AM
LXer: I'm using Debian Live-based Tails from a live USB stick to preserve privacy and anonymity LXer Syndicated Linux News 0 01-09-2012 12:50 PM
Make a live usb anutherguy Linux - Software 12 06-14-2011 01:20 PM
LXer: Report: 8 Linux-based Live CD/DVD and USB Distros For All Occasions LXer Syndicated Linux News 0 06-22-2010 12:40 AM
ClutchOS_13-beta, a Slackware based Live Persistent USB linus72 Linux - General 2 03-08-2010 10:45 AM


All times are GMT -5. The time now is 11:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration