1 1.8 jmcneill # $NetBSD: evbarm.conf,v 1.8 2013/02/12 12:04:39 jmcneill Exp $ 2 1.1 christos # evbarm shared config 3 1.1 christos # 4 1.1 christos image=$HOME/${board}.img 5 1.1 christos 6 1.1 christos specialdirs="/kern /proc" 7 1.1 christos 8 1.1 christos swap=256 9 1.1 christos extra=8 # spare space 10 1.1 christos boot=112 11 1.1 christos init=8 12 1.1 christos 13 1.1 christos size=0 # autocompute 14 1.1 christos msdosid=12 15 1.1 christos 16 1.5 christos make_label_evbarm() { 17 1.3 skrll local totalsize=$(( ${newsize} * 1024 * 2 )) 18 1.1 christos local swapsize=$(( ${swap} * 1024 )) 19 1.1 christos local bootsize=$(( ${boot} * 1024 )) 20 1.1 christos 21 1.3 skrll local bootoffset=$(( ${init} * 1024 )) 22 1.1 christos local swapoffset=$(( ${bootoffset} + ${bootsize} )) 23 1.3 skrll 24 1.3 skrll local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} )) 25 1.1 christos local aoffset=$(( ${swapoffset} + ${swapsize} )) 26 1.1 christos 27 1.1 christos local bps=512 28 1.1 christos local spt=32 29 1.1 christos local tpc=64 30 1.1 christos local spc=2048 31 1.1 christos local cylinders=$(( ${totalsize} / ${spc} )) 32 1.1 christos 33 1.5 christos cat << EOF 34 1.1 christos type: SCSI 35 1.1 christos disk: STORAGE DEVICE 36 1.1 christos label: fictitious 37 1.1 christos flags: removable 38 1.1 christos bytes/sector: ${bps} 39 1.1 christos sectors/track: ${spt} 40 1.1 christos tracks/cylinder: ${tpc} 41 1.1 christos sectors/cylinder: ${spc} 42 1.1 christos cylinders: ${cylinders} 43 1.1 christos total sectors: ${totalsize} 44 1.1 christos rpm: 3600 45 1.1 christos interleave: 1 46 1.1 christos trackskew: 0 47 1.1 christos cylinderskew: 0 48 1.1 christos headswitch: 0 # microseconds 49 1.1 christos track-to-track seek: 0 # microseconds 50 1.1 christos drivedata: 0 51 1.1 christos 52 1.1 christos 8 partitions: 53 1.1 christos # size offset fstype [fsize bsize cpg/sgs] 54 1.1 christos a: ${asize} ${aoffset} 4.2BSD ${fsize} ${bsize} 0 # 55 1.1 christos b: ${swapsize} ${swapoffset} swap # 56 1.1 christos d: ${totalsize} 0 unused 0 0 # 57 1.1 christos e: ${bootsize} ${bootoffset} MSDOS # 58 1.1 christos EOF 59 1.1 christos } 60 1.1 christos 61 1.1 christos make_fstab_evbarm() { 62 1.5 christos cat > ${mnt}/etc/fstab << EOF 63 1.1 christos # NetBSD /etc/fstab 64 1.1 christos # See /usr/share/examples/fstab/ for more examples. 65 1.1 christos /dev/ld0a / ffs rw,log 1 1 66 1.1 christos /dev/ld0b none swap sw 0 0 67 1.1 christos /dev/ld0e /boot msdos rw 1 1 68 1.1 christos kernfs /kern kernfs rw 69 1.1 christos ptyfs /dev/pts ptyfs rw 70 1.1 christos procfs /proc procfs rw 71 1.1 christos EOF 72 1.1 christos } 73 1.1 christos 74 1.1 christos customize_evbarm() { 75 1.6 christos cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf 76 1.5 christos cat >> ${mnt}/etc/rc.conf << EOF 77 1.7 jmcneill rc_configured=YES 78 1.7 jmcneill hostname=${board} 79 1.1 christos sshd=YES 80 1.1 christos dhcpcd=YES 81 1.1 christos EOF 82 1.5 christos if [ ! -f ${release}/dev/MAKEDEV ]; then 83 1.5 christos echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2 84 1.1 christos exit 1 85 1.1 christos fi 86 1.1 christos echo "${bar} running MAKEDEV ${bar}" 87 1.5 christos (cd ${mnt}/dev && sh ${release}/dev/MAKEDEV all) 88 1.8 jmcneill 89 1.8 jmcneill echo "${bar} creating directories ${bar}" 90 1.8 jmcneill mkdir ${mnt}/proc ${mnt}/kern 91 1.1 christos } 92