Cross-compilation hiccups

December 1, 2012 — 21 Comments

Good news and bad news. Let’s start with good ones.

Daisuke Aoyama tracked down what causes “Unrecognized filesystem type” error with some SD cards. It is U-Boot using High Speed mode. Root cause is still unknown but as a workaround I just disabled HS mode for SD card in u-boot and updated freebsd-uboot-20121129.tar.gz. Or alternatively you can get uboot-nohs.img and use it to replace uboot.img on your SD card.

Bad news are: installworld for cross-compiled FreeBSD is broken unless you’re doing it on the latest HEAD. The reason is utility called mtree(8). It is used to ensure that target filesystem permissions and owners/groups are correct. Owners and groups are described as usernames and group names, not as numeric UIDs/GUIDs and mtree uses getpwXXX family of routines to convert names to numeric values. See the problem already? If new system user is added to latest HEAD and you use old trusty FreeBSD 9.0, there is no way mtree would know about this user. NetBSD solved this problem by introducing -N command-line option that lets you point mtree to the target system’s master.passwd and groups. So we need to port this feature to FreeBSD in order to get proper cross-compilation environment. And that’s my plan for next few days.

So if you see something like this:

mtree -eU  -f /src/FreeBSD/head/etc/mtree/BSD.var.dist -p /mnt/var
mtree: line 22: unknown user auditdistd
*** [distrib-dirs] Error code 1

Either update to latest HEAD, use mergemaster -p or wait couple of days.

gonzo

Posts

21 responses to Cross-compilation hiccups

  1. Hiccup is spelled ‘hiccup’.

  2. hmmm, its broken for latest HEAD too.

    ERROR: Required auditstd user is missing, see /usr/src/UPDATING

  3. Thank you. Loaded.
    I use the “GENERIC USB Ethernet Card” it creates a virtual Ethernet interface.
    To do this, you want to include in the kernel option: “device cdce”, how to rebuild the kernel in the assembly Freebsd-RPI?

    • Just replace /boot/kernel/kernel file on SD card with new one. That should do the trick

      • #> kldload: can’t load if_cdce: Exec format error
        Please help to get properly compiled kernel file if_cdce.ko for rpi

        • You can either add this option and use this script to rebuild the whole kernel or do something like this:

          #!/bin/sh
          set -e

          export TARGET=arm
          export TARGET_ARCH=armv6
          export SRCROOT=/src/FreeBSD/head
          export MAKEOBJDIRPREFIX=/src/FreeBSD/objexport KERNCONF=VERSATILEPBexport MAKESYSPATH=$SRCROOT/share/mkbuildenv=`make -C $SRCROOT buildenvvars`eval $buildenv make -C $SRCROOT/sys/modules/usb/cdce

          • cd /usr/rpi/
            git clone git://github.com/gonzoua/freebsd-pi.git
            cd freebsd-pi
            git checkout rpi

            &&

            #!/bin/sh
            set -e
            export TARGET=arm
            export TARGET_ARCH=arm
            export SRCROOT=/usr/rpi/freebsd-pi
            export MAKEOBJDIRPREFIX=/usr/rpi/module KERNCONF=VERSATILEPBexport MAKESYSPATH=$SRCROOT/share/mkbuildenv=`make -C $SRCROOT buildenvvars`eval $buildenv make -C $SRCROOT/sys/modules/usb/cdce

            Module to collect only Freebsd 10?

            I got the git ://github.com/gonzoua/freebsd-pi.git
            Tried on (freebsd 8.2 i386) collect mobule for rpi I got:
            export: 8.2-RELEASE: bad variable name.

            How to compile the module cdce on freebsd 8.2?

  4. Hi, I compiled the whole userland and kernel from a freebsd 9.0-release system and i have the auditdistd issue, how can i use mergemaster -p to fix this? I cant seem to make my pi boot with the resulting image, it says ” Can’t load ‘kernel’ “

  5. Hi, I got this error:

    Mounting from ufs:/dev/mmcsd0s2 failed with error 19.

    Do you have any clue on this? Thanks

Leave a Reply

*

Text formatting is available via select HTML. <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>