rpi_inst.conf revision 1.15
1# $NetBSD: rpi_inst.conf,v 1.15 2020/01/08 20:49:22 skrll Exp $ 2# Raspberry Pi customization script used by mkimage 3# 4 5board=rpi_inst 6kerneldir=${KERNOBJDIR}/RPI_INSTALL 7kernel=$kerneldir/netbsd-RPI_INSTALL.img 8 9. ${DIR}/conf/evbarm.conf 10 11image=$HOME/${board}.img 12 13swap=8 14extra=8 # spare space 15boot=112 16init=8 17 18size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 )) 19msdosid=14 20 21make_label() { 22 make_label_evbarm 23} 24 25customize() { 26 echo "${bar} creating directories ${bar}" 27 mkdir ${mnt}/proc ${mnt}/kern 28} 29 30make_fstab() { 31 : 32} 33 34firmwaredir=$src/external/broadcom/rpi-firmware/dist 35firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf" 36dtbs="$(${MAKE} -C ${kerneldir} -v DTB)" 37 38populate() { 39 cat > ${mnt}/boot/cmdline.txt << EOF 40root=ld0a console=fb 41#fb=1280x1024 # to select a mode, otherwise try EDID 42#fb=disable # to disable fb completely 43EOF 44 45 cat > ${mnt}/boot/config.txt << EOF 46# 47upstream_kernel=1 48# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md 49enable_uart=1 50force_turbo=0 51EOF 52 53 if [ ! -f ${kernel} ]; then 54 echo ${PROG}: Missing ${kernel} 1>&2 55 exit 1 56 fi 57 58 echo "${bar} installing kernel ${bar}" 59 case ${kernel} in 60 *.gz) 61 echo " ${kernel} uncompressed to kernel.img" 62 ${GZIP_CMD} -dc ${kernel} > ${mnt}/boot/kernel.img 63 ;; 64 *) 65 echo " ${kernel} copied" 66 cp ${kernel} ${mnt}/boot/kernel.img 67 ;; 68 esac || fail "copy of ${kernel} to ${mnt}/boot/kernel.img failed" 69 70 echo "${bar} installing firmware files ${bar}" 71 (cd ${mnt}/boot && 72 for f in ${firmwarefiles}; do 73 echo " $f" 74 cp ${firmwaredir}/${f} . || exit 1 75 done 76 for f in ${dtbs}; do 77 echo " $f" 78 cp ${kerneldir}/${f} . || exit 1 79 done 80 ) || fail "Copy of firmware to ${mnt}/boot failed" 81 82} 83