Bootstrapping pkgng on FreeBSD ARM
There is no official pkgng repo for FreeBSD-arm, yet. There is an unofficial one, here, however in order to use it, you have to have pkgng installed. As far as I can tell, the only way to install pkgng on ARM is to builds and install from source.
On the platform I’m using, Wandboard, the mmc device isn’t working 100% yet, so I decided to compile on a RAM disk. I did this to create the RAM disk
mkdir /mnt/tmpdisk mount -t tmpfs tmpfs /mnt/tmpdisk cd /mnt/tmpdisk
The second step is:
ftp ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/pkg-1.1.4.tar.xz
Once you have the source, untar it, build and install
tar zxvf pkg-1.1.tar.xz cd pkg-1.1 make make install
In my case, “make install” on FreeBSD-Current failed due to lack of certain directories. This may help:
mkdir /usr/local/lib mkdir /usr/local/man mkdir /usr/local/libdata mkdir /usr/local/sbin mkdir /usr/local/man/man8
Once you’ve installed pkgng, you should be able to verify that it’s available
root@wandboard:/mnt/tmpfs/pkg-1.1.4 # /usr/local/sbin/pkg -v 1.1.4
From here, there are a couple of options.
Thank you for the informations about Wandboard and FreeBSD!
I build the images with the crochet-tool and tried to install rsync with pkg – without success.
I am receiving this error:
/usr/lib/libarchive.a: could not read symbols: Malformed archive
I read on a mailing list, that this also happened to you.
Which revision do you use for building pkg?
I use r262992 and I didn’t experience the problem this that build.
Thank you for the information.
There must be another issue, the new error is consistent. I tried other pkg versions, also other FreeBSD revisions. You mentioned a problem with the sd-card, so i copied the files to an usb stick and tried the build from there.
building shared library libpkg.so.1
install: symlink libpkg.so.1 -> libpkg.so: Operation not supported
*** Error code 71
Stop.
make[1]: stopped in /media/usb/pkg-1.1.4/libpkg
*** Error code 1
hm. You’re compiling and installing as root, right?
true. The bad thing is, when i build with a user in wheel group, it is the same. You are absolutely right, that the error message indicates a permission thing.
When i find a solution, i will post it here.
notice to myself:
DO NOT USE fat as a filesystem
FYI, the only reason there is a FAT partition used in the Wandboard image is that U-Boot doesn’t support FreeBSD UFS yet. There has been some talk of adding UFS support to U-boot, so hopefully that’ll happen.
probably not the preferred method…
i copied some library files (/usr/lib/libcrypto.a; libssl.a; libc.a; ..) with error message “could not read symbols: Malformed archive” from the actual build directory (e.g. crochet-freebsd/work/obj/arm.armv6/usr/src/lib/libc/libc.a) to the wandboard (/usr/lib/).
After that, make and make install worked.
just for the record:
my workaround worked until the next reboot – i mixed libraries from different builds
I made some stupid mistakes:
a) i did not rebuild the xdev-tools every time i updated the freebsd sources
b) i used sometimes “make XDEV=arm XDEV_ARCH=arm xdev” instead armv6
now pkgng 1.2.6 builds with the sources from r263252.
thanks for the help!