Hi Didier,
[Snip]
> Hello Jude.
>
> Here is a brief summary of what I did up to now. The goal was to
> install a minimal rootfs in flash memory of an embeded Powerpc (MVME3100)
> to use as a sandbox.
>
> 1) I compiled a kernel with the following boot parameters:
> console=ttyS0,9600 root=/dev/mtdblock1 rootfstype=jffs2
>
> 2) The filesystem contains busybox-1.20.2 statically linked with musl,
> which I had done a while ago.
>
> 3) vdevd:
>
> I first tried to compile vdev natively on Debian Wheezy, but could not
> link it statically as I wanted. This is actually a classical problem with
> glibc everytime network functions are used. Actually the offending
> functions are getpwnam_r() and the like. I guess this is related with NIS
> compatibility built in the glibc.
The functions that call getpwnam_r() and getgrnam_r() in libvdev are only
used by vdevfs. It looks like this is going to be the case for the
foreseeable future. I just pushed code that moves them into vdevfs, so you
shouldn't see those errors again when statically linking with glibc.
Thanks for trying that out!
> I decided to link against musl libc. To save time I just downloaded a
> ready-made image of sabotage-linux for powerpc and compiled vdev in a
> sabotage chroot.
>
Good to know! I hadn't tried it with musl yet, but I'm glad to hear that
it works with it.
>
> I have now my minimal OS working. init is a little script doing the
> necessary mounts, including /dev on tmpfs and creating a few device files
> (console, ttyS0, null, zero). The script starts an interactive session and
> I could try to run vdevd by hand:
>
> / # vdevd /dev
> 00487:268746168: [ vdev.c:0425] vdev_init: ERROR:
> vdev_config_load('(null)') rc = -14
> 00487:268746168: [ main.c:0042] main: ERROR: vdev_init rc = -14
> / #
>
> AFIU, I am only missing a config file... :-)
Yup, missing a config file :)
If you run "make -C example" on the host, the Makefile will generate all
the host-tailored vdev config files you'll need (such as persistent
interface naming rules). They will be generated in example/build/etc/vdev
(which can just be copied into /etc).
Once you have your config files generated, you'll need to add "-c
/path/to/config/file" as an argument. I just pushed code to vdevd that
makes it look in /etc/vdev/vdevd.conf, if "-c" is not given (and if
/etc/vdev/vdevd.conf doesn't exist, vdevd should fail with ENOENT instead
of EFAULT).
Also, if you want more verbose debugging output from vdevd, you can pass
"-v" or "-v2" :)
Thank you for giving vdev a try, despite it's pre-alpha-ness :)
-Jude