etch

#variables
EDGEBSD_ARCH="evbarm"
EDGEBSD_KERNEL="netbsd-N900.gz"
EDGEBSD_MACHINE="evbarm"
EDGEBSD_PACKAGES="$EDGEBSD_PACKAGES
modular-xorg-server deforaos-desktop
gnome-icon-theme"
EDGEBSD_SERVICES="devpubd powerd"
IMAGE_SIZE=256000
ROOT="ld0a"
#executables
INSTALLBOOT=
#functions
#install_bootloader
_install_bootloader()
{
:
}
#install_configure_fstab
_install_configure_fstab()
{
#/etc/fstab
_info "Configuring the system partitions..."
$DEBUG $MKDIR -m 0755 -- "$DESTDIR/mnt/cdrom" \
"$DESTDIR/mnt/usb" || return 2
$DEBUG $CAT > "$DESTDIR/etc/fstab" << EOF
/dev/$ROOT / ffs rw,log 1 1
tmpfs /tmp tmpfs rw,-m=1777,-s=16m,noexec
ptyfs /dev/pts ptyfs rw
EOF
[ $? -eq 0 ] || return 2
}
#install_kernel
_install_kernel()
{
kernel="$EDGEBSD_MIRROR/pub/EdgeBSD/EdgeBSD-$EDGEBSD_VERSION/$EDGEBSD_ARCH/binary/kernel/$EDGEBSD_KERNEL"
#FIXME the kernel is not available yet
return 0
filename=$(_download "$kernel") || return 2
[ -f "$DESTDIR/uImage" ] && return 0
_info "Installing the kernel..."
$DEBUG $MKDIR -m 0755 "$DESTDIR" || return 2
$DEBUG $INSTALL -m 0755 "$filename" "$DESTDIR/uImage" || return 2
}
#install_packages
_install_packages()
{
#FIXME binary packages are not available yet
return 0
}
#volume_format
_volume_format()
{
disknames=$($SYSCTL "hw.disknames")
i=0
for diskname in $disknames; do
[ "$diskname" = "vnd$i" ] && i=$((i + 1))
done
VND="vnd$i"
$DEBUG $VNCONFIG -c "$VND" "$TARGET" || return 2
tmpfile=$($MKTEMP)
if [ $? -ne 0 ]; then
$DEBUG $VNCONFIG -u "$VND"
return 2
fi
$DISKLABEL "$VND" | $GREP -q -- '^ a:'
res=$?
if [ $res -eq 1 ]; then
($DEBUG $DISKLABEL "$VND" | $SED -e 's/^ e:/ a:/' \
-e 's/^ f:/ e:/' > "$tmpfile" &&
$DEBUG $DISKLABEL -R "$VND" "$tmpfile")
res=$?
fi
$RM -- "$tmpfile"
if [ $res -ne 0 ]; then
$DEBUG $VNCONFIG -u "$VND"
return 2
fi
$DEBUG $NEWFS "${VND}a"
if [ $? -ne 0 ]; then
$DEBUG $VNCONFIG -u "$VND"
return 2
fi
}
#volume_partition
_volume_partition()
{
size=$((IMAGE_SIZE * IMAGE_BS / 512 - 65537))
offset=$((size + 1))
$DEBUG $FDISK -Ffu0s "169/1/$size" "$TARGET" || return 2
$DEBUG $FDISK -Ffu2s "12/$offset/65536" "$TARGET" || return 2
}