@@ -21,7 +21,7 @@ post_script_args=
21
21
qemu_sdl=' --enable-sdl --with-sdlabi=2.0'
22
22
suffix=
23
23
v=0
24
- while getopts ' a:B:b:C:c:fGgj:hIiK:kL:lM:p:qSst::v' OPT; do
24
+ while getopts ' a:B:b:C:c:fGgj:hIiK:kL:lM:p:Q: qSst::v' OPT; do
25
25
case " $OPT " in
26
26
a)
27
27
arch=" $OPTARG "
@@ -88,6 +88,9 @@ BR2_TARGET_ROOTFS_INITRAMFS=n
88
88
p)
89
89
post_script_args=" $OPTARG "
90
90
;;
91
+ Q)
92
+ common_qemu_variant=" $OPTARG "
93
+ ;;
91
94
q)
92
95
extra_make_args=" ${extra_make_args} host-qemu-reconfigure \\
93
96
"
@@ -191,15 +194,24 @@ echo
191
194
192
195
common_mkdir
193
196
194
- # Manage Linux kernel variants.
195
- if [ -h " $common_linux_custom_dir " ]; then
196
- rm " $common_linux_custom_dir "
197
- elif [ -d " $common_linux_custom_dir " ]; then
198
- # Migration for existing builds.
199
- mv " $common_linux_custom_dir " " $common_linux_variant_dir "
200
- fi
201
- mkdir -p " $common_linux_variant_dir "
202
- ln -s " $common_linux_variant_dir " " $common_linux_custom_dir "
197
+ # Manage Linux kernel and QEMU variants.
198
+ symlink_buildroot_variant () (
199
+ custom_dir=" $1 "
200
+ variant_dir=" $2 "
201
+ if [ -h " $custom_dir " ]; then
202
+ rm " $custom_dir "
203
+ elif [ -d " $custom_dir " ]; then
204
+ # Migration for existing builds.
205
+ mv " $custom_dir " " $variant_dir "
206
+ fi
207
+ mkdir -p " $variant_dir "
208
+ ln -s " $variant_dir " " $custom_dir "
209
+ )
210
+ symlink_buildroot_variant " $common_linux_custom_dir " " $common_linux_variant_dir "
211
+ symlink_buildroot_variant " $common_qemu_custom_dir " " $common_qemu_variant_dir "
212
+ # TODO: this breaks the build. But then I noticed that it wouldn't make sense,
213
+ # because this is a guest tool, and we don't have image variants yet. Some other day maybe.
214
+ # symlink_buildroot_variant "$common_qemu_guest_custom_dir" "$common_qemu_guest_variant_dir"
203
215
204
216
# Manage gem5 variants.
205
217
if " $gem5 " ; then
0 commit comments