Date: Mon, 12 Dec 2005 18:14:01 +0800 From: Tony <tony.uestc@gmail.com> To: freebsd-hackers@freebsd.org Subject: boot FreeBSD from cdrom using grub Message-ID: <439D4D69.6000906@gmail.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hi,
I'm trying to make an iso image that will boot FreeBSD using GRUB
boot loader.
Grub will boot /boot/loader and the loader will boot /boot/kernel. It
goes well on my disk, but when I try to make a livecd, it fails. I spend
some time figuring out that loader does not probe cd it self, it depends
on boot1 to tell him when cd to boot. So I did some hack on loader.
Bellow is the diff:
*** sys/boot/i386/loader/main.c.bak Sun Dec 11 19:32:29 2005
--- sys/boot/i386/loader/main.c Sun Dec 11 22:04:29 2005
***************
*** 228,235 ****
if ((new_currdev.d_type == biosdisk.dv_type) &&
((new_currdev.d_kind.biosdisk.unit = bd_bios2unit(biosdev)) ==
-1)) {
printf("Can't work out which disk we are booting from.\n"
! "Guessed BIOS device 0x%x not found by probes, defaulting
to disk0:\n", biosdev);
! new_currdev.d_kind.biosdisk.unit = 0;
}
env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
i386_setcurrdev, env_nounset);
--- 228,238 ----
if ((new_currdev.d_type == biosdisk.dv_type) &&
((new_currdev.d_kind.biosdisk.unit = bd_bios2unit(biosdev)) ==
-1)) {
printf("Can't work out which disk we are booting from.\n"
! "Guessed BIOS device 0x%x not found by probes, defaulting
to cd0(%d):\n", biosdev, biosdev);
! bc_add(biosdev);
! new_currdev.d_type = bioscd.dv_type;
! new_currdev.d_dev = &bioscd;
! new_currdev.d_kind.bioscd.unit = bc_bios2unit(biosdev);
}
env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
i386_setcurrdev, env_nounset);
Then the kernel starts, but when the kernel try to mount the root fs, it
stops. I have the follow line in my /etc/fstab
/dev/acd0c / cd9660 ro 0 0
I am stranded. Anyone can help?
thx
Tony
[-- Attachment #2 --]
*** sys/boot/i386/loader/main.c.bak Sun Dec 11 19:32:29 2005
--- sys/boot/i386/loader/main.c Sun Dec 11 22:04:29 2005
***************
*** 228,235 ****
if ((new_currdev.d_type == biosdisk.dv_type) &&
((new_currdev.d_kind.biosdisk.unit = bd_bios2unit(biosdev)) == -1)) {
printf("Can't work out which disk we are booting from.\n"
! "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev);
! new_currdev.d_kind.biosdisk.unit = 0;
}
env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
i386_setcurrdev, env_nounset);
--- 228,238 ----
if ((new_currdev.d_type == biosdisk.dv_type) &&
((new_currdev.d_kind.biosdisk.unit = bd_bios2unit(biosdev)) == -1)) {
printf("Can't work out which disk we are booting from.\n"
! "Guessed BIOS device 0x%x not found by probes, defaulting to cd0(%d):\n", biosdev, biosdev);
! bc_add(biosdev);
! new_currdev.d_type = bioscd.dv_type;
! new_currdev.d_dev = &bioscd;
! new_currdev.d_kind.bioscd.unit = bc_bios2unit(biosdev);
}
env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev),
i386_setcurrdev, env_nounset);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?439D4D69.6000906>
