Merge ~alfonsosanchezbeato/ubuntu/+source/flash-kernel:kria-support into ~alfonsosanchezbeato/ubuntu/+source/flash-kernel:applied/ubuntu/focal-updates
- Git
- lp:~alfonsosanchezbeato/ubuntu/+source/flash-kernel
- kria-support
- Merge into applied/ubuntu/focal-updates
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Alfonso Sanchez-Beato | ||||
Proposed branch: | ~alfonsosanchezbeato/ubuntu/+source/flash-kernel:kria-support | ||||
Merge into: | ~alfonsosanchezbeato/ubuntu/+source/flash-kernel:applied/ubuntu/focal-updates | ||||
Diff against target: |
497 lines (+360/-31) 9 files modified
README (+9/-0) bootscript/arm64/bootscr.zynqmp (+119/-0) db/all.db (+36/-0) debian/changelog (+12/-0) debian/rules (+7/-0) functions (+64/-30) its/arm64/image-kria.its (+62/-0) its/arm64/image-zcu.its (+50/-0) test_db (+1/-1) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alfonso Sanchez-Beato | Pending | ||
Review via email: mp+403942@code.launchpad.net |
Commit message
Just for review
Description of the change
Just for review
- 88b9115... by Alfonso Sanchez-Beato
-
Move .its files to /usr/share/
flash-kernel/ its The .its files are static data, so move them from
/etc/flash-kernel/ its/ to /usr/share/ flash-kernel/ its/ - a8806ca... by Alfonso Sanchez-Beato
-
Remove Mkimage-FIT-Options field
It was not really required for Kria, and also it is not clear it in
general required to generate a FIT image. - 7d319ee... by Alfonso Sanchez-Beato
-
Remove Mkimage-FIT-Options also from test
- 54e58e7... by Alfonso Sanchez-Beato
-
Make sure temp FIT file lives in same filesystem as final
So mv can be "more atomic".
- 6c1c8c3... by Alfonso Sanchez-Beato
-
Remove fit method and make it part of the generic method instead
- aeb8973... by Alfonso Sanchez-Beato
-
Add DTB-Install field
DTB-Install tells us whether to copy the dtb to the /boot/ folder or
not. It is introduced because some times this is not really needed,
for instance FIT images usually include the dtb inside. - bdb6bc0... by Alfonso Sanchez-Beato
-
Add support for ZCU* boards
Loïc Minier (lool) wrote : | # |
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
We need the dtb-id, as we are putting it inside the its file (by replacing @@DEVICE_
- b6604b1... by Alfonso Sanchez-Beato
-
Remove unneeded DTB-Id in ZCU boards
- 2b1a6f9... by Alfonso Sanchez-Beato
-
Remove DTB-Install from the ZCU boards (no dtb)
Loïc Minier (lool) wrote : | # |
Oh wow, so this overall looks really good now; the only small thing that disturbs me a little bit is the whole dtb-install field / dtb-is use is just for that one board and related to the fact the its / fit generation requires the file to be copied to the tmpdir because it needs to be in the same dir; I don't know if there's an elegant way to avoid this forcing the creation of a new database field
- f85495e... by Alfonso Sanchez-Beato
-
Remove DTB-Install option
Try to avoid adding a new option. For the Kria, just hard-code dtb in
the its file for the moment and do not use DTB-Id.
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
This is now in the debian package. Closing this MP as it was opened just for discussion.
Unmerged commits
- f85495e... by Alfonso Sanchez-Beato
-
Remove DTB-Install option
Try to avoid adding a new option. For the Kria, just hard-code dtb in
the its file for the moment and do not use DTB-Id. - 2b1a6f9... by Alfonso Sanchez-Beato
-
Remove DTB-Install from the ZCU boards (no dtb)
- b6604b1... by Alfonso Sanchez-Beato
-
Remove unneeded DTB-Id in ZCU boards
- bdb6bc0... by Alfonso Sanchez-Beato
-
Add support for ZCU* boards
- aeb8973... by Alfonso Sanchez-Beato
-
Add DTB-Install field
DTB-Install tells us whether to copy the dtb to the /boot/ folder or
not. It is introduced because some times this is not really needed,
for instance FIT images usually include the dtb inside. - 6c1c8c3... by Alfonso Sanchez-Beato
-
Remove fit method and make it part of the generic method instead
- 54e58e7... by Alfonso Sanchez-Beato
-
Make sure temp FIT file lives in same filesystem as final
So mv can be "more atomic".
- 7d319ee... by Alfonso Sanchez-Beato
-
Remove Mkimage-FIT-Options also from test
- a8806ca... by Alfonso Sanchez-Beato
-
Remove Mkimage-FIT-Options field
It was not really required for Kria, and also it is not clear it in
general required to generate a FIT image. - 88b9115... by Alfonso Sanchez-Beato
-
Move .its files to /usr/share/
flash-kernel/ its The .its files are static data, so move them from
/etc/flash-kernel/ its/ to /usr/share/ flash-kernel/ its/
Preview Diff
1 | diff --git a/README b/README | |||
2 | index 5ffeca0..59151d1 100644 | |||
3 | --- a/README | |||
4 | +++ b/README | |||
5 | @@ -136,6 +136,15 @@ The supported fields are: | |||
6 | 136 | kernel, initrd and U-Boot script; Boot-Kernel-Path, Boot-Initrd-Path and | 136 | kernel, initrd and U-Boot script; Boot-Kernel-Path, Boot-Initrd-Path and |
7 | 137 | Boot-Script-Path are then taken relative to this boot device | 137 | Boot-Script-Path are then taken relative to this boot device |
8 | 138 | 138 | ||
9 | 139 | * Boot-FIT-Path: (optional) when present, a FIT image will be created. It | ||
10 | 140 | contains the path where the FIT image will be written. | ||
11 | 141 | |||
12 | 142 | * Boot-ITS-File-Name: (optional) name of the ITS file used to describe the | ||
13 | 143 | content of the FIT image when a FIT image is being created. | ||
14 | 144 | @@LINUX_IMAGE_FILE@@, @@INITRD_FILE@@, and @@DEVICE_TREE_FILE@@ strings in | ||
15 | 145 | the file will be replaced by the path to the kernel, initrd, and device | ||
16 | 146 | tree blob respectively. | ||
17 | 147 | |||
18 | 139 | 148 | ||
19 | 140 | Configuration | 149 | Configuration |
20 | 141 | - - - - - - - | 150 | - - - - - - - |
21 | diff --git a/bootscript/arm64/bootscr.zynqmp b/bootscript/arm64/bootscr.zynqmp | |||
22 | 142 | new file mode 100644 | 151 | new file mode 100644 |
23 | index 0000000..3fd3979 | |||
24 | --- /dev/null | |||
25 | +++ b/bootscript/arm64/bootscr.zynqmp | |||
26 | @@ -0,0 +1,119 @@ | |||
27 | 1 | # This is a boot script for U-Boot | ||
28 | 2 | # Generate boot.scr: | ||
29 | 3 | # mkimage -c none -A arm -T script -d boot.cmd boot.scr | ||
30 | 4 | # For initrd, when using a file override: | ||
31 | 5 | # mkimage -A arm -O linux -T ramdisk -d initrd.img rootfs.cpio.gz.u-boot | ||
32 | 6 | # Kernel "Image" file must be of EFI type: | ||
33 | 7 | # - Get vmlinuz from Ubuntu rootfs and uncompress | ||
34 | 8 | # system.dtb is a normal dtb file | ||
35 | 9 | # | ||
36 | 10 | ################ | ||
37 | 11 | |||
38 | 12 | @@UBOOT_ENV_EXTRA@@ | ||
39 | 13 | |||
40 | 14 | for boot_target in ${boot_targets}; | ||
41 | 15 | do | ||
42 | 16 | if test "${boot_target}" = "jtag" ; then | ||
43 | 17 | booti 0x00200000 0x04000000 0x00100000 | ||
44 | 18 | exit; | ||
45 | 19 | fi | ||
46 | 20 | if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then | ||
47 | 21 | # Load alternative bitstream if present | ||
48 | 22 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.bit; then | ||
49 | 23 | echo "Loading alternative bitstream" | ||
50 | 24 | load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 system.bit | ||
51 | 25 | fpga load 0 0x10000000 $filesize | ||
52 | 26 | fi | ||
53 | 27 | # Load different cma on zynqmp boards | ||
54 | 28 | setenv bootargs "earlycon console=ttyPS0,115200 console=tty1 root=/dev/mmcblk0p2 uio_pdrv_genirq.of_id=generic-uio" | ||
55 | 29 | fdt addr $fdtcontroladdr | ||
56 | 30 | # For ZCU: ZynqMP ZCU10* Rev* | ||
57 | 31 | # For Kria: ZynqMP K26 Rev* | ||
58 | 32 | fdt get value model_test / model | ||
59 | 33 | if setexpr model_test gsub '.*104.*' 104; then | ||
60 | 34 | setenv bootargs "${bootargs} cma=700M" | ||
61 | 35 | elif setexpr model_test gsub '.*106.*' 106; then | ||
62 | 36 | setenv bootargs "${bootargs} cma=1200M" | ||
63 | 37 | else | ||
64 | 38 | setenv bootargs "${bootargs} cma=1000M" | ||
65 | 39 | fi | ||
66 | 40 | # Get custom values from /etc/default/u-boot-xlnx | ||
67 | 41 | setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@" | ||
68 | 42 | img_addr=- | ||
69 | 43 | initrd_addr=- | ||
70 | 44 | |||
71 | 45 | # Take dtb from boot image unless Kria, where we take from FIT | ||
72 | 46 | if setexpr model_test gsub '.*K26.*' K26; then | ||
73 | 47 | dtb_addr=0x10000000 | ||
74 | 48 | else | ||
75 | 49 | dtb_addr=$fdtcontroladdr | ||
76 | 50 | fi | ||
77 | 51 | |||
78 | 52 | if test -e ${devtype} ${devnum}:${distro_bootpart} /Image; then | ||
79 | 53 | echo "Loading Image" | ||
80 | 54 | img_addr=0x00200000 | ||
81 | 55 | load ${devtype} ${devnum}:${distro_bootpart} ${img_addr} Image; | ||
82 | 56 | fi | ||
83 | 57 | if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then | ||
84 | 58 | echo "Loading system.dtb" | ||
85 | 59 | dtb_addr=0x70000000 | ||
86 | 60 | load ${devtype} ${devnum}:${distro_bootpart} ${dtb_addr} system.dtb; | ||
87 | 61 | fi | ||
88 | 62 | if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then | ||
89 | 63 | echo "Loading rootfs.cpio.gz.u-boot" | ||
90 | 64 | initrd_addr=0x04000000 | ||
91 | 65 | load ${devtype} ${devnum}:${distro_bootpart} ${initrd_addr} rootfs.cpio.gz.u-boot | ||
92 | 66 | fi | ||
93 | 67 | |||
94 | 68 | @@UBOOT_PREBOOT_EXTRA@@ | ||
95 | 69 | |||
96 | 70 | if test $img_addr = "-" || test $initrd_addr = "-"; then | ||
97 | 71 | if test -e ${devtype} ${devnum}:${distro_bootpart} /image.fit; then | ||
98 | 72 | echo "Loading image.fit" | ||
99 | 73 | load ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.fit; | ||
100 | 74 | if test $img_addr = "-"; then | ||
101 | 75 | img_addr=0x10000000 | ||
102 | 76 | fi | ||
103 | 77 | if test $initrd_addr = "-"; then | ||
104 | 78 | initrd_addr=0x10000000 | ||
105 | 79 | fi | ||
106 | 80 | fi | ||
107 | 81 | fi | ||
108 | 82 | if test "${img_addr}" -eq "0x10000000"; then | ||
109 | 83 | bootm ${img_addr} ${initrd_addr} ${dtb_addr} | ||
110 | 84 | elif test "${img_addr}" -eq "0x00200000"; then | ||
111 | 85 | booti ${img_addr} ${initrd_addr} ${dtb_addr} | ||
112 | 86 | fi | ||
113 | 87 | echo "No kernel found in ${devtype}" | ||
114 | 88 | exit; | ||
115 | 89 | fi | ||
116 | 90 | if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then | ||
117 | 91 | sf probe 0 0 0; | ||
118 | 92 | if test "image.fit" = "image.fit"; then | ||
119 | 93 | sf read 0x10000000 0xF00000 0x6400000; | ||
120 | 94 | bootm 0x10000000; | ||
121 | 95 | exit; | ||
122 | 96 | fi | ||
123 | 97 | if test "image.fit" = "Image"; then | ||
124 | 98 | sf read 0x00200000 0xF00000 0x1D00000; | ||
125 | 99 | sf read 0x04000000 0x4000000 0x4000000 | ||
126 | 100 | booti 0x00200000 0x04000000 0x00100000 | ||
127 | 101 | exit; | ||
128 | 102 | fi | ||
129 | 103 | exit; | ||
130 | 104 | fi | ||
131 | 105 | if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then | ||
132 | 106 | nand info | ||
133 | 107 | if test "image.fit" = "image.fit"; then | ||
134 | 108 | nand read 0x10000000 0x4100000 0x6400000; | ||
135 | 109 | bootm 0x10000000; | ||
136 | 110 | exit; | ||
137 | 111 | fi | ||
138 | 112 | if test "image.fit" = "Image"; then | ||
139 | 113 | nand read 0x00200000 0x4100000 0x3200000; | ||
140 | 114 | nand read 0x04000000 0x7800000 0x3200000; | ||
141 | 115 | booti 0x00200000 0x04000000 0x00100000 | ||
142 | 116 | exit; | ||
143 | 117 | fi | ||
144 | 118 | fi | ||
145 | 119 | done | ||
146 | diff --git a/db/all.db b/db/all.db | |||
147 | index b7212e5..5b46cea 100644 | |||
148 | --- a/db/all.db | |||
149 | +++ b/db/all.db | |||
150 | @@ -2164,3 +2164,39 @@ Boot-Script-Path: /boot/boot.scr | |||
151 | 2164 | DTB-Id: sun6i-a31s-yones-toptech-bs1078-v2.dtb | 2164 | DTB-Id: sun6i-a31s-yones-toptech-bs1078-v2.dtb |
152 | 2165 | U-Boot-Script-Name: bootscr.sunxi | 2165 | U-Boot-Script-Name: bootscr.sunxi |
153 | 2166 | Required-Packages: u-boot-tools | 2166 | Required-Packages: u-boot-tools |
154 | 2167 | |||
155 | 2168 | Machine: ZynqMP *K26* | ||
156 | 2169 | Kernel-Flavors: xilinx-zynqmp | ||
157 | 2170 | Method: generic | ||
158 | 2171 | Boot-Script-Path: /boot/firmware/boot.scr.uimg | ||
159 | 2172 | U-Boot-Script-Name: bootscr.zynqmp | ||
160 | 2173 | Boot-FIT-Path: /boot/firmware/image.fit | ||
161 | 2174 | Boot-ITS-File-Name: image-kria.its | ||
162 | 2175 | Required-Packages: u-boot-tools xlnx-kria-firmware | ||
163 | 2176 | |||
164 | 2177 | Machine: ZynqMP ZCU102* | ||
165 | 2178 | Kernel-Flavors: xilinx-zynqmp | ||
166 | 2179 | Method: generic | ||
167 | 2180 | Boot-Script-Path: /boot/firmware/boot.scr.uimg | ||
168 | 2181 | U-Boot-Script-Name: bootscr.zynqmp | ||
169 | 2182 | Boot-FIT-Path: /boot/firmware/image.fit | ||
170 | 2183 | Boot-ITS-File-Name: image-zcu.its | ||
171 | 2184 | Required-Packages: u-boot-tools xlnx-firmware | ||
172 | 2185 | |||
173 | 2186 | Machine: ZynqMP ZCU104* | ||
174 | 2187 | Kernel-Flavors: xilinx-zynqmp | ||
175 | 2188 | Method: generic | ||
176 | 2189 | Boot-Script-Path: /boot/firmware/boot.scr.uimg | ||
177 | 2190 | U-Boot-Script-Name: bootscr.zynqmp | ||
178 | 2191 | Boot-FIT-Path: /boot/firmware/image.fit | ||
179 | 2192 | Boot-ITS-File-Name: image-zcu.its | ||
180 | 2193 | Required-Packages: u-boot-tools xlnx-firmware | ||
181 | 2194 | |||
182 | 2195 | Machine: ZynqMP ZCU106* | ||
183 | 2196 | Kernel-Flavors: xilinx-zynqmp | ||
184 | 2197 | Method: generic | ||
185 | 2198 | Boot-Script-Path: /boot/firmware/boot.scr.uimg | ||
186 | 2199 | U-Boot-Script-Name: bootscr.zynqmp | ||
187 | 2200 | Boot-FIT-Path: /boot/firmware/image.fit | ||
188 | 2201 | Boot-ITS-File-Name: image-zcu.its | ||
189 | 2202 | Required-Packages: u-boot-tools xlnx-firmware | ||
190 | diff --git a/debian/changelog b/debian/changelog | |||
191 | index 4dc8258..693f87a 100644 | |||
192 | --- a/debian/changelog | |||
193 | +++ b/debian/changelog | |||
194 | @@ -1,3 +1,15 @@ | |||
195 | 1 | flash-kernel (3.103ubuntu1~20.04.1test2) focal; urgency=medium | ||
196 | 2 | |||
197 | 3 | * Update dtb path to the one from xlnx-kria-firmware focal | ||
198 | 4 | |||
199 | 5 | -- Alfonso Sanchez-Beato (email Canonical) <alfonso.sanchez-beato@canonical.com> Tue, 08 Jun 2021 11:51:16 +0200 | ||
200 | 6 | |||
201 | 7 | flash-kernel (3.103ubuntu1~20.04.1test1) focal; urgency=medium | ||
202 | 8 | |||
203 | 9 | * Add support for Kria SOM devices | ||
204 | 10 | |||
205 | 11 | -- Alfonso Sanchez-Beato (email Canonical) <alfonso.sanchez-beato@canonical.com> Mon, 07 Jun 2021 17:50:21 +0200 | ||
206 | 12 | |||
207 | 1 | flash-kernel (3.103ubuntu1~20.04.1) focal; urgency=medium | 13 | flash-kernel (3.103ubuntu1~20.04.1) focal; urgency=medium |
208 | 2 | 14 | ||
209 | 3 | * Backport latest upstream version to groovy (LP: #1904890) | 15 | * Backport latest upstream version to groovy (LP: #1904890) |
210 | diff --git a/debian/rules b/debian/rules | |||
211 | index 8913ca0..d6f6e1e 100755 | |||
212 | --- a/debian/rules | |||
213 | +++ b/debian/rules | |||
214 | @@ -27,6 +27,13 @@ ifeq (armhf,$(DEB_HOST_ARCH)) | |||
215 | 27 | debian/flash-kernel/etc/flash-kernel/bootscript/ | 27 | debian/flash-kernel/etc/flash-kernel/bootscript/ |
216 | 28 | endif | 28 | endif |
217 | 29 | 29 | ||
218 | 30 | install -m0755 -p -d debian/flash-kernel/usr/share/flash-kernel/its | ||
219 | 31 | set -ex ; for arch in all $(DEB_HOST_ARCH) ; do \ | ||
220 | 32 | [ -d its/$${arch} ] || continue ; \ | ||
221 | 33 | install -m0644 its/$${arch}/* \ | ||
222 | 34 | debian/flash-kernel/usr/share/flash-kernel/its/ ; \ | ||
223 | 35 | done | ||
224 | 36 | |||
225 | 30 | dh_auto_install | 37 | dh_auto_install |
226 | 31 | 38 | ||
227 | 32 | override_dh_auto_clean: | 39 | override_dh_auto_clean: |
228 | diff --git a/functions b/functions | |||
229 | index 1a4debd..ddc9597 100644 | |||
230 | --- a/functions | |||
231 | +++ b/functions | |||
232 | @@ -20,6 +20,7 @@ | |||
233 | 20 | # USA. | 20 | # USA. |
234 | 21 | 21 | ||
235 | 22 | BOOTSCRIPTS_DIR="${FK_CHECKOUT:-/etc/flash-kernel}/bootscript" | 22 | BOOTSCRIPTS_DIR="${FK_CHECKOUT:-/etc/flash-kernel}/bootscript" |
236 | 23 | ITSFILES_DIR="${FK_CHECKOUT:-/usr/share/flash-kernel}/its" | ||
237 | 23 | FK_ETC_MACHINE="${FK_ETC_MACHINE:-/etc/flash-kernel/machine}" | 24 | FK_ETC_MACHINE="${FK_ETC_MACHINE:-/etc/flash-kernel/machine}" |
238 | 24 | FK_DEFAULTS="${FK_DEFAULTS:-/etc/default/flash-kernel}" | 25 | FK_DEFAULTS="${FK_DEFAULTS:-/etc/default/flash-kernel}" |
239 | 25 | PROC_CPUINFO="${FK_PROC_CPUINFO:-/proc/cpuinfo}" | 26 | PROC_CPUINFO="${FK_PROC_CPUINFO:-/proc/cpuinfo}" |
240 | @@ -571,6 +572,58 @@ mkimage_multi() { | |||
241 | 571 | echo "done." >&2 | 572 | echo "done." >&2 |
242 | 572 | } | 573 | } |
243 | 573 | 574 | ||
244 | 575 | mkimage_fit() { | ||
245 | 576 | local image_its="$1" | ||
246 | 577 | local image_fit="$2" | ||
247 | 578 | local kernel_file="$3" | ||
248 | 579 | local initrd_file="$4" | ||
249 | 580 | local dtb_file="$5" | ||
250 | 581 | |||
251 | 582 | local its_tmp="$tmpdir/image.its" | ||
252 | 583 | |||
253 | 584 | sed -e "s#@@LINUX_IMAGE_FILE@@#$kernel_file#g" \ | ||
254 | 585 | -e "s#@@INITRD_FILE@@#$initrd_file#g" \ | ||
255 | 586 | -e "s#@@DEVICE_TREE_FILE@@#$dtb_file#g" \ | ||
256 | 587 | < "$ITSFILES_DIR/$image_its" > "$its_tmp" | ||
257 | 588 | |||
258 | 589 | printf "Generating u-boot image..." >&2 | ||
259 | 590 | mkimage -D "-I dts -O dtb" -f "$its_tmp" "$image_fit" >&2 1>/dev/null | ||
260 | 591 | echo " done." >&2 | ||
261 | 592 | } | ||
262 | 593 | |||
263 | 594 | create_boot_script() { | ||
264 | 595 | case $usname in | ||
265 | 596 | bootscr*) | ||
266 | 597 | boot_script_path="$boot_mnt_dir/$boot_script_path" | ||
267 | 598 | boot_script="$tmpdir/bootscript" | ||
268 | 599 | for script in $usname ; do | ||
269 | 600 | echo "\n#\n# flash-kernel: $script\n#\n" >> "$boot_script" | ||
270 | 601 | cat "$BOOTSCRIPTS_DIR/$script" >> "$boot_script" | ||
271 | 602 | done | ||
272 | 603 | mkimage_script "$usaddr" "boot script" "$boot_script" \ | ||
273 | 604 | "$tmpdir/boot.scr" | ||
274 | 605 | boot_script="$tmpdir/boot.scr" | ||
275 | 606 | backup_and_install "$boot_script" "$boot_script_path" | ||
276 | 607 | ;; | ||
277 | 608 | uEnvtxt*) | ||
278 | 609 | VOLID=${VOLID:-"$(get_root_uuid)"} | ||
279 | 610 | boot_script_in="$BOOTSCRIPTS_DIR/$usname" | ||
280 | 611 | boot_script="$boot_mnt_dir/$usname" | ||
281 | 612 | cp $boot_script_in $boot_script | ||
282 | 613 | |||
283 | 614 | boot_script_path="$boot_mnt_dir/uEnv.txt" | ||
284 | 615 | boot_script_env="$boot_mnt_dir/preEnv.txt" | ||
285 | 616 | env_script="$tmpdir/preEnv.txt" | ||
286 | 617 | |||
287 | 618 | [ -e /etc/default/flash-kernel ] && . /etc/default/flash-kernel | ||
288 | 619 | echo "bootargs=ro $(LINUX_KERNEL_CMDLINE) root=UUID=$VOLID" > $env_script | ||
289 | 620 | |||
290 | 621 | backup_and_install "$env_script" "$boot_script_env" | ||
291 | 622 | backup_and_install "$boot_script" "$boot_script_path" | ||
292 | 623 | ;; | ||
293 | 624 | esac | ||
294 | 625 | } | ||
295 | 626 | |||
296 | 574 | # Return a nonempty string *unless* NO_CREATE_DOT_BAK_FILES is set. | 627 | # Return a nonempty string *unless* NO_CREATE_DOT_BAK_FILES is set. |
297 | 575 | get_dot_bak_preference() { | 628 | get_dot_bak_preference() { |
298 | 576 | . ${FK_DEFAULTS} | 629 | . ${FK_DEFAULTS} |
299 | @@ -969,6 +1022,8 @@ boot_initrd_path_version="$(get_machine_field "$machine" "Boot-Initrd-Path-Versi | |||
300 | 969 | boot_script_path="$(get_machine_field "$machine" "Boot-Script-Path")" || : | 1022 | boot_script_path="$(get_machine_field "$machine" "Boot-Script-Path")" || : |
301 | 970 | boot_dtb_path="$(get_machine_field "$machine" "Boot-DTB-Path")" || : | 1023 | boot_dtb_path="$(get_machine_field "$machine" "Boot-DTB-Path")" || : |
302 | 971 | boot_dtb_path_version="$(get_machine_field "$machine" "Boot-DTB-Path-Version")" || : | 1024 | boot_dtb_path_version="$(get_machine_field "$machine" "Boot-DTB-Path-Version")" || : |
303 | 1025 | boot_fit_path="$(get_machine_field "$machine" "Boot-FIT-Path")" || : | ||
304 | 1026 | boot_its_file_name="$(get_machine_field "$machine" "Boot-ITS-File-Name")" || : | ||
305 | 972 | boot_multi_path="$(get_machine_field "$machine" "Boot-Multi-Path")" || : | 1027 | boot_multi_path="$(get_machine_field "$machine" "Boot-Multi-Path")" || : |
306 | 973 | android_boot_device="$(get_machine_field "$machine" "Android-Boot-Device")" || : | 1028 | android_boot_device="$(get_machine_field "$machine" "Android-Boot-Device")" || : |
307 | 974 | android_skip_initrd="$(get_machine_field "$machine" "Android-Skip-Initrd")" || : | 1029 | android_skip_initrd="$(get_machine_field "$machine" "Android-Skip-Initrd")" || : |
308 | @@ -1091,6 +1146,14 @@ case "$method" in | |||
309 | 1091 | "$tmpdir/uImage" | 1146 | "$tmpdir/uImage" |
310 | 1092 | rm -f "$tmpdir/kernel" | 1147 | rm -f "$tmpdir/kernel" |
311 | 1093 | fi | 1148 | fi |
312 | 1149 | if [ -n "$boot_fit_path" ]; then | ||
313 | 1150 | [ -n "$ifile" ] || error "Initrd required for FIT method" | ||
314 | 1151 | # Write tmp file in same filesystem as final destination | ||
315 | 1152 | fit_tmp="$boot_fit_path".tmp | ||
316 | 1153 | mkimage_fit "$boot_its_file_name" "$fit_tmp" \ | ||
317 | 1154 | "$kfile" "$ifile" "$(find_dtb_file)" | ||
318 | 1155 | backup_and_install "$fit_tmp" "$boot_fit_path" | ||
319 | 1156 | fi | ||
320 | 1094 | if [ -n "$boot_device" ]; then | 1157 | if [ -n "$boot_device" ]; then |
321 | 1095 | check_block_dev "$boot_device" | 1158 | check_block_dev "$boot_device" |
322 | 1096 | echo "Will use $boot_device as boot device." >&2 | 1159 | echo "Will use $boot_device as boot device." >&2 |
323 | @@ -1146,36 +1209,7 @@ case "$method" in | |||
324 | 1146 | rm -f "$tmpdir/uInitrd" | 1209 | rm -f "$tmpdir/uInitrd" |
325 | 1147 | fi | 1210 | fi |
326 | 1148 | if [ -n "$boot_script_path" ]; then | 1211 | if [ -n "$boot_script_path" ]; then |
357 | 1149 | case $usname in | 1212 | create_boot_script |
328 | 1150 | bootscr*) | ||
329 | 1151 | boot_script_path="$boot_mnt_dir/$boot_script_path" | ||
330 | 1152 | boot_script="$tmpdir/bootscript" | ||
331 | 1153 | for script in $usname ; do | ||
332 | 1154 | echo "\n#\n# flash-kernel: $script\n#\n" >> "$boot_script" | ||
333 | 1155 | cat "$BOOTSCRIPTS_DIR/$script" >> "$boot_script" | ||
334 | 1156 | done | ||
335 | 1157 | mkimage_script "$usaddr" "boot script" "$boot_script" \ | ||
336 | 1158 | "$tmpdir/boot.scr" | ||
337 | 1159 | boot_script="$tmpdir/boot.scr" | ||
338 | 1160 | backup_and_install "$boot_script" "$boot_script_path" | ||
339 | 1161 | ;; | ||
340 | 1162 | uEnvtxt*) | ||
341 | 1163 | VOLID=${VOLID:-"$(get_root_uuid)"} | ||
342 | 1164 | boot_script_in="$BOOTSCRIPTS_DIR/$usname" | ||
343 | 1165 | boot_script="$boot_mnt_dir/$usname" | ||
344 | 1166 | cp $boot_script_in $boot_script | ||
345 | 1167 | |||
346 | 1168 | boot_script_path="$boot_mnt_dir/uEnv.txt" | ||
347 | 1169 | boot_script_env="$boot_mnt_dir/preEnv.txt" | ||
348 | 1170 | env_script="$tmpdir/preEnv.txt" | ||
349 | 1171 | |||
350 | 1172 | [ -e /etc/default/flash-kernel ] && . /etc/default/flash-kernel | ||
351 | 1173 | echo "bootargs=ro $(LINUX_KERNEL_CMDLINE) root=UUID=$VOLID" > $env_script | ||
352 | 1174 | |||
353 | 1175 | backup_and_install "$env_script" "$boot_script_env" | ||
354 | 1176 | backup_and_install "$boot_script" "$boot_script_path" | ||
355 | 1177 | ;; | ||
356 | 1178 | esac | ||
358 | 1179 | fi | 1213 | fi |
359 | 1180 | if [ -n "$boot_dtb_path" ] && [ "$dtb_append" != "no" ]; then | 1214 | if [ -n "$boot_dtb_path" ] && [ "$dtb_append" != "no" ]; then |
360 | 1181 | boot_dtb_path="$boot_mnt_dir/$boot_dtb_path" | 1215 | boot_dtb_path="$boot_mnt_dir/$boot_dtb_path" |
361 | diff --git a/its/arm64/image-kria.its b/its/arm64/image-kria.its | |||
362 | 1182 | new file mode 100644 | 1216 | new file mode 100644 |
363 | index 0000000..4ff3cc0 | |||
364 | --- /dev/null | |||
365 | +++ b/its/arm64/image-kria.its | |||
366 | @@ -0,0 +1,62 @@ | |||
367 | 1 | /* | ||
368 | 2 | * Simple U-Boot uImage source file containing a single kernel, ramdisk and FDT blob | ||
369 | 3 | */ | ||
370 | 4 | |||
371 | 5 | /dts-v1/; | ||
372 | 6 | |||
373 | 7 | / { | ||
374 | 8 | description = "Simple image with single Linux kernel, ramdisk and FDT blob"; | ||
375 | 9 | #address-cells = <1>; | ||
376 | 10 | |||
377 | 11 | images { | ||
378 | 12 | kernel-1 { | ||
379 | 13 | description = "Ubuntu kernel"; | ||
380 | 14 | data = /incbin/("@@LINUX_IMAGE_FILE@@"); | ||
381 | 15 | type = "kernel"; | ||
382 | 16 | arch = "arm64"; | ||
383 | 17 | os = "linux"; | ||
384 | 18 | compression = "gzip"; | ||
385 | 19 | load = <0x00080000>; | ||
386 | 20 | entry = <0x00080000>; | ||
387 | 21 | hash-1 { | ||
388 | 22 | algo = "sha1"; | ||
389 | 23 | }; | ||
390 | 24 | }; | ||
391 | 25 | |||
392 | 26 | ramdisk-1 { | ||
393 | 27 | description = "Ubuntu ramdisk"; | ||
394 | 28 | data = /incbin/("@@INITRD_FILE@@"); | ||
395 | 29 | type = "ramdisk"; | ||
396 | 30 | arch = "arm64"; | ||
397 | 31 | os = "linux"; | ||
398 | 32 | compression = "none"; | ||
399 | 33 | hash-1 { | ||
400 | 34 | algo = "sha1"; | ||
401 | 35 | }; | ||
402 | 36 | }; | ||
403 | 37 | |||
404 | 38 | fdt-1 { | ||
405 | 39 | description = "Kria Device Tree blob"; | ||
406 | 40 | data = /incbin/("/usr/share/xlnx-kria-firmware/devicetree/system-top.dtb"); | ||
407 | 41 | type = "flat_dt"; | ||
408 | 42 | arch = "arm64"; | ||
409 | 43 | compression = "none"; | ||
410 | 44 | hash-1 { | ||
411 | 45 | algo = "sha1"; | ||
412 | 46 | }; | ||
413 | 47 | }; | ||
414 | 48 | }; | ||
415 | 49 | |||
416 | 50 | configurations { | ||
417 | 51 | default = "kria"; | ||
418 | 52 | kria { | ||
419 | 53 | description = "Boot Ubuntu on kria SOM"; | ||
420 | 54 | kernel = "kernel-1"; | ||
421 | 55 | ramdisk = "ramdisk-1"; | ||
422 | 56 | fdt = "fdt-1"; | ||
423 | 57 | hash-1 { | ||
424 | 58 | algo = "sha1"; | ||
425 | 59 | }; | ||
426 | 60 | }; | ||
427 | 61 | }; | ||
428 | 62 | }; | ||
429 | diff --git a/its/arm64/image-zcu.its b/its/arm64/image-zcu.its | |||
430 | 0 | new file mode 100644 | 63 | new file mode 100644 |
431 | index 0000000..61e2ef0 | |||
432 | --- /dev/null | |||
433 | +++ b/its/arm64/image-zcu.its | |||
434 | @@ -0,0 +1,50 @@ | |||
435 | 1 | /* | ||
436 | 2 | * Simple U-Boot uImage source file containing a single kernel, ramdisk and FDT blob | ||
437 | 3 | */ | ||
438 | 4 | |||
439 | 5 | /dts-v1/; | ||
440 | 6 | |||
441 | 7 | / { | ||
442 | 8 | description = "Simple image with single Linux kernel, ramdisk and FDT blob"; | ||
443 | 9 | #address-cells = <1>; | ||
444 | 10 | |||
445 | 11 | images { | ||
446 | 12 | kernel-1 { | ||
447 | 13 | description = "Ubuntu kernel"; | ||
448 | 14 | data = /incbin/("@@LINUX_IMAGE_FILE@@"); | ||
449 | 15 | type = "kernel"; | ||
450 | 16 | arch = "arm64"; | ||
451 | 17 | os = "linux"; | ||
452 | 18 | compression = "gzip"; | ||
453 | 19 | load = <0x00080000>; | ||
454 | 20 | entry = <0x00080000>; | ||
455 | 21 | hash-1 { | ||
456 | 22 | algo = "sha1"; | ||
457 | 23 | }; | ||
458 | 24 | }; | ||
459 | 25 | |||
460 | 26 | ramdisk-1 { | ||
461 | 27 | description = "Ubuntu ramdisk"; | ||
462 | 28 | data = /incbin/("@@INITRD_FILE@@"); | ||
463 | 29 | type = "ramdisk"; | ||
464 | 30 | arch = "arm64"; | ||
465 | 31 | os = "linux"; | ||
466 | 32 | compression = "none"; | ||
467 | 33 | hash-1 { | ||
468 | 34 | algo = "sha1"; | ||
469 | 35 | }; | ||
470 | 36 | }; | ||
471 | 37 | }; | ||
472 | 38 | |||
473 | 39 | configurations { | ||
474 | 40 | default = "zcu"; | ||
475 | 41 | zcu { | ||
476 | 42 | description = "Boot Ubuntu on zcu board"; | ||
477 | 43 | kernel = "kernel-1"; | ||
478 | 44 | ramdisk = "ramdisk-1"; | ||
479 | 45 | hash-1 { | ||
480 | 46 | algo = "sha1"; | ||
481 | 47 | }; | ||
482 | 48 | }; | ||
483 | 49 | }; | ||
484 | 50 | }; | ||
485 | diff --git a/test_db b/test_db | |||
486 | index 622fd3c..19a02ee 100755 | |||
487 | --- a/test_db | |||
488 | +++ b/test_db | |||
489 | @@ -22,7 +22,7 @@ | |||
490 | 22 | MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)" | 22 | MACHINE_DB="$(cat "${FK_CHECKOUT:-$FK_DIR}/db/"*.db)" |
491 | 23 | 23 | ||
492 | 24 | test_no_unknown_fields() { | 24 | test_no_unknown_fields() { |
494 | 25 | local expected='Android-Boot-Device Android-Skip-Initrd Boot-Device Boot-DTB-Path Boot-Initrd-Path Boot-Kernel-Path Bootloader-Has-Broken-Ext4-Extent-Support Bootloader-Sets-Incorrect-Root Bootloader-sets-root Boot-Multi-Path Boot-Script-Path DTB-Append DTB-Append-From DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name' | 25 | local expected='Android-Boot-Device Android-Skip-Initrd Boot-Device Boot-DTB-Path Boot-FIT-Path Boot-Initrd-Path Boot-ITS-File-Name Boot-Kernel-Path Bootloader-Has-Broken-Ext4-Extent-Support Bootloader-Sets-Incorrect-Root Bootloader-sets-root Boot-Multi-Path Boot-Script-Path DTB-Append DTB-Append-From DTB-Id Kernel-Flavors Machine Machine-Id Method Mtd-Initrd Mtd-Kernel Optional-Packages Required-Packages U-Boot-Initrd-Address U-Boot-Kernel-Address U-Boot-Kernel-Entry-Point U-Boot-Multi-Address U-Boot-Script-Address U-Boot-Script-Name' |
495 | 26 | expected="$(echo "$expected" | sed 's/ /\n/g' | sort -u | xargs)" | 26 | expected="$(echo "$expected" | sed 's/ /\n/g' | sort -u | xargs)" |
496 | 27 | local fields="$(echo "$MACHINE_DB" | sed -n '/^[^#]*:/s/:.*//p' | sort -u | xargs)" | 27 | local fields="$(echo "$MACHINE_DB" | sed -n '/^[^#]*:/s/:.*//p' | sort -u | xargs)" |
497 | 28 | if [ "$fields" != "$expected" ]; then | 28 | if [ "$fields" != "$expected" ]; then |
Rather than add a dtb-install flag, can you just omit the unused dtb-id on boards where we shouldn't copy it?
The boot scripts between ZCU and Kria look very similar, it's very tempting to make a generic script with a zcu and kria config, call that xlnx boot script, and select through a templated "default = @FIT_DEFAULT_ CONFIG@ ". But it's also ok to keep things simple and have two simple data files :-)