Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Nov 2011 19:15:27 +0100
From:      Monthadar Al Jaberi <monthadar@gmail.com>
To:        freebsd-fs@freebsd.org
Subject:   Re: Boot kernel from ufs:md0 gives error 22 on AVILA arm board
Message-ID:  <CA%2BsBSoJAqb0DH7wHXA9eMDy46wHzQJPYDNZzVehOaaooCXiBTQ@mail.gmail.com>
In-Reply-To: <CA%2BsBSoKDADrnOgYP6FP9h6arDWHXrhbk8MekiL1NaO=pces7OQ@mail.gmail.com>
References:  <CA%2BsBSoKDADrnOgYP6FP9h6arDWHXrhbk8MekiL1NaO=pces7OQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
sorry I mixed little endiean with big endiean.

br,

On Mon, Nov 14, 2011 at 6:15 PM, Monthadar Al Jaberi
<monthadar@gmail.com> 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<fstype>:<device> [options]
> =A0 =A0 =A0Mount <device> using filesystem <fstype>
> =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<empty line> =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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BsBSoJAqb0DH7wHXA9eMDy46wHzQJPYDNZzVehOaaooCXiBTQ>