Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Boot Refracta (or other Debian-Live) ISO from grub2 menu

Tips and Instructional topics. Not for support questions.

Re: Boot Refracta (or other Debian-Live) ISO from grub2 menu

Postby fsmithred » Sat Jan 25, 2014 8:28 pm

This patch should probably go into refracta2usb (patch_initrd) as soon as it's tested some more.

Too late. It was too easy to add it, and I couldn't resist. Here's what I did:
- Rename live.tar.gz to live_sid.tar.gz and copy it to /usr/lib/refracta2usb/patch-live-initrd/
- Edit the live_tarball variable in refracta2usb.conf to point to the renamed tarball.
- Edit /usr/bin/patch-initrd-gui in two places where you find "live.tar.gz" and replace it wtih "$live_tarball" - or in the case of the one that's inside the error window text, use ${live_tarball##*/} so it doesn't show the whole path.
Any revisions should consist of replacing live_sid.tar.gz.

OK, here's what happened - depending on your definition of 'boot from hard disk' I either did or did not succeed. I added the sid14 to an oversized boot partition on my hard drive and edited the grub menu accordingly. Also added the new patched initrd. I tried to boot from grub menu but got a kernel panic. Then I tried booting sid14 on the usb stick, again with the new initrd, and it booted. When I checked df, it showed /dev/sda1 mounted on /lib/live/mount/findiso, and when I looked there, sure enough it was the boot partition on sda. That would be a good reason to use a different directory name to hold the files.

And I did the above with and without 'basemountmode=rw,noatime,umask=000'. It booted both times. With the option, I could only write to the disk as root.
User avatar
fsmithred
 
Posts: 2081
Joined: Wed Mar 09, 2011 9:13 pm

Re: Boot Refracta (or other Debian-Live) ISO from grub2 menu

Postby dzz » Sat Jan 25, 2014 8:55 pm

If you have a directory/file of the same name in the root of more than one partition findiso will use the first one ot finds (not necessarily the right one). Same with multiple /live/filesystem.squashfs.. an excellent recipe for boot failure!

The problem of booting from iso on fixed disk in sid might not apply to usb

Although this patch is unecessary in wheezy I haven't tested it yet. Hopefully it's back-compatible without breaking anything.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: Boot Refracta (or other Debian-Live) ISO from grub2 menu

Postby fsmithred » Sun Jan 26, 2014 1:16 pm

Seems to work with wheezy. I patched the initrd of an existing refracta-7.2 on usb that has a persistent encrypted loopback file and rw media. All seemed to work. Also checked the same image with an encrypted partition (without the hooks hack) and it worked.
User avatar
fsmithred
 
Posts: 2081
Joined: Wed Mar 09, 2011 9:13 pm

Re: Boot Refracta (or other Debian-Live) ISO from grub2 menu

Postby fsmithred » Mon Feb 02, 2015 4:00 pm

Resurrecting an old thread here. I just added grub to a live-usb and can boot an iso with a very minimal grub.cfg. All done in jessie.

To install grub2 to the mbr, you need to have 2MB free space before the first partition. I did this on a flash drive that was already prepared with refracta2usb and was booting with syslinux, and I always leave 2MB free at the beginning for this purpose.

Plug the stick into a running system. Mount the first partition (fat32).
Create /boot/grub/ on the flash drive. (did this as unprivileged user)
Create /boot/grub/grub.cfg. The menuentry only needs to contain the linux line and the initrd line (oh, and the name, so you can see it in the menu) and those lines only need to show the path on the flash drive to the kernel, initrd and iso file. No need to specify the device - findiso will look for it on all disks. Mine looks like this:
Code: Select all
menuentry "jessv64nox (text-mode)" {
  linux  /jessv64nox/vmlinuz boot=live findiso=/jessv64nox/jessV_amd64_nox.iso
  initrd /jessv64nox/initrd.img
}
I assume that a similar entry would work with the grub.cfg on a hard drive installation, but I haven't tried it.


Install the bootloader (as root) with:
Code: Select all
grub-install --boot-directory=/media/sdX1/boot /dev/sdX
where X is the right letter for your flash drive, and /media/sdX1/ is the mountpoint of the first partition of that flash drive.

You can add more to grub.cfg if you want.
You can add the word, persistence, to the linux line, and that will allow root to edit grub.cfg or other files in the root of the flash drive while running the live system, in case you need to make some changes to it. (it'll be in /lib/live/mount/persistence/sdX1/boot/grub/)
I see that using vga=791 gives you a complaint, but it actually works. I haven't seen that in a few years. Thanks, whoever did that.
User avatar
fsmithred
 
Posts: 2081
Joined: Wed Mar 09, 2011 9:13 pm

Previous

Return to How-to

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred