grub-rescue creates no output

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Kirdow
Member
Member
Posts: 35
Joined: Sun Sep 06, 2015 2:20 pm
Libera.chat IRC: Kirdow
Location: Sweden

grub-rescue creates no output

Post by Kirdow »

Ok, I know you've seen alot of these posts, and I have read them all, but what I've understood it has to do with the OS you're on. And most people I've seen, have the problem on their Debian, and users who use Ubuntu doesn't have this problem. So, I'm following the Meaty Skeleton Guide where at the end, you create an iso file.
At the end, you have a folder, which contains the kernel and grub cfg:

Code: Select all

isodir/boot/grub/grub.cfg
isodir/boot/kirdos.kernel
The isodir is the folder, and everything inside should turn into the iso file. You can see that I use my own os name (kirdos.kernel), I have double triple quadruple checked and there shouldn't be any myos left in the project. If it was, I wouldn't have a kirdos.kernel which I now have. the grub.cfg content is:

Code: Select all

menuentry "kirdos" {
	multiboot /boot/kirdos.kernel
}
This is generated from iso.sh:

Code: Select all

#!/bin/sh
set -e
. ./build.sh

mkdir -p isodir
mkdir -p isodir/boot
mkdir -p isodir/boot/grub

cp sysroot/boot/kirdos.kernel isodir/boot/kirdos.kernel
cat > isodir/boot/grub/grub.cfg << EOF
menuentry "kirdos" {
	multiboot /boot/kirdos.kernel
}
EOF
grub-mkrescue -o kirdos.iso isodir
I know that it the build works, because I have .o files which gets turned into kirdos.kernel (in sysroot/boot/). I then run qemu.sh:

Code: Select all

#!/bin/sh
set -e
. ./iso.sh

qemu-system-$(./target-triplet-to-arch.sh $HOST) -cdrom kirdos.iso
This one displays that it can't find kirdos.iso. I then try to run iso.sh (source above) again which then, ofcourse fails. What I then did, was to manually run grub-mkrescue -o kirdos.iso isodir, and see if it even generated an iso file, which it did not. So I started googling, appearently it doesn't work when it doesn't have a boot/grub directory accessible. I'm not sure though if it meant isodir/boot/grub or if it meant the boot/grub on my actual system. What I also saw is that almost everyone has the problem on Debian, and that most (not all) had it working when they switched to Ubuntu. I have ubuntu, and yes, it's not working. In my case, I do not want to switch from Ubuntu (I have Ubuntu 14.04 LTS) so there must be a way to work around this. I know I could start qemu with just the kernel as input, but then when I add other files (like user made programs), I can't access them because I just run just the kernel and not the actual iso (I know that you propably shouldn't use the ISO file as permanent boot but let's say this is not the final state).

So, how can I fix this? I do not want to switch OS (from Ubuntu), and I wont do it. And I don't want a way where I have to do it manually (like where I can't use the iso.sh script).
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: grub-rescue creates no output

Post by iansjack »

Can we assume that you have installed xorriso?
User avatar
Kirdow
Member
Member
Posts: 35
Joined: Sun Sep 06, 2015 2:20 pm
Libera.chat IRC: Kirdow
Location: Sweden

Re: grub-rescue creates no output

Post by Kirdow »

iansjack wrote:Can we assume that you have installed xorriso?
Nope! Thanks.
User avatar
Kirdow
Member
Member
Posts: 35
Joined: Sun Sep 06, 2015 2:20 pm
Libera.chat IRC: Kirdow
Location: Sweden

Re: grub-rescue creates no output

Post by Kirdow »

Or actually, it Semi-Worked. I installed xorriso, and now it actually generates the iso file. Though when I run it, with the iso file as input, qemu actually do start, but the output is:

Code: Select all

Booting from Floppy...
Boot failed: could not read the boot disk

Booting from DVD/CD...
Boot failed: Could not read from CDROM (code 0009)
Booting from ROM...
iPXE (PCI 00:03.0) starting execution...ok
iPXE initialising devices...ok



iPXE 1.0.0+git-20131111.c3d1e78-2ubuntu1.1 -- Open Source Network Boot Firmware
-- http://ipxe.org
Features: HTTP HTTPS iSCSI DNS TFTP AoE bzImage ELF MBOOT PXE PXEXT Menu

net0: 52:54:00:12:34:56 using 82540em on PCI00:03.0 (open)
  [Link:up, TX:0 TXE:0 RX:0 RXE:0]
Configuring (net0 52:54:00:12:34:56)...... ok
net0: 10.0.2.15/255.255.255.0 gw 10.0.2.2
Nothing to boot: No such file or directory (http://ipxe.org/2d03e13b)
No more network devices

No bootable device.
_
Which is not what I wanted. I wanted it to show my OS, now it says it's not a bootable device.
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: grub-rescue creates no output

Post by jnc100 »

sudo apt-get install grub-pc-bin

is also required if your host system uses UEFI to boot, because in that case by default your ubuntu installation does not contain the PC-BIOS version of grub.

Regards,
John.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: grub-rescue creates no output

Post by iansjack »

You might like to try mounting the .iso file and checking its contents.
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

Re: grub-rescue creates no output

Post by osdever »

iansjack wrote:Can we assume that you have installed xorriso?
Yes.
UPD: Selected wrong thread, sorry.
Attachments
Screenshot from 2015-11-18 16-11-54.png
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Post Reply