Creating your own Linux Distribution.
by The Uni-Hacker on Jun.17, 2008, under Misc
Recently I’ve been tasked with creating a Linux distribution that can support X-Windows and MONO. A Mono-Project application would be the main front end application running full screen with out the fluff and fat of a regular window manager. My choices were narrowed down between two distributions, Gentoo and Ubuntu server. Gentoo was nice because it was compiled from scratch for my hardware. Ubuntu Server was nice because I could apt-get the binaries and be done with it, no compiling source code.
The first thing you’ll want to do is download and install VirtualBox. Create a new machine and virtual disk with about 5 gigs of disk space. Using the Ubuntu Server ISO mounted as a CD in VirtualBox, boot the system and start the installation process. When you get to the part about disk partitioning, create a 1.8 gig for your main mount and use the rest as a secondary. The reason I chose 1.8gig is because I want to put this on a 2 gig USB drive, so 1.8 should keep my safe. Continue the installation and when you get to the part about selecting a server type, just select OpenSSH and do apt-get’s later. This way you know whats being installed. I did apt-get install Xorg and apt-get mono for my specific application. I think my OS took about 500MB of disk space, not too shabby.
Once you install all your applications you’ll need to create an ISO file. Mount that other partition you made into /mnt/hd. Then simply make an image by typing dd if=/dev/hda1 of=/mnt/hd/my-linux-os.iso. You may need to change the if device (hda1) to match the Virtual Hard drive of your system.
Now you simply copy the image onto a device such as a thumb drive or another hard drive and run grub to install the boot loader. After you install the ISO file you may need to change the fstab file to point to your correct hard drive device. In an up and coming article we’ll be covering bootable cd’s so stay tuned.
Command Overview:
Make ISO out of running OS.
dd if=/dev/hda1 of=/mnt/hd/your-os-distro.iso
Copy and ISO to a drive to use
dd if=/mnt/hd/your-os-distro.iso of=/dev/hda1
Remember to replace hda1 with your actual device, USB drives are usually sdb and SATA drives are usually sta from when I’ve been seeing.
The grub command I use to install my boot loader is as follows:
grub –no-floppy
Now you’ll see a grub prompt.
root(hd0,0)
setup(hd0)
quit
Remember, hd0 is as if you were booted into your new system. If you have your new system mounted to your working pc, usually you want to change hd0 to hd1 for the drive your working on.
June 18th, 2008 on 1:33 pm
Please let me know if you hit any problems with Gentoo! I’d be happy to help you out if the usual channels (forums, IRC, gentoo-user mailing list) don’t work.
June 19th, 2008 on 4:09 pm
Gentoo issues.
Thanks for the comment m8.
Yeah, my main problem with gentoo right now was the ISA proxy server my work uses. For some reason even with http_proxy, ftp_proxy and the rsync proxy env vars set I still couldn’t emerge.
Basically I have a linux box with ntlmaps setup to handle the ISA auth issues.
Then on my other boxes I just put the IP/Port of the linux ntlmaps proxy server….
Never could get past the emerge –sync on this network….but with ubuntu server on the other hand, it worked out of the box.
Trust me, I’d rather use Gentoo and compile for ubber optimization….but I can’t seem to get past the proxy issues. Main reason….. our network blocks all rsync…. and the net admins make no exceptions…
June 28th, 2008 on 1:52 am
Is there a socks proxy? You can socksify your entire system with something like tsocks or dante.
June 30th, 2008 on 8:29 am
Donnie,
Nope, no sock proxy server. Again, they block all rsync as well. The only way is to ship gentoo live with ntlmaps ready to go. We also need the option to force HTTP downloads with emerge.