From nobody@FreeBSD.org  Mon Oct 25 17:35:52 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3DDB1065679
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Oct 2010 17:35:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A1F738FC16
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Oct 2010 17:35:52 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o9PHZqZK083338
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 25 Oct 2010 17:35:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o9PHZqYR083337;
	Mon, 25 Oct 2010 17:35:52 GMT
	(envelope-from nobody)
Message-Id: <201010251735.o9PHZqYR083337@www.freebsd.org>
Date: Mon, 25 Oct 2010 17:35:52 GMT
From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kldload on 8.1-RELEASE memorystick fails
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         151722
>Category:       amd64
>Synopsis:       kldload on 8.1-RELEASE memorystick fails
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 25 17:40:10 UTC 2010
>Closed-Date:    Mon Oct 25 18:00:57 UTC 2010
>Last-Modified:  Tue Oct 26 07:30:08 UTC 2010
>Originator:     Harald Hanche-Olsen
>Release:        8.1-RELEASE
>Organization:
>Environment:
FreeBSD  8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010   root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
When booting from a USB stick made from FreeBSD-8.1-RELEASE-amd64-memstick.img, kldload cannot load kernel modules. As a result, it is impossible to install freebsd on a zfs volume.
>How-To-Repeat:
Get ftp://ftp.no.freebsd.org/pub/FreeBSD/releases/amd64/ISO-IMAGES/8.1/FreeBSD-8.1-RELEASE-amd64-memstick.img and copy it to a memorystick with dd. Boot from the memory stick, select Fixit from the menu, select USB. In the resulting shell, try

kldload /mnt2/boot/kernel/zfs.ko

Result:

kldload: can't load /mnt2/boot/kernel/zfs.ko: Exec format error

I tried a few other kernel modules at random with the same result.
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Mon Oct 25 17:57:06 UTC 2010 
State-Changed-Why:  
Dear submitter, 

This is caused by not having the specific directories in 
the kernel module path and zfs.ko depends on opensolaris.ko. 
(kern.module_path) 

In order to be able to load zfs.ko, you need to load opensolaris.ko 
first: 

kldload /mnt2/boot/kernel/opensolaris.ko 
kldload /mnt2/boot/kernel/zfs.ko 

I personally don't think this is a bug but it might be good to 
document it in the LiveFS motd. 


Responsible-Changed-From-To: freebsd-amd64->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Mon Oct 25 17:57:06 UTC 2010 
Responsible-Changed-Why:  
Take and track. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=151722 

From: Harald Hanche-Olsen <hanche@math.ntnu.no>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: amd64/151722: kldload on 8.1-RELEASE memorystick fails
Date: Tue, 26 Oct 2010 08:57:09 +0200 (CEST)

 (I don't know if it's possibly to add to a closed PR, but here goes.
 Maybe the info will be useful to others.)
 
 I can now confirm delphij's analysis: Not a bug. That is, there IS a
 bug, but that is the different bug of a seriously misleading error
 message from kldload. I am told that is not easy to fix, so it will
 probably remain.
>Unformatted:
