merge more, and add an i386 image

This commit is contained in:
christos 2014-04-04 16:45:51 +00:00
parent 1cf0ee0759
commit b862878222
3 changed files with 36 additions and 51 deletions

View File

@ -1,46 +1,6 @@
# $NetBSD: amd64.conf,v 1.1 2014/03/31 16:20:49 christos Exp $
# $NetBSD: amd64.conf,v 1.2 2014/04/04 16:45:51 christos Exp $
# Amd64 customization script used by mkimage
#
board=amd64
MACHINE=amd64
kernel=$src/sys/arch/amd64/compile/GENERIC/netbsd
bootfile=$release/usr/mdec/boot
. ${DIR}/conf/x86.conf
make_filesystems() {
make_filesystems_x86
}
make_fstab() {
make_fstab_x86
}
make_label() {
make_label_x86
}
customize() {
customize_x86
cat >> ${mnt}/etc/rc.conf << EOF
wscons=YES
devpubd=YES
EOF
}
populate() {
if [ ! -f ${kernel} ]; then
echo ${PROG}: Missing ${kernel} 1>&2
exit 1
fi
echo "${bar} installing kernel ${bar}"
cp ${kernel} ${mnt}/netbsd
if [ ! -f ${bootfile} ]; then
echo ${PROG}: Missing ${bootfile} 1>&2
exit 1
fi
cp ${bootfile} ${mnt}/boot
}

View File

@ -0,0 +1,6 @@
# $NetBSD: i386.conf,v 1.1 2014/04/04 16:45:51 christos Exp $
# i386 customization script used by mkimage
#
board=i386
. ${DIR}/conf/x86.conf

View File

@ -1,18 +1,20 @@
# $NetBSD: x86.conf,v 1.3 2014/03/31 18:18:45 christos Exp $
# $NetBSD: x86.conf,v 1.4 2014/04/04 16:45:51 christos Exp $
# x86 shared config
#
image=$HOME/${board}.img
MACHINE=${board}
kernel=$src/sys/arch/${board}/compile/GENERIC/netbsd
bootfile=$release/usr/mdec/boot
specialdirs="/kern /proc"
extra=8 # spare space
size=0 # autocompute
netbsdid=169
ffsoffset=63b
make_label_x86() {
make_label() {
# compute all sizes in terms of sectors
local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
@ -52,7 +54,7 @@ drivedata: 0
EOF
}
make_fstab_x86_normal() {
make_fstab_normal() {
cat > ${mnt}/etc/fstab << EOF
# NetBSD /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
@ -66,7 +68,7 @@ EOF
# From Richard Neswold's:
# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
# Also for the postfix stuff below
make_fstab_x86_minwrites() {
make_fstab_minwrites() {
cat > ${mnt}/etc/fstab << EOF
# NetBSD /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
@ -84,15 +86,15 @@ tmpfs /var/chroot tmpfs rw,union,-s10M
EOF
}
make_fstab_x86() {
make_fstab() {
if $minwrites; then
make_fstab_x86_minwrites
make_fstab_minwrites
else
make_fstab_x86_normal
make_fstab_normal
fi
}
customize_x86() {
customize() {
cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
if $minwrites; then
mkdir ${mnt}/etc/postfix
@ -105,6 +107,8 @@ rc_configured=YES
hostname=${board}
sshd=YES
dhcpcd=YES
wscons=YES
devpubd=YES
EOF
if [ ! -f ${release}/dev/MAKEDEV ]; then
echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
@ -117,3 +121,18 @@ EOF
echo "${bar} creating directories ${bar}"
mkdir ${mnt}/proc ${mnt}/kern
}
populate() {
if [ ! -f ${kernel} ]; then
echo ${PROG}: Missing ${kernel} 1>&2
exit 1
fi
echo "${bar} installing kernel ${bar}"
cp ${kernel} ${mnt}/netbsd
if [ ! -f ${bootfile} ]; then
echo ${PROG}: Missing ${bootfile} 1>&2
exit 1
fi
cp ${bootfile} ${mnt}/boot
}