Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can not boot to gentoo iso file with grub2 [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Thu Jun 24, 2021 1:15 pm    Post subject: Can not boot to gentoo iso file with grub2 [SOLVED] Reply with quote

Hi,

I can not boot from the Gentoo installation CD by chainloading as per the wiki

First, the wiki is not up-to-date; gentoo and gentoo.igz do not reside in isolinux anymore but in boot.

Despite making this change, the booy process fails after it is trying to load the root filesystem. Apparently the boot process can not find the squashfs inside the looped back ISO - but, as per the wiki, it did find it at some point?

An important detail is, that I'm trying the x86 minimal installation ISO - i.e. install-x86-minimal-20210621T214502Z.iso.

<EDIT>
Other details:

grub2 boot entry:
Code:
menuentry "STG3-i486" {
        set cmdline="dokeymap looptype=squashfs loop=/image.squashfs cdroot"
        set iso=/boot/install-x86-minimal-20210621T214502Z.iso
        loopback loop ${iso}
        linux  (loop)/boot/gentoo $cmdline root=/dev/ram0 init=/linuxrc initrd=/boot/gentoo.igz
        initrd (loop)/boot/gentoo.igz
}


cmdline of the failed boot:
Code:
$ cat cmdline
BOOT_IMAGE=(loop)/boot/gentoo dokeymap looptype=squashfs loop=/image.squashfs cdroot root=/dev/ram0 init=/linuxrc initrd=/boot/gentoo.igz


Also, after I've gotten to the emergency shell, if I losetup -f image.squashfs, and then give /dev/loop1 as the block device for root, I can "kind of" get the liveCD to boot. However, it can not remount the root as rw, but fails with "read only filesystem" and plethora of other errors, while trying to initialize; which is weird, since the original (USB/CD) and squashfs is still read-only. It is probable it doesn't like the fact the squasfs image is in: [mount ext4 partition]->[mount looped iso]->[losetup].
</EDIT>

Cheers!

p.s.
Before workarounds are being suggested: this is a very old PC (hence the x86 image) which can not (easily) boot from an USB drive. BIOS can not do it, but I could puit plob on an floppy to boot from USB, but it is unreliable and horribly slow (that's how I got Gentoo on the machine in the first place).

I could also burn the image to a CD as in the golden olden days, but that, too, is unreliable and slow. Old optical drives are even less reliable, and the process is usually similar to: burn->put the CD in the drive->fail because of a bad burn->burn again...).

In this case, I would much rather boot from a chainloaded .iso file, since I can already boot from MBR Grub2. As a workaround, some other boot manager (for BIOS/Legacy) could for for me!
_________________
- Ville


Last edited by ville.aakko on Fri Jun 25, 2021 9:03 am; edited 2 times in total
Back to top
View user's profile Send private message
ville.aakko
Tux's lil' helper
Tux's lil' helper


Joined: 06 Aug 2006
Posts: 113
Location: Oulu, Finland

PostPosted: Fri Jun 25, 2021 9:02 am    Post subject: Reply with quote

Replying to myself:

This works for me:
Code:
menuentry "gentoo-install-i686" {
        # set cmdline="dokeymap looptype=squashfs loop=/image.squashfs cdroot"
        set iso=/boot/gin.iso
    bootoptions="isoboot=$iso root=/dev/ram0 init=/linuxrc dokeymap looptype=squashfs loop=/image.squashfs cdroot vga=791"
        loopback loop ${iso}
        linux  (loop)/boot/gentoo $bootoptions
        initrd (loop)/boot/gentoo.igz
}


Obviously gin.iso is shorthand (renamed) for Gentoo's install-x86-minimal-20210621T214502Z.iso :D

I think the culprit here is isoboot=XXX. I'm not sure how one is supposed to know that; I found the information from many places by searching, for example this site. Seems like other distributions are not better at all..

If one is faced with the rescue shell after a failed boot, one can possibly mount the squasfs image in /mnt/livecd, but I didn't try.

:!: is there a documentation somewhere explaining the parameters the livecd kernel knows of? :!: It would be nice to find the documentation easily, as there are use cases for booting from the .iso file directly - one might have lost all their USB thumb drives etc :)

In any case, marking as SOLVED!

(Wiki page edited)
_________________
- Ville
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum