site  contact  subhomenews

Sabotage musl root f.s.

April 27, 2016 — BarryK
Sometime ago, I attempted to compile 'f2fs-tools' statically, using uclibc and dietlibc. Failed.

Tried again today, in Quirky 8.0. Still no-go with dietlibc. I installed 'musl', 'musl-dev' and 'musl-tools' DEBs, but no-go, had issues that were too difficult to wade through -- to do with the multilib paths.

So I thought, why not just grab a ready-to-go x86_64 musl root f.s.? Yeah, I downloaded the Sabotage OS:
http://sabotage.tech/
http://img.sabotage.tech/sabotage-1.0.0-x86_64-rootfs-core-aee6b85c.tar.xz

No hassles at all, I was able to compile f2fs-tools. Had to install a few packages first though:
# chroot sabotage-1.0.0-x86_64-rootfs-core-aee6b85c /bin/sh


autoconf 2.69
http://ftp.gnu.org/gnu/autoconf/
# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_6
4-pc-linux-gnu
# make
# make install

automake 1.15
http://ftp.gnu.org/gnu/automake/
# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_6
4-pc-linux-gnu
# make
# make install

m4 1.4.17
http://ftp.gnu.org/gnu/m4/
# ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_6
4-pc-linux-gnu
# make
# make install

libtool 2.4.6
http://ftp.gnu.org/gnu/libtool/
# M4=/bin/m4 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --
build=x86_64-pc-linux-gnu
# make
# make install

already in f.s., but I want this later version...
e2fsprogs 1.42.13
# LDFLAGS='-static' CFLAGS='-O2 -static' ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --localstatedir=/var --sysconfdir=/etc --disable-fsck --disable-libblkid --disable-libuuid --disable-uuidd --enable-relative-symlinks
# make

f2fs-tools 1.6.1
1. Add the below line into mkfs/Makefile.am:
mkfs_f2fs_LDFLAGS = -all-static
2. Add the below line into fsck/Makefile.am:
fsck_f2fs_LDFLAGS = -all-static
# autoreconf --install
# LDFLAGS=-static ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=x86_64-pc-linux-gnu --bindir=/bin --sbindir=/sbin --libdir=/lib --disable-shared --enable-static
# make

f2fs_io_parse.c:16:23: fatal error: sys/queue.h: No such file or directory
...failed building f2fs_io_parse
...however, has built utilities that I need.

# strip --strip-unneeded fsck/fsck.f2fs
# strip --strip-unneeded mkfs/mkfs.f2fs
<

Perhaps others might find this useful. I ran "make clean" in each of the source packages, then put it all together again and uploaded (103.5MB):
http://distro.ibiblio.org/quirky/quirky6/project/sabotage-1.0.0-x86_64-rootfs-core-aee6b85c.tar.gz

To use, just expand, then chroot:
# tar -xf sabotage-1.0.0-x86_64-rootfs-core-aee6b85c.tar.gz
# chroot sabotage-1.0.0-x86_64-rootfs-core-aee6b85c /bin/sh


Note, I want static fsck.f2fs and e2fsck, as redesigning the initrd in Quirky. Currently, for recovery and f.s. check, a rootfs is built in /dev/ram0 from files in the system, however, this is not the best if recovering a broken system.

Tags: linux