rpi_inst.conf revision 1.8
1# $NetBSD: rpi_inst.conf,v 1.8 2015/04/19 18:53:33 hubertf Exp $ 2# Raspberry Pi customization script used by mkimage 3# 4 5board=rpi_inst 6kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI_INSTALL.bin 7 8. ${DIR}/conf/evbarm.conf 9 10image=$HOME/${board}.img 11 12swap=8 13extra=8 # spare space 14boot=112 15init=8 16 17size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 )) 18msdosid=12 19 20make_label() { 21 # compute all sizes in terms of sectors 22 local totalsize=$(( ${newsize} * 1024 * 2 / 512 )) 23 24 local swapsize=$(( ${swap} * 1024 )) 25 local bootsize=$(( ${boot} * 1024 )) 26 27 local bootoffset=$(( ${init} * 1024 )) 28 local swapoffset=$(( ${bootoffset} + ${bootsize} )) 29 30 local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} )) 31 local aoffset=$(( ${swapoffset} + ${swapsize} )) 32 33 local bps=512 34 local spt=32 35 local tpc=64 36 local spc=2048 37 local cylinders=$(( ${totalsize} / ${spc} )) 38 39 cat << EOF 40type: SCSI 41disk: STORAGE DEVICE 42label: fictitious 43flags: removable 44bytes/sector: ${bps} 45sectors/track: ${spt} 46tracks/cylinder: ${tpc} 47sectors/cylinder: ${spc} 48cylinders: ${cylinders} 49total sectors: ${totalsize} 50rpm: 3600 51interleave: 1 52trackskew: 0 53cylinderskew: 0 54headswitch: 0 # microseconds 55track-to-track seek: 0 # microseconds 56drivedata: 0 57 588 partitions: 59# size offset fstype [fsize bsize cpg/sgs] 60 a: ${asize} ${aoffset} 4.2BSD ${fsize} ${bsize} 0 # 61 b: ${swapsize} ${swapoffset} swap # 62 d: ${totalsize} 0 unused 0 0 # 63 e: ${bootsize} ${bootoffset} MSDOS # 64EOF 65} 66 67customize() { 68 echo "${bar} creating directories ${bar}" 69 mkdir ${mnt}/proc ${mnt}/kern 70} 71 72make_fstab() { 73 : 74} 75 76firmwaredir=$src/external/broadcom/rpi-firmware/dist 77firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf" 78 79populate() { 80 cat > ${mnt}/boot/cmdline.txt << EOF 81root=ld0a console=fb 82#fb=1280x1024 # to select a mode, otherwise try EDID 83#fb=disable # to disable fb completely 84EOF 85 if [ ! -f ${kernel} ]; then 86 echo ${PROG}: Missing ${kernel} 1>&2 87 exit 1 88 fi 89 90 echo "${bar} installing kernel ${bar}" 91 case ${kernel} in 92 *.gz) 93 ${GZIP_CMD} -dc ${kernel} > ${mnt}/boot/kernel.img 94 ;; 95 *) 96 cp ${kernel} ${mnt}/boot/kernel.img 97 ;; 98 esac 99 100 echo "${bar} installing firmware files ${bar}" 101 (cd ${mnt}/boot && 102 for f in ${firmwarefiles}; do 103 echo " $f" 104 cp ${firmwaredir}/${f} . 105 done 106 ) 107 108} 109