1# $NetBSD: rpi_inst.conf,v 1.19 2022/11/19 09:19:27 yamt 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 15init=8 16boot=$(( 192 - ${init} )) 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 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" 36 37populate() { 38 cat > ${mnt}/boot/cmdline.txt << EOF 39root=ld0a console=fb 40#fb=1280x1024 # to select a mode, otherwise try EDID 41#fb=disable # to disable fb completely 42EOF 43 44 cat > ${mnt}/boot/config.txt << EOF 45# 46upstream_kernel=1 47os_prefix=dtb/ 48cmdline=../cmdline.txt 49kernel=/kernel.img 50# UART settings, https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-uarts 51enable_uart=1 52force_turbo=0 53EOF 54 55 if [ ! -f ${kernel} ]; then 56 echo ${PROG}: Missing ${kernel} 1>&2 57 exit 1 58 fi 59 60 echo "${bar} installing kernel ${bar}" 61 case ${kernel} in 62 *.gz) 63 echo " ${kernel} uncompressed to kernel.img" 64 ${GZIP_CMD} -dc ${kernel} > ${mnt}/boot/kernel.img 65 ;; 66 *) 67 echo " ${kernel} copied" 68 cp ${kernel} ${mnt}/boot/kernel.img 69 ;; 70 esac || fail "copy of ${kernel} to ${mnt}/boot/kernel.img failed" 71 72 echo "${bar} installing firmware files ${bar}" 73 (cd ${mnt}/boot && 74 for f in ${firmwarefiles}; do 75 echo " $f" 76 cp ${firmwaredir}/${f} . || exit 1 77 done 78 ) || fail "Copy of firmware to ${mnt}/boot failed" 79 80} 81