Category Archives: FreeBSD

Extract ISO (9660) file on FreeBSD

A small reminder for me that FreeBSD’s tar (BSDTAR) can extract ISO files out of the box, unlike GNU tar which can’t as far as I know.

List files in the ISO file:

$ tar -tf filename.iso

Extract files to current directory (pwd)

$ tar -xf filename.iso

FreeBSD 7: Having trouble installing mysql without linuxthreads?

Believe it or not I was installing mysql on a FreeBSD 7 box for most of the day. After looking at the make options my attention was grabbed by the WITH_LINUXTHREADS parameter. After a bit of googling it seemed the I did not need linuxthreads on FreeBSD7-STABLE. So there I go and add the WITH_LINUXTHREADS=no and… the installation fails at… linuxthreads.

Well. I’ve spent lots of time googling, passed numerous make errors. Basically at the end of the day I just modified the Makefile of the mysql port to totally bypass the WITH_LINUXTHREADS and just add the standart non-linuxthread configure options.

Open the Makefile

# vi /usr/ports/databases/mysqlxx-server/Makefile

Find these lines (or similar)

.if defined(WITH_LINUXTHREADS)
CONFIGURE_ARGS+=--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R
CONFIGURE_ARGS+=-D_THREAD_SAFE -I${LOCALBASE}/include/pthread/linuxthreads
CFLAGS+=        -D__USE_UNIX98 -D_REENTRANT -D_THREAD_SAFE
CFLAGS+=        -I${LOCALBASE}/include/pthread/linuxthreads
LIB_DEPENDS+=   lthread.[35]:${PORTSDIR}/devel/linuxthreads
CONFIGURE_ARGS+=-L${LOCALBASE}/lib -llthread -llgcc_r -llstdc++ -llsupc++'

Change to

.if defined(WITH_LINUXTHREADS)
CONFIGURE_ARGS+=--with-named-thread-libs=${PTHREAD_LIBS}
CFLAGS+=        ${PTHREAD_CFLAGS}

Everything compiled and installed afterwards without the linuxthreads (I did not want them anyway).

FreeBSD: Upgrading mysql40-server to a higher version port

I needed to upgrade MySQL 4.0.27 to MySQL 5.0 on one of the production servers that I manage . If anyone has any trouble doing that, I have written a small tutorial on how to accomplish this task without many problems.
Read more »