OS installation

Have you ever wondered what happens when a software (MS Office, gimp, etc) are being installed on a system? Even a couple of moments thought would suggest that it would install(copy at a specific location) a couple (at times a lot) of binary (or script) files which can be executed. It would also copy certain configuration items that are useful for its execution and that can be used for changing the way it executes.

What comes up as a later realization that almost all programs don’t have everything they need to run in their installer packages. These things are generally known as dependencies.
Dependencies have a very big pro that if multiple programs share the same dependency then even after installing all those programs you just have 1 copy of the dependency i.e. unnecessary code bloat is avoided. (of course it does also mean that installer package is smaller…but I think one-time pains don’t count as much as living eternally with 2 copies)
But this also leads to a con. Breaking the dependency mean breaking 2 things at once. That is the reason you might hear someone saying this is very core component. Core component would inadvertently mean that it is being used at a lot of places (this _might_ also mean that it is doing something very important….but that is usually a secondary concern).
Also, dependencies mean that there would have to be installer program that executes and checks the target system if the dependencies are already there or not. After that its upto this installer program to maybe provide the dependency (programs) on its own (download it….or may be unpack it from its own body). This makes installer programs so useful and complicated (of course you can have installer which just copy the application and don’t care about dependencies…but then either you have to be smart enough to prepare your system or the program would simply not work)

Now imagine a program which doesn’t have *any* dependency, it has to be the simplest one to be installed. All it needs is a copy of its executables at particular places and a copy of its configuration at another set of particular places.
Notice I said imagine…but such programs do exist and I bet you are using at least one of them right now…the Operating System — its the most important piece of software that would be running on your system right now but still it is a stand-alone giant (well mostly….there can pluggable thing in OS as well….but those usually don’t render it useless in their absence).
Now moving our discussion of installers forward, OS installations have to be the simplest one to do. After all it just needs some hard disk space and some files to be kept on that place on the hard disk (and an initial config of bootloader to push the start button….but for now we’ll forget the boot-loader).
But thats not the picture of OS installer that is usually painted. I am sure you would have seen OS installers which feel too supreme in their own rights and always ask you to boot from the installation media (woah!! funky name ). They are now becoming lenient and allow you to start installation from an already running OS but even then the job is half done. Most of the OS installation still runs stand-alone.

I was always under the same impression that OS installation is a big thing until 2 weeks back when I planned to install another OS on my phone (yes, you read it right–on my phone…this is one of the coolest thing that I can do on my phone *without* voiding any warranties). Anyways, mostly I connect my phone on my laptop and do stuff because typing on small screen for long time is a real mess. But this time I was out of luck. This is when I got this crazy idea to do it all on my phone itself. When I started to think about it, I was able to enumerate exactly 4 steps in which this could be done:
* Make place on SD card
* download OS files
* copy them on the card
* configure boot-loader
* reboot (well this is fifth step but I don’t want to count it:)
I was perplexed that can it really be this simple? And it turned out that it was. I just connect my phone to Wifi at home, browsed to shr-unstable, downloaded the latest OS image (a simple .tar.gz…but for people on Windows, its something similar to a zip file). Then I fired up a shell (on my phone), created a partition, copied the the tar image to that partition and un-tarred (unzipped) it there.
For my case telling the boot-loader to load this OS was pretty easy, I just had to put a file named noboot-GTA02 on the first partition (from where the phone was currently running). Next step reboot and I was on.

BTW, I am over-simplifying the OS installation process a little bit here. In my case the hardware was fixed (the image of the OS is specifically built for my phone). But even then the steps of installing it on any modern machine has to be similar. All the installer can optimize upon is copying only specific files (depending upon the current platform). Nothing that cannot be done on an already running system.
I have heard that Debian with debootstrap and Gentoo do it already as Linux distributions. I know there are ways to make bootable pen-drives on fedora/ubuntu so I am pretty sure that method can be hacked to install fedora/ubuntu on another hard disk. I wonder when would Microsoft do it (I think they have already started doing most of the copying [copy all the media] and setup bootloader to reboot machine in OS installer from existing intallation). I don’t expect this to be done by Apple (they have their heads held too high to even think of these kind of petty stuff which excite the people in a geeky way).

To conclude, given the installation media (yes, I also use the grand terms :), one should be able to boot it right up to install on a bare system or do a manual copy kind of install.

PS: A note on bootloaders. I had (intentionally) skipped the complexity of boot-loaders for 3 reasons:
* they are not part of OS
* even including them doesn’t complicate the process so much that installers can’t do it.
* the discussion could have diluted the essence of the original topic

Powered by ScribeFire.

This entry was posted in mobile, openmoko, tech. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *