Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/embedded - Add support for xsets
details: https://anonhg.NetBSD.org/src/rev/dbcd24b05e6f
branches: trunk
changeset: 784064:dbcd24b05e6f
user: christos <christos%NetBSD.org@localhost>
date: Wed Jan 16 23:27:34 2013 +0000
description:
- Add support for xsets
- Factor out common evbarm code
diffstat:
distrib/utils/embedded/conf/beagleboard.conf | 105 ++-----------------------
distrib/utils/embedded/conf/evbarm.conf | 109 +++++++++++++++++++++++++++
distrib/utils/embedded/conf/rpi.conf | 109 ++------------------------
distrib/utils/embedded/mkimage | 21 +++-
4 files changed, 143 insertions(+), 201 deletions(-)
diffs (truncated from 451 to 300 lines):
diff -r 2684f6e8b0f4 -r dbcd24b05e6f distrib/utils/embedded/conf/beagleboard.conf
--- a/distrib/utils/embedded/conf/beagleboard.conf Wed Jan 16 23:27:05 2013 +0000
+++ b/distrib/utils/embedded/conf/beagleboard.conf Wed Jan 16 23:27:34 2013 +0000
@@ -1,120 +1,33 @@
-# $NetBSD: beagleboard.conf,v 1.2 2013/01/15 02:51:10 jmcneill Exp $
+# $NetBSD: beagleboard.conf,v 1.3 2013/01/16 23:27:34 christos Exp $
# BeagleBoard customization script used by mkimage
#
board=beagleboard
kernelconf=BEAGLEBOARD
+kerneldir=$src/sys/arch/evbarm/compile/obj/${kernelconf}
+
+. ${DIR}/conf/evbarm.conf
+
kernelimg=netbsd.ub
loadaddr=81000000
-image=$HOME/${board}.img
-
-sets="base etc comp games man misc modules tests text"
-setsdir=$obj/evbarm/media
-kerneldir=$src/sys/arch/evbarm/compile/obj/${kernelconf}
-specialdirs="/kern /proc"
-swap=512
-size=2048
-overhead=8
-boot=112
-init=8
-msdosid=12
-tmp=/tmp/${board}.disklabel.$$
make_filesystems() {
-
- local asize=$(( ${size} * 1024 ))
- local swapsize=$(( ${swap} * 1024 ))
- local bootsize=$(( ${boot} * 1024 ))
-
- local bootoffset=$((${init} * 1024 ))
- local swapoffset=$(( ${bootoffset} + ${bootsize} ))
- local aoffset=$(( ${swapoffset} + ${swapsize} ))
-
- local totalsize=$(( ${asize} + ${swapsize} + ${bootsize} + ${bootoffset} ))
- local bps=512
- local spt=32
- local tpc=64
- local spc=2048
- local cylinders=$(( ${totalsize} / ${spc} ))
-
- cat > ${tmp} << EOF
-type: SCSI
-disk: STORAGE DEVICE
-label: fictitious
-flags: removable
-bytes/sector: ${bps}
-sectors/track: ${spt}
-tracks/cylinder: ${tpc}
-sectors/cylinder: ${spc}
-cylinders: ${cylinders}
-total sectors: ${totalsize}
-rpm: 3600
-interleave: 1
-trackskew: 0
-cylinderskew: 0
-headswitch: 0 # microseconds
-track-to-track seek: 0 # microseconds
-drivedata: 0
-
-8 partitions:
-# size offset fstype [fsize bsize cpg/sgs]
- a: ${asize} ${aoffset} 4.2BSD 2048 16384 0 #
- b: ${swapsize} ${swapoffset} swap #
- d: ${totalsize} 0 unused 0 0 #
- e: ${bootsize} ${bootoffset} MSDOS #
-EOF
- ${sudo} disklabel -R ${vnddev} ${tmp}
- ${sudo} fdisk -f -u -0 -s ${msdosid}/${bootoffset}/${bootsize} -F ${image}
- ${sudo} newfs /dev/r${vnddev}a
- ${sudo} newfs_msdos /dev/r${vnddev}e
- ${sudo} mount /dev/${vnddev}a ${mnt}
- ${sudo} mkdir ${mnt}/boot
- ${sudo} mount_msdos /dev/${vnddev}e ${mnt}/boot
+ make_filesystems_evbarm
}
make_fstab() {
-${sudo} cat > ${mnt}/etc/fstab << EOF
-# NetBSD /etc/fstab
-# See /usr/share/examples/fstab/ for more examples.
-/dev/ld0a / ffs rw,log 1 1
-/dev/ld0b none swap sw 0 0
-/dev/ld0e /boot msdos rw 1 1
-kernfs /kern kernfs rw
-ptyfs /dev/pts ptyfs rw
-procfs /proc procfs rw
-EOF
+ make_fstab_evbarm
}
customize() {
-
- ${sudo} cat >> ${mnt}/etc/rc.conf << EOF
-hostname=${board}
-sshd=YES
-dhcpcd=YES
-mdnsd=YES
-EOF
+ customize_evbarm
${sudo} cat > ${mnt}/boot/uEnv.txt << EOF
loaduimage=fatload mmc 0 ${loadaddr} ${kernelimg}; bootm ${loadaddr} root=ld0a
EOF
-
- if [ ! -f ${kerneldir}/${kernelimg} ]; then
- echo ${PROG}: Missing ${kerneldir}/${kernelimg} 1>&2
- exit 1
- fi
- echo "${bar} installing kernel ${bar}"
- ${sudo} cp ${kerneldir}/${kernelimg} ${mnt}/boot
-
- if [ ! -f ${mnt}/dev/MAKEDEV ]; then
- echo ${PROG}: Missing ${mnt}/dev/MAKEDEV 1>&2
- exit 1
- fi
- echo "${bar} running MAKEDEV ${bar}"
- (cd ${mnt}/dev && ${sudo} sh MAKEDEV all)
}
cleanup() {
- rm -f ${tmp}
- ${sudo} umount ${mnt}/boot
+ cleanup_evbarm
}
diff -r 2684f6e8b0f4 -r dbcd24b05e6f distrib/utils/embedded/conf/evbarm.conf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/utils/embedded/conf/evbarm.conf Wed Jan 16 23:27:34 2013 +0000
@@ -0,0 +1,109 @@
+# $NetBSD: evbarm.conf,v 1.1 2013/01/16 23:27:34 christos Exp $
+# evbarm shared config
+#
+image=$HOME/${board}.img
+
+setsdir=$obj/evbarm/media/evbarm/binary/sets/
+specialdirs="/kern /proc"
+
+swap=256
+extra=8 # spare space
+boot=112
+init=8
+
+size=0 # autocompute
+msdosid=12
+overhead=$(( ${swap} + ${extra} + ${init} + ${boot} ))
+
+tmp=/tmp/${board}.disklabel.$$
+
+make_filesystems_evbarm() {
+
+ local asize=$(( ${newsize} * 1024 ))
+ local swapsize=$(( ${swap} * 1024 ))
+ local bootsize=$(( ${boot} * 1024 ))
+
+ local bootoffset=$((${init} * 1024 ))
+ local swapoffset=$(( ${bootoffset} + ${bootsize} ))
+ local aoffset=$(( ${swapoffset} + ${swapsize} ))
+
+ local totalsize=$(( ${asize} + ${swapsize} + ${bootsize} + ${bootoffset} ))
+ local bps=512
+ local spt=32
+ local tpc=64
+ local spc=2048
+ local cylinders=$(( ${totalsize} / ${spc} ))
+
+ cat > ${tmp} << EOF
+type: SCSI
+disk: STORAGE DEVICE
+label: fictitious
+flags: removable
+bytes/sector: ${bps}
+sectors/track: ${spt}
+tracks/cylinder: ${tpc}
+sectors/cylinder: ${spc}
+cylinders: ${cylinders}
+total sectors: ${totalsize}
+rpm: 3600
+interleave: 1
+trackskew: 0
+cylinderskew: 0
+headswitch: 0 # microseconds
+track-to-track seek: 0 # microseconds
+drivedata: 0
+
+8 partitions:
+# size offset fstype [fsize bsize cpg/sgs]
+ a: ${asize} ${aoffset} 4.2BSD ${fsize} ${bsize} 0 #
+ b: ${swapsize} ${swapoffset} swap #
+ d: ${totalsize} 0 unused 0 0 #
+ e: ${bootsize} ${bootoffset} MSDOS #
+EOF
+ ${sudo} disklabel -R ${vnddev} ${tmp}
+ ${sudo} fdisk -f -u -0 -s ${msdosid}/${bootoffset}/${bootsize} -F ${image}
+ ${sudo} newfs /dev/r${vnddev}a
+ ${sudo} newfs_msdos /dev/r${vnddev}e
+ ${sudo} mount -o async /dev/${vnddev}a ${mnt}
+ ${sudo} mkdir ${mnt}/boot
+ ${sudo} mount_msdos /dev/${vnddev}e ${mnt}/boot
+}
+
+make_fstab_evbarm() {
+ ${sudo} cat > ${mnt}/etc/fstab << EOF
+# NetBSD /etc/fstab
+# See /usr/share/examples/fstab/ for more examples.
+/dev/ld0a / ffs rw,log 1 1
+/dev/ld0b none swap sw 0 0
+/dev/ld0e /boot msdos rw 1 1
+kernfs /kern kernfs rw
+ptyfs /dev/pts ptyfs rw
+procfs /proc procfs rw
+EOF
+}
+
+customize_evbarm() {
+ ${sudo} cat >> ${mnt}/etc/rc.conf << EOF
+sshd=YES
+dhcpcd=YES
+mdnsd=YES
+EOF
+ if [ ! -f ${kerneldir}/kernel.img ]; then
+ echo ${PROG}: Missing ${kerneldir}/kernel.img 1>&2
+ exit 1
+ fi
+ echo "${bar} installing kernel ${bar}"
+ ${sudo} cp ${kerneldir}/kernel.img ${mnt}/boot
+
+ if [ ! -f ${mnt}/dev/MAKEDEV ]; then
+ echo ${PROG}: Missing ${mnt}/dev/MAKEDEV 1>&2
+ exit 1
+ fi
+ echo "${bar} running MAKEDEV ${bar}"
+ (cd ${mnt}/dev && ${sudo} sh MAKEDEV all)
+}
+
+cleanup_evbarm() {
+ rm -f ${tmp}
+ ${sudo} umount ${mnt}/boot
+}
diff -r 2684f6e8b0f4 -r dbcd24b05e6f distrib/utils/embedded/conf/rpi.conf
--- a/distrib/utils/embedded/conf/rpi.conf Wed Jan 16 23:27:05 2013 +0000
+++ b/distrib/utils/embedded/conf/rpi.conf Wed Jan 16 23:27:34 2013 +0000
@@ -1,98 +1,27 @@
-# $NetBSD: rpi.conf,v 1.8 2013/01/15 20:55:00 christos Exp $
+# $NetBSD: rpi.conf,v 1.9 2013/01/16 23:27:34 christos Exp $
# Raspberry PI customization script used by mkimage
#
-image=$HOME/rpi.img
+
+board=rpi
+kernelconf=RPI
+kerneldir=$src/sys/arch/evbarm/compile/${kernelconf}
+
+. ${DIR}/conf/evbarm.conf
firmwaredir=$src/external/broadcom/rpi-firmware/dist
firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
-sets="base etc comp games man misc modules text"
-setsdir=$obj/evbarm//media/evbarm/binary/sets/
-kerneldir=$src/sys/arch/evbarm/compile/RPI
-specialdirs="/kern /proc"
-
-swap=256
-extra=8 # spare space
-boot=112
-init=8
-
-size=0 # autocompute
-msdosid=12
-overhead=$(( ${swap} + ${extra} + ${init} + ${boot} ))
-
-tmp=/tmp/rpi.disklabel.$$
-
make_filesystems() {
-
- local asize=$(( ${newsize} * 1024 ))
- local swapsize=$(( ${swap} * 1024 ))
- local bootsize=$(( ${boot} * 1024 ))
-
- local bootoffset=$((${init} * 1024 ))
- local swapoffset=$(( ${bootoffset} + ${bootsize} ))
- local aoffset=$(( ${swapoffset} + ${swapsize} ))
-
- local totalsize=$(( ${asize} + ${swapsize} + ${bootsize} + ${bootoffset} ))
- local bps=512
- local spt=32
- local tpc=64
- local spc=2048
- local cylinders=$(( ${totalsize} / ${spc} ))
-
- cat > ${tmp} << EOF
-type: SCSI
Home |
Main Index |
Thread Index |
Old Index