From owner-freebsd-current@FreeBSD.ORG Sun Mar 21 07:53:25 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4413F16A4CE; Sun, 21 Mar 2004 07:53:25 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F5A243D2F; Sun, 21 Mar 2004 07:53:25 -0800 (PST) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.9p1/8.12.8) with ESMTP id i2LFrNRS023466; Sun, 21 Mar 2004 07:53:23 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.9p1/8.12.3/Submit) id i2LFrN5e023465; Sun, 21 Mar 2004 07:53:23 -0800 (PST) (envelope-from rizzo) Date: Sun, 21 Mar 2004 07:53:23 -0800 From: Luigi Rizzo To: phk@freebsd.org, current@freebsd.org Message-ID: <20040321075323.A23229@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Mailman-Approved-At: Mon, 22 Mar 2004 04:39:08 -0800 Subject: sys/dev/md/md.c wrong execution order of md_takeroot() and md_preloaded() ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2004 15:53:25 -0000 Hi, in trying to use a picobsd version based on current, i noticed that the preloaded mfs image is not recognised, but you can boot from it if you specify ufs:md0 at the mountroot> prompt. A few printf()s in md.c showed that md_takeroot() is run before md_preloaded(). Unless i am missing something in the kernel config files, it is not clear to me why this occurs -- the order numbers in the SYSINIT line at the end of md.c look correct, and larger than the one used in DECLARE_GEOM_CLASS, so I have no idea on whay the order is not the correct one. Anyways, one possible fix is to call md_takeroot() near the end of md_preloaded(), which is the only place where mdrootready can be set. This would also remove the need for the SYSINIT at the end of the file, and overall simplifies the code. It still leaves the question unsolved though... ideas ? cheers luigi