# $NetBSD: rpi_inst.conf,v 1.8 2015/04/19 18:53:33 hubertf Exp $ # Raspberry Pi customization script used by mkimage # board=rpi_inst kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI_INSTALL.bin . ${DIR}/conf/evbarm.conf image=$HOME/${board}.img swap=8 extra=8 # spare space boot=112 init=8 size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 )) msdosid=12 make_label() { # compute all sizes in terms of sectors local totalsize=$(( ${newsize} * 1024 * 2 / 512 )) local swapsize=$(( ${swap} * 1024 )) local bootsize=$(( ${boot} * 1024 )) local bootoffset=$(( ${init} * 1024 )) local swapoffset=$(( ${bootoffset} + ${bootsize} )) local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} )) local aoffset=$(( ${swapoffset} + ${swapsize} )) local bps=512 local spt=32 local tpc=64 local spc=2048 local cylinders=$(( ${totalsize} / ${spc} )) cat << 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 } customize() { echo "${bar} creating directories ${bar}" mkdir ${mnt}/proc ${mnt}/kern } make_fstab() { : } firmwaredir=$src/external/broadcom/rpi-firmware/dist firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf" populate() { cat > ${mnt}/boot/cmdline.txt << EOF root=ld0a console=fb #fb=1280x1024 # to select a mode, otherwise try EDID #fb=disable # to disable fb completely EOF if [ ! -f ${kernel} ]; then echo ${PROG}: Missing ${kernel} 1>&2 exit 1 fi echo "${bar} installing kernel ${bar}" case ${kernel} in *.gz) ${GZIP_CMD} -dc ${kernel} > ${mnt}/boot/kernel.img ;; *) cp ${kernel} ${mnt}/boot/kernel.img ;; esac echo "${bar} installing firmware files ${bar}" (cd ${mnt}/boot && for f in ${firmwarefiles}; do echo " $f" cp ${firmwaredir}/${f} . done ) }