#!/bin/bash

[[ -z $RECIPE ]] && RECIPE="default"

sleep 2
mount -a
echo ':qemu-aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-aarch64-static:OCF' > /proc/sys/fs/binfmt_misc/register

if ! ./make_userland.sh -r "$RECIPE" -o /output
then
    printf "Error when create userland\n"
fi
