From owner-freebsd-fs@FreeBSD.ORG Mon Nov 14 18:15:28 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D253F1065670 for ; Mon, 14 Nov 2011 18:15:28 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 93C578FC08 for ; Mon, 14 Nov 2011 18:15:28 +0000 (UTC) Received: by yenl11 with SMTP id l11so1822235yen.13 for ; Mon, 14 Nov 2011 10:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ADdvQQyqRsnL/n9BC9XHdVDRPV7UZUIjyUGyh5uKsjk=; b=KsVeInyC6gdKjbqkU5bwVmmWRzsFGM4B6nSxHSOkacsHK6lWvX0R8P2QxEUDLTjDUw AE/Pi2QQfDXxlmOMYhMB5XjpLiXXXAEw7O+ahk8XOZVf/93xQo67lbgEoR0ppR+q9MUS QYmzZUciGwUDH1Hzz18WCtvQHdaysvvMtBKXc= MIME-Version: 1.0 Received: by 10.50.185.232 with SMTP id ff8mr25168356igc.32.1321294527647; Mon, 14 Nov 2011 10:15:27 -0800 (PST) Received: by 10.50.40.226 with HTTP; Mon, 14 Nov 2011 10:15:27 -0800 (PST) In-Reply-To: References: Date: Mon, 14 Nov 2011 19:15:27 +0100 Message-ID: From: Monthadar Al Jaberi To: freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Boot kernel from ufs:md0 gives error 22 on AVILA arm board X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Nov 2011 18:15:29 -0000 sorry I mixed little endiean with big endiean. br, On Mon, Nov 14, 2011 at 6:15 PM, Monthadar Al Jaberi wrote: > Hi, > > I am having problems booting from ufs:md0 and hope you can help me. > > I changed the default configuration file AVILA so that it boots from > MD instead of NFS. > options =A0 =A0 =A0 =A0 MD_ROOT =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 #MD is a = potential root device > options =A0 =A0 =A0 =A0 MD_ROOT_SIZE=3D4096 > options =A0 =A0 =A0 =A0 ROOTDEVNAME=3D\"ufs:md0\" > > I then generated a filesystem and embedded it inside kernel like this: > makefs -t ffs -B little -s 4m avila.img path/to/root > > addr=3D($(strings -td kernel.bin | grep "MFS Filesystem" | awk '{print > $1}')) #calculate start and end address for mdroot > rootfs_start=3D${addr[0]} > rootfs_end=3D$((${addr[1]}+1)) > echo "Generating kernel image for AVILA from ${rootfs_start} to ${rootfs_= end}" > head -c ${rootfs_start} kernel.bin > kernel.new > cat avila.img >> kernel.new > tail -c +${rootfs_end} kernel.bin >> kernel.new > > then from redboot: > load -b 0x00200000 kernel.new > go > > and I get following error: > Trying to mount root from ufs:/dev/md0 []... > Mounting from ufs:/dev/md0 failed with error 22. > Trying to mount root from ufs:md0 []... > Mounting from ufs:md0 failed with error 22. > > Loader variables: > > Manual root filesystem specification: > =A0: [options] > =A0 =A0 =A0Mount using filesystem > =A0 =A0 =A0and with the specified (optional) option list. > > =A0 =A0eg. ufs:/dev/da0s1a > =A0 =A0 =A0 =A0zfs:tank > =A0 =A0 =A0 =A0cd9660:/dev/acd0 ro > =A0 =A0 =A0 =A0 =A0(which is equivalent to: mount -t cd9660 -o ro /dev/ac= d0 /) > > =A0? =A0 =A0 =A0 =A0 =A0 =A0 =A0 List valid disk boot devices > =A0. =A0 =A0 =A0 =A0 =A0 =A0 =A0 Yield 1 second (for background tasks) > =A0 =A0 =A0Abort manual input > > mountroot> ? > > List of GEOM managed disk devices: > redboot/FIS directory redboot/RedBoot config redboot/RedBoot cfid0 md0 > > mountroot> > > The md0 partition is there. And this is how I do it for the > RouterStation Pro and it works there. > > When I debug the kernel code I see that the EINVAL is generated from > /* > =A0* Common code for mount and mountroot > =A0*/ > static int > ffs_mountfs(devvp, mp, td) > =A0 =A0 =A0 =A0struct vnode *devvp; > =A0 =A0 =A0 =A0struct mount *mp; > =A0 =A0 =A0 =A0struct thread *td; > { > ... > =A0 =A0 =A0 =A0/* > =A0 =A0 =A0 =A0 * Try reading the superblock in each of its possible loca= tions. > =A0 =A0 =A0 =A0 */ > =A0 =A0 =A0 =A0for (i =3D 0; sblock_try[i] !=3D -1; i++) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0... > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (sblock_try[i] =3D=3D -1) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D EINVAL; =A0 =A0 =A0 =A0 /* XXX n= eeds translation */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto out; > =A0 =A0 =A0 =A0} > ... > } > > What am I doing wrong? any help is very appreciated. > Best regards > -- > Monthadar Al Jaberi > --=20 Monthadar Al Jaberi