#!/bin/sh # Issues: this does not create a label: # + makefs -D -N /tank/emaste/obj/root/freebsd-arm64/etc -o label=freebsd_root -t ffs -f 256 /tank/emaste/src/freebsd-arm64/root.ufs /tmp/makeroot.KVqzw/manifest # this does: # makefs -B little -o label=freebsd_root -Z -b 512m -F $ROOTDIR/METALOG arm64_ufs $ROOTDIR # because -t ffs clears the option set export MAKEOBJDIRPREFIX=/tank/emaste/obj TOPDIR=$(cd $(dirname $0) && pwd -L) SUBDIR=$(basename $TOPDIR) SRCCONF="SRCCONF=$TOPDIR/src.conf" ROOTDIR=$MAKEOBJDIRPREFIX/root/$SUBDIR mkdir -p $ROOTDIR create_file() { mode=0444 if [ $1 = "-m" ]; then mode=$2 shift shift fi file_path=${1#/} cat > $ROOTDIR/$file_path file_size=$(($(cat $ROOTDIR/$file_path | wc -c))) # echo "./$file_path type=file uname=root gname=wheel mode=$mode size=$file_size" >> $ROOTDIR/METALOG echo "./$file_path type=file uname=root gname=wheel mode=$mode" >> $ROOTDIR/METALOG } create_src_manifest() { git ls-files | \ sed -E "s?(.*)?./usr/src/\1 type=file uname=root gname=wheel mode=0644 contents=$TOPDIR/\1?" > $ROOTDIR/METALOG.src } create_ports_manifest() { p=/tank/emaste/src/ports ( find $p -maxdepth 1 -type f find $p/Keywords $p/Mk $p/Templates $p/Tools -type f find $p/ports-mgmt/dialog4ports $p/ports-mgmt/pkg -type f find $p/devel/atf $p/devel/kyua $p/devel/lutok $p/databases/sqlite3 -type f ) | sed -E "s?$p(.*)?./usr/ports\1 type=file uname=root gname=wheel mode=0644 contents=$p\1?" > $ROOTDIR/METALOG.ports p=/usr/ports/distfiles while read file; do echo ".$p/$file type=file uname=root gname=wheel mode=0644 contents=$p/$file" >> $ROOTDIR/METALOG.ports done <&1 | tee install.log