#! /bin/sh -e

. /usr/share/debconf/confmodule

mount -t proc proc /target/proc
trap 'umount /target/proc' EXIT HUP INT QUIT TERM

db_capb

db_progress START 0 1 yaboot-installer/progress
db_progress INFO yaboot-installer/ybin

if ! log-output -t yaboot-installer chroot /target mkofboot -v -f; then
	db_input critical yaboot-installer/ybinerr
	db_go || true
fi

db_progress STEP 1
db_progress STOP

db_input high yaboot-installer/success || true
db_go || true

db_capb backup

exit 0
