#!/bin/sh

set -x

. /usr/share/volatile/oem-common.sh

APT_OPTIONS="--yes --allow-downgrades --allow-remove-essential --allow-unauthenticated -o Acquire::http::No-Cache=True -o Acquire::Retries=3 -o APT::Get::AllowUnauthenticated=true"

# install oem BU meta package
if [ -f /usr/share/volatile/bu ]; then
	BU_META=$(cat /usr/share/volatile/bu)
	apt-get install $APT_OPTIONS ${BU_META}-meta
else
	echo "Error: can not detect BU, {BU}-chroot-meta is missing"
fi

# install oem platform meta package
python /usr/share/volatile/oem-meta.py

