From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 12 10:17:44 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99CED16A420 for ; Mon, 12 Dec 2005 10:17:44 +0000 (GMT) (envelope-from tony.uestc@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0975143D5C for ; Mon, 12 Dec 2005 10:17:39 +0000 (GMT) (envelope-from tony.uestc@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so1336828nzo for ; Mon, 12 Dec 2005 02:17:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:content-type; b=hhND81T0+ap+yTiLeVFkPGT2DFIkWx8VlpDW/2hDKkfUTLar3kk2W4Dx7N+QlENAKVJlUiPGZ1wL+gCtEnehVzCiScO+UK6MwD8mrw51te9kvAM8VyzJCuusypJQfo0aF0jJzvrymm+37iXjdlAqzxpjtmIlnD7FOy2W94RpcGQ= Received: by 10.36.108.16 with SMTP id g16mr5769597nzc; Mon, 12 Dec 2005 02:17:32 -0800 (PST) Received: from ?211.83.98.99? ( [220.166.213.4]) by mx.gmail.com with ESMTP id 6sm9224105nzn.2005.12.12.02.17.27; Mon, 12 Dec 2005 02:17:32 -0800 (PST) Message-ID: <439D4D69.6000906@gmail.com> Date: Mon, 12 Dec 2005 18:14:01 +0800 From: Tony User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: multipart/mixed; boundary="------------000301020408020607010604" Subject: boot FreeBSD from cdrom using grub X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2005 10:17:44 -0000 This is a multi-part message in MIME format. --------------000301020408020607010604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------000301020408020607010604 Content-Type: text/plain; name="diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff.txt" *** 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); --------------000301020408020607010604--