timber wrote:Hi Breaker,
I was able to install Sidux this way.
It was a little tricky, using a bit different syntax.
Fortunately, I found an interesting script that generates the "menuentry" by extracting the needed information from the iso.
I thought you might be interested in checking it out, it's in "Chapter A Part A The script"
See:
http://sidux.com/index.php?module=Wikul ... ub2isofrom
It is interesting, and would prove helpful to get sidux going. It seemed to pick the wrong uuid on my system, but the script did turn me on to the isoinfo command, which is cool. The "cheatcodes" are the extra commands you don't usually see in a typical menu entry, but are needed by some live CD isos to boot correctly. Whether it is iso-scan/filename or fromiso or something else, this will vary between disros, as will the path and file name of your iso. Looking at the page with the script, it appears the author does modify the entry a bit to simplify it. I was looking it over, and I understand a lot of it, and I think by the time you understand enough to change it for your distro, you don't need it anymore.
For example, for Mint, the Live CD kernel and initrd files are very simply named, so using the man page for fromiso and the script, I came up with these lines to find out the names of the files (and where they are in the CD filestructure):
Code: Select all
isoinfo -f -J -i LinuxMint-8.iso |grep vmlinu
isoinfo -f -J -i LinuxMint-8.iso |grep initrd
(assume you are in directory with iso)
Check out the man page for details (man isoinfo), but basically isoinfo displays the iso directory tree, -i /path/to/Linux.iso is where the iso is on your system which is then piped to the ever useful grep (man grep) to find anything starting with vmlinu and initrd, which in my experience should find the linux kernel and intial ram disk files. Typical names are vmlinux or vmlinuz for the kernel, and initrd.lz or initrd.gz for the ram disk (
http://en.wikipedia.org/wiki/Initrd).
Then you just have to know how grub interprets the rest of the menu entry. The first thing a typical menu entry will have, is a way to tell grub which drive and partition to set as root. In other words, it needs to know where you later path entries actually are on your system. I find the easiest way is to use grub device names, unless a computer seems to suddenly change (or you change it in your BIOS) thus confusing grub. For the loopback command, you don't need to set root like that if you just explicitly call the grub device name and path to your iso (see my example in previous post)
Grub device names are of the format (hdX,Y) where X = drive number (count starts with zero), and Y = partition number (count starts with 1). Therefore, when I made an extra FAT32 partition for Linux isos on my system, I used (hd1,4) because the partition was on the second hard drive (BIOS order), 4th partition. Using the search command, grub can use partition labels, Linux device names (/dev/sdX), or UUIDs. The blkid command shows all UUIDs on your system. But don't use search unless there is a problem, just tell grub where your partition for the isos lives, then a slash (root directory), then the file name of your iso. Example: (hd1,4)/Linux.iso is in the root of the partition, but it could easily be: (hd1,4)/home/breaker/iso/Linux.iso.
timber wrote:
It only works for the sidux installation but upon examination it could probably be adapted to work for some other distros as well.
I've noticed that there are a number of variables when going this route.
Installing from an iso located in it's own partition is desirable (as you mentioned above) but the sidux method worked from my /home partition.
I had a little problem getting the generating script to execute properly (and I'm really not sure why, permissions maybe), but finally the information was generated and showed up in my terminal and I cut and pasted it to 40_Custom. Once there, an update-grub and it showed up at boot time leading to a successful installation.
Nice, good to hear it. I don't know why the script didn't run, but aside from of course having to set permissions, you need to put a dot slash before any command in the same directory as your working directory. Then there is the whole owner and user, group, and other permissions, use ls -l to show permissions and chmod to change them, with sudo if you are not the owner (like if you created the script using sudo or as root).
timber wrote:
I was interested in installing several distros from the hard drive (e.g. Mepis Antix and PupMac) but haven't been successful yet.
The .lz .gz thing throws me off a bit and most attempts I've been getting an error that says I need to load the kernel first, so obviously I am not using the correct command to get the kernel up and running (I think this is where a modified version of the script above may be most handy in extracting this information).
Each distro seems to have a little different file structure or naming so some sort of "find" is needed (this is way over my head).
lol, now we can use isoinfo
The tough part is the cheatcode, if needed. The easiest way is google, or the distro documentation about what cheatcodes are available. I haven't been able to get all distros I tried going, but I did get tinycore going. You can also mount an iso like a drive, then just browse it. Just make a directory with a name of your choice, then loop mount it.
Code: Select all
sudo mkdir /media/myiso
sudo mount -o loop Linux.iso /media/myiso
This example assumes you are in the directory with Linux.iso. After this, just browse to /media/myiso and you can see everything, even grab files.
timber wrote:
I never was able to get the script you have here to work, but I think it is tailored to the way Ubuntu/ Mint install works (if I'm not mistaken).
So, I guess the bottom line is that booting from the hard disk is possible but it depends on the distro as to exactly what to add to 40_Custom (or similar) file.
As above, be sure your grub device names are correct, this would be where everything is after POST, and of course, modify the path to the iso, and file name of the iso as needed. This also applies to the iso-scan/filename=/path/Linux.iso It should match your entire path like on the loopback loop line, but without the (hdX,Y).
timber wrote:
The info that you've provided has really gotten me interested in digging into how these scripts work.
I have probably learned just enough to be extremely dangerous ... but I only really learn by trying stuff out.
I did (actually sidux did) manage to guber up my grub2 so my main OS wouldn't show up but I reinstalled grub from a second OS on my drive and it spotted my main OS and gave me a way back in. Another grub install from my main OS and I was good to go again.
Thanks for your interest and help on this ... I find it all very intriguing.
It is interesting. I am going to check into learning more about grub4dos also, which can also boot isos.
Here are some more links (sorry if any are repeats):
This guy's blog states he wrote the loopback command, and a little insight about how it works:
http://mgerards.net/blog/?p=16
Some examples:
http://michael-prokop.at/blog/2009/05/2 ... via-grub2/
More examples:
http://www.panticz.de/MultiBootUSB
My original post about how to install Mint from Mint using the grub2/iso trick;
http://forums.linuxmint.com/viewtopic.php?f=46&t=38366
Similar, but using flash drive for Mint;
http://forums.linuxmint.com/viewtopic.php?f=46&t=38512
This guy has a blog, and responded to my post, if you look at his script, near the end are a lot of examples:
http://blog.p-mt.net/archives/644
Well that's all for now, I guess.
(-: