Skip to content

Commit

Permalink
meson: compile bundled device trees
Browse files Browse the repository at this point in the history
If dtc is available, compile the .dts files in the pc-bios directory
instead of using the precompiled binaries.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Sep 7, 2023
1 parent 3c7ee49 commit 6e0dc9d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
19 changes: 0 additions & 19 deletions pc-bios/Makefile

This file was deleted.

25 changes: 21 additions & 4 deletions pc-bios/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ blobs = [
'efi-e1000e.rom',
'efi-vmxnet3.rom',
'qemu-nsis.bmp',
'bamboo.dtb',
'canyonlands.dtb',
'petalogix-s3adsp1800.dtb',
'petalogix-ml605.dtb',
'multiboot.bin',
'multiboot_dma.bin',
'linuxboot.bin',
Expand All @@ -84,6 +80,27 @@ blobs = [
'vof-nvram.bin',
]

dtc = find_program('dtc', required: false)
foreach f : [
'bamboo.dts',
'canyonlands.dts',
'petalogix-s3adsp1800.dts',
'petalogix-ml605.dts',
]
out = fs.replace_suffix(f, '.dtb')
if dtc.found()
custom_target(f,
build_by_default: have_system,
input: files(f),
output: out,
install: get_option('install_blobs'),
install_dir: qemu_datadir,
command: [ dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT0@' ])
else
blobs += out
endif
endforeach

if get_option('install_blobs')
install_data(blobs, install_dir: qemu_datadir)
endif
Expand Down

0 comments on commit 6e0dc9d

Please sign in to comment.