Thu Nov 30 19:55:47 2017 UTC ()
Remove legacy awin kernels from image


(jmcneill)
diff -r1.20 -r1.21 src/distrib/utils/embedded/conf/armv7.conf

cvs diff -r1.20 -r1.21 src/distrib/utils/embedded/conf/armv7.conf (switch to unified diff)

--- src/distrib/utils/embedded/conf/armv7.conf 2017/11/28 02:56:44 1.20
+++ src/distrib/utils/embedded/conf/armv7.conf 2017/11/30 19:55:47 1.21
@@ -1,167 +1,161 @@ @@ -1,167 +1,161 @@
1# $NetBSD: armv7.conf,v 1.20 2017/11/28 02:56:44 kre Exp $ 1# $NetBSD: armv7.conf,v 1.21 2017/11/30 19:55:47 jmcneill Exp $
2# ARMv7 customization script used by mkimage 2# ARMv7 customization script used by mkimage
3# 3#
4board=armv7 4board=armv7
5console=fb 5console=fb
6resize=true 6resize=true
7 7
8. ${DIR}/conf/evbarm.conf 8. ${DIR}/conf/evbarm.conf
9 9
10kernels_beagle="BEAGLEBOARD BEAGLEBONE" 10kernels_beagle="BEAGLEBOARD BEAGLEBONE"
11kernels_awin="BPI CUBIEBOARD CUBIETRUCK" 
12kernels_rpi="RPI2" 11kernels_rpi="RPI2"
13kernels_amlogic="ODROID-C1" 12kernels_amlogic="ODROID-C1"
14kernels_tegra="TEGRA" 13kernels_tegra="TEGRA"
15kernels_sunxi="SUNXI" 14kernels_sunxi="SUNXI"
16 15
17make_label() { 16make_label() {
18 make_label_evbarm 17 make_label_evbarm
19} 18}
20 19
21make_fstab() { 20make_fstab() {
22 make_fstab_evbarm 21 make_fstab_evbarm
23} 22}
24 23
25customize() { 24customize() {
26 customize_evbarm 25 customize_evbarm
27 cat >> "${mnt}/etc/rc.conf" << EOF 26 cat >> "${mnt}/etc/rc.conf" << EOF
28mdnsd=YES 27mdnsd=YES
29wscons=YES 28wscons=YES
30devpubd=YES 29devpubd=YES
31EOF 30EOF
32} 31}
33 32
34populate_common() { 33populate_common() {
35 # Install boot script 34 # Install boot script
36 cp ${DIR}/files/armv7_boot.cmd ${mnt}/boot/boot.cmd 35 cp ${DIR}/files/armv7_boot.cmd ${mnt}/boot/boot.cmd
37 "${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/armv7 boot" "${mnt}/boot/boot.cmd" "${mnt}/boot/boot.scr" 36 "${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/armv7 boot" "${mnt}/boot/boot.cmd" "${mnt}/boot/boot.scr"
38} 37}
39 38
40populate_beagle() { 39populate_beagle() {
41 : 40 :
42} 41}
43 42
44populate_awin() { 
45 : 
46} 
47 
48populate_rpi() { 43populate_rpi() {
49 firmwaredir="${src}/external/broadcom/rpi-firmware/dist" 44 firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
50 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf" 45 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
51 46
52 # RPI2 kernel needs to be installed as kernel7.img 47 # RPI2 kernel needs to be installed as kernel7.img
53 if [ -f "${mnt}/boot/netbsd-RPI2.bin" ]; then 48 if [ -f "${mnt}/boot/netbsd-RPI2.bin" ]; then
54 echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}" 49 echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}"
55 mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img" 50 mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img"
56 51
57 cat > "${mnt}/boot/cmdline.txt" << EOF 52 cat > "${mnt}/boot/cmdline.txt" << EOF
58root=ld0a console=${console} 53root=ld0a console=${console}
59#fb=1280x1024 # to select a mode, otherwise try EDID 54#fb=1280x1024 # to select a mode, otherwise try EDID
60#fb=disable # to disable fb completely 55#fb=disable # to disable fb completely
61EOF 56EOF
62 57
63 cat > ${mnt}/boot/config.txt << EOF 58 cat > ${mnt}/boot/config.txt << EOF
64# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md 59# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
65enable_uart=1 60enable_uart=1
66force_turbo=0 61force_turbo=0
67EOF 62EOF
68 63
69 echo "${bar} installing firmware files ${bar}" 64 echo "${bar} installing firmware files ${bar}"
70 (cd "${mnt}/boot" && 65 (cd "${mnt}/boot" &&
71 for f in ${firmwarefiles}; do 66 for f in ${firmwarefiles}; do
72 echo " $f" 67 echo " $f"
73 cp "${firmwaredir}/${f}" . 68 cp "${firmwaredir}/${f}" .
74 done 69 done
75 ) 70 )
76 71
77 fi 72 fi
78 73
79 # 74 #
80 # If arm_freq is specified in config.txt, set CPU frequency 75 # If arm_freq is specified in config.txt, set CPU frequency
81 # to match at boot time. 76 # to match at boot time.
82 # 77 #
83 cp ${release}/etc/rc.local ${mnt}/etc/rc.local 78 cp ${release}/etc/rc.local ${mnt}/etc/rc.local
84 cat >> ${mnt}/etc/rc.local << EOF 79 cat >> ${mnt}/etc/rc.local << EOF
85if /sbin/sysctl -q machdep.cpu.frequency.max; then 80if /sbin/sysctl -q machdep.cpu.frequency.max; then
86 cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max) 81 cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
87 cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current) 82 cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)
88 if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then 83 if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then
89 /sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max 84 /sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max
90 fi 85 fi
91fi 86fi
92EOF 87EOF
93 echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \ 88 echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
94 >> "$tmp/selected_sets" 89 >> "$tmp/selected_sets"
95} 90}
96 91
97populate_amlogic() { 92populate_amlogic() {
98 odroidc1_kernelimg=netbsd-ODROID-C1.ub 93 odroidc1_kernelimg=netbsd-ODROID-C1.ub
99 94
100 # Create a boot.ini for Amlogic U-Boot 95 # Create a boot.ini for Amlogic U-Boot
101 cat >> "${mnt}/boot/boot.ini" << EOF 96 cat >> "${mnt}/boot/boot.ini" << EOF
102ODROIDC-UBOOT-CONFIG 97ODROIDC-UBOOT-CONFIG
103 98
104setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}" 99setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}"
105setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; bootm 0x21000000" 100setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; bootm 0x21000000"
106run bootcmd 101run bootcmd
107EOF 102EOF
108} 103}
109 104
110populate_sunxi() { 105populate_sunxi() {
111 : 106 :
112} 107}
113 108
114populate_tegra() { 109populate_tegra() {
115 : 110 :
116} 111}
117 112
118populate() { 113populate() {
119 echo "${bar} looking for kernels in ${kernel} ${bar}" 114 echo "${bar} looking for kernels in ${kernel} ${bar}"
120 kernels="" 115 kernels=""
121 # .ub kernels 116 # .ub kernels
122 for k in $kernels_beagle $kernels_awin $kernels_sunxi $kernels_amlogic $kernels_tegra; do 117 for k in $kernels_beagle $kernels_sunxi $kernels_amlogic $kernels_tegra; do
123 f="${kernel}/netbsd-${k}.ub.gz" 118 f="${kernel}/netbsd-${k}.ub.gz"
124 test -f "${f}" && kernels="${kernels} ${f}" 119 test -f "${f}" && kernels="${kernels} ${f}"
125 done 120 done
126 # .bin kernels 121 # .bin kernels
127 for k in $kernels_rpi; do 122 for k in $kernels_rpi; do
128 f="${kernel}/netbsd-${k}.bin.gz" 123 f="${kernel}/netbsd-${k}.bin.gz"
129 test -f "${f}" && kernels="${kernels} ${f}" 124 test -f "${f}" && kernels="${kernels} ${f}"
130 done 125 done
131 # .dtb files 126 # .dtb files
132 for k in $kernels_sunxi $kernels_tegra; do 127 for k in $kernels_sunxi $kernels_tegra; do
133 test -d "${KERNOBJDIR}/${k}" && \ 128 test -d "${KERNOBJDIR}/${k}" && \
134 dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)" || \ 129 dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)" || \
135 dtbs= 130 dtbs=
136 for dtb in $dtbs; do 131 for dtb in $dtbs; do
137 f="${kernel}/${dtb}.gz" 132 f="${kernel}/${dtb}.gz"
138 test -f "${f}" && kernels="${kernels} ${f}" 133 test -f "${f}" && kernels="${kernels} ${f}"
139 done 134 done
140 done 135 done
141 136
142 # install kernels to /boot partition 137 # install kernels to /boot partition
143 for k in ${kernels}; do 138 for k in ${kernels}; do
144 tgt="$(basename ${k} | sed 's/\.gz$//')" 139 tgt="$(basename ${k} | sed 's/\.gz$//')"
145 echo "${bar} installing ${k} to /boot/${tgt} ${bar}" 140 echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
146 case "${k}" in 141 case "${k}" in
147 *.gz) 142 *.gz)
148 ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}" 143 ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
149 ;; 144 ;;
150 *) 145 *)
151 cp "${k}" "${mnt}/boot/${tgt}" 146 cp "${k}" "${mnt}/boot/${tgt}"
152 ;; 147 ;;
153 esac || 148 esac ||
154 fail "Copy of ${k} to ${mnt}/boot/${tgt} failed" 149 fail "Copy of ${k} to ${mnt}/boot/${tgt} failed"
155 done 150 done
156 151
157 # board specific configuration 152 # board specific configuration
158 populate_beagle 153 populate_beagle
159 populate_awin 
160 populate_rpi 154 populate_rpi
161 populate_amlogic 155 populate_amlogic
162 populate_tegra 156 populate_tegra
163 populate_sunxi 157 populate_sunxi
164 158
165 # common configuration 159 # common configuration
166 populate_common 160 populate_common
167} 161}