7.10. ubase git snapshot

ubase provides Linux-specific base utilities for the chroot environment.

Input assumption: ubase-e8249b49ca3e.tar.gz is already present in /sources from the chapter 4 source staging step.

Source note: this archive is generated by scripts/fetch-sources.sh from upstream https://git.suckless.org/ubase at commit e8249b49ca3e02032dece5e0cdac3d236667a6d9.

Licenses:

Dependencies:

ubase is a Linux-specific base utility collection from suckless. we need it to provide tools such as mount, umount, ps, stat, swapon, switch_root, and related Linux system commands inside the target environment.

Extract and Enter the Source Tree

cd /sources
tar -xf ubase-e8249b49ca3e.tar.gz
cd ubase-e8249b49ca3e

Build ubase

Build note: upstream ubase links -lcrypt by default. musl provides the needed crypt interface from libc, so this target build clears LDLIBS.
make $LWI_MAKE_FLAGS \
    CC=cc \
    AR=ar \
    RANLIB=ranlib \
    CFLAGS="-std=c99 -Wall -Wextra $LWI_CFLAGS" \
    LDFLAGS="$LBI_CUSTOM_LDFLAGS" \
    LDLIBS=

Install ubase

make install \
    DESTDIR= \
    PREFIX=/system \
    MANPREFIX=/system/documentation/man-pages \
    CFLAGS="-std=c99 -Wall -Wextra $LWI_CFLAGS" \
    LDFLAGS="$LBI_CUSTOM_LDFLAGS" \
    LDLIBS=

install -d /system/binaries

if [ -d /system/bin ]; then
    mv -f /system/bin/* /system/binaries/
    rmdir /system/bin
fi

Command Explanations