#!/bin/bash
#set -e -u

device="boneblack"
codename="unstable"

ARGS="$@"

tempcfg="mkos-${device}.mstrap"
tempmount="mkos-${device}.fs"
cfgfile=/usr/share/mkos-${device}/$tempcfg

# Generate the multistrap config file.
mkos-mlo-config -i $cfgfile -o $tempcfg -t mkos-${device}.tar.gz -p device-${device} $ARGS

# Produce the filesystem directory.
#
# Various hooks inside of multistrap will create the tgz, repo, manifest, ISO, and IMG files.
fakeroot /usr/sbin/multistrap -f $tempcfg -d $tempmount

