Home | History | Annotate | Line # | Download | only in conf
arm64.conf revision 1.10
      1  1.10  jmcneill # $NetBSD: arm64.conf,v 1.10 2020/05/18 21:19:34 jmcneill Exp $
      2   1.1       ryo # ARM64 customization script used by mkimage
      3   1.1       ryo #
      4   1.1       ryo board=arm64
      5   1.1       ryo console=fb
      6   1.1       ryo resize=true
      7   1.1       ryo 
      8   1.1       ryo . ${DIR}/conf/evbarm.conf
      9   1.1       ryo 
     10   1.1       ryo kernel_GENERIC64="GENERIC64"
     11   1.1       ryo 
     12   1.1       ryo make_label() {
     13   1.1       ryo 	make_label_evbarm
     14   1.1       ryo }
     15   1.1       ryo 
     16   1.1       ryo make_fstab() {
     17   1.1       ryo 	make_fstab_evbarm
     18   1.1       ryo }
     19   1.1       ryo 
     20   1.1       ryo customize() {
     21   1.1       ryo 	customize_evbarm
     22   1.1       ryo 	cat >> "${mnt}/etc/rc.conf" << EOF
     23   1.1       ryo mdnsd=YES
     24   1.1       ryo devpubd=YES
     25   1.5  jmcneill wscons=\$(dev_exists wsdisplay0)
     26   1.5  jmcneill ec2_init=\$(dev_exists ena0)
     27   1.1       ryo EOF
     28   1.1       ryo }
     29   1.1       ryo 
     30   1.1       ryo populate_common() {
     31   1.5  jmcneill 	# Add EC2 init script
     32   1.5  jmcneill 	cp ${DIR}/files/ec2_init ${mnt}/etc/rc.d/ec2_init
     33   1.5  jmcneill 	echo "./etc/rc.d/ec2_init type=file uname=root gname=wheel mode=0555" \
     34   1.5  jmcneill 	    >> "$tmp/selected_sets"
     35   1.5  jmcneill 
     36   1.1       ryo 	# Rename kernel to netbsd.img
     37   1.1       ryo 	mv "${mnt}/boot/netbsd-${kernel_GENERIC64}.img" "${mnt}/boot/netbsd.img"
     38   1.4  jmcneill 
     39   1.4  jmcneill 	# Install EFI bootloader
     40   1.4  jmcneill 	mkdir -p "${mnt}/boot/EFI/BOOT"
     41   1.4  jmcneill 	cp "${release}/usr/mdec/bootaa64.efi" "${mnt}/boot/EFI/BOOT/bootaa64.efi"
     42   1.4  jmcneill 
     43   1.4  jmcneill 	# Install kernel to root of the FFS partition
     44   1.4  jmcneill 	${GZIP_CMD} -dc ${kernel}/netbsd-${kernel_GENERIC64}.gz > "${mnt}/netbsd"
     45   1.4  jmcneill 	echo "./netbsd type=file uname=root gname=wheel mode=0755" \
     46   1.4  jmcneill 	    >> "$tmp/selected_sets"
     47   1.1       ryo }
     48   1.1       ryo 
     49   1.2  jmcneill 
     50   1.1       ryo populate_rpi() {
     51   1.1       ryo 	firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
     52   1.8     skrll 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup4cd.dat fixup4.dat fixup_cd.dat fixup.dat start4cd.elf start4.elf start_cd.elf start.elf"
     53   1.1       ryo 
     54   1.1       ryo 	cat > "${mnt}/boot/cmdline.txt" << EOF
     55   1.1       ryo root=ld0a console=${console}
     56   1.1       ryo EOF
     57   1.1       ryo 
     58   1.9  jmcneill 	cat > "${mnt}/boot/cmdline-pi4.txt" << EOF
     59   1.9  jmcneill root=ld1a console=${console}
     60   1.9  jmcneill EOF
     61   1.9  jmcneill 
     62   1.1       ryo 	cat > "${mnt}/boot/config.txt" << EOF
     63   1.8     skrll #
     64   1.8     skrll upstream_kernel=1
     65   1.8     skrll #
     66   1.1       ryo arm_64bit=1
     67  1.10  jmcneill os_prefix=dtb/broadcom/
     68  1.10  jmcneill cmdline=../../cmdline.txt
     69  1.10  jmcneill kernel=/netbsd.img
     70   1.1       ryo kernel_address=0x200000
     71   1.1       ryo enable_uart=1
     72   1.1       ryo force_turbo=0
     73   1.9  jmcneill #
     74   1.9  jmcneill [pi4]
     75  1.10  jmcneill cmdline=../../cmdline-pi4.txt
     76   1.9  jmcneill #
     77   1.9  jmcneill [all]
     78   1.1       ryo EOF
     79   1.1       ryo 
     80   1.1       ryo 	echo "${bar} installing firmware files ${bar}"
     81   1.1       ryo 	(cd "${mnt}/boot" &&
     82   1.1       ryo 		for f in ${firmwarefiles}; do
     83   1.1       ryo 			echo " $f"
     84   1.1       ryo 			cp "${firmwaredir}/${f}" .
     85   1.1       ryo 		done
     86   1.1       ryo 	)
     87   1.1       ryo }
     88   1.1       ryo 
     89   1.1       ryo populate() {
     90   1.1       ryo 	echo "${bar} looking for kernel in ${kernel} ${bar}"
     91   1.1       ryo 	kernels=""
     92   1.1       ryo 	k="$kernel_GENERIC64"
     93   1.1       ryo 
     94   1.7     skrll 	# .img kernel
     95   1.1       ryo 	f="${kernel}/netbsd-${k}.img.gz"
     96   1.1       ryo 	test -f "${f}" && kernels="${kernels} ${f}"
     97   1.1       ryo 
     98   1.1       ryo 	# install files to /boot partition
     99   1.1       ryo 	for k in ${kernels}; do
    100   1.1       ryo 		tgt="$(basename ${k} | sed 's/\.gz$//')"
    101   1.1       ryo 		echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
    102   1.1       ryo 		case "${k}" in
    103   1.1       ryo 		*.gz)
    104   1.1       ryo 			${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
    105   1.1       ryo 			;;
    106   1.1       ryo 		*)
    107   1.1       ryo 			cp "${k}" "${mnt}/boot/${tgt}"
    108   1.1       ryo 			;;
    109   1.1       ryo 		esac ||
    110   1.1       ryo 			fail "Copy of ${k} to ${mnt}/boot/${tgt} failed"
    111   1.1       ryo 	done
    112   1.1       ryo 
    113   1.1       ryo 	# Board specific configuration
    114   1.1       ryo 	populate_rpi
    115   1.1       ryo 
    116   1.1       ryo 	# common configuration
    117   1.1       ryo 	populate_common
    118   1.1       ryo }
    119