@@ -21,7 +21,7 @@ post_script_args=
2121qemu_sdl=' --enable-sdl --with-sdlabi=2.0'
2222suffix=
2323v=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
2525 case " $OPT " in
2626 a)
2727 arch=" $OPTARG "
@@ -88,6 +88,9 @@ BR2_TARGET_ROOTFS_INITRAMFS=n
8888 p)
8989 post_script_args=" $OPTARG "
9090 ;;
91+ Q)
92+ common_qemu_variant=" $OPTARG "
93+ ;;
9194 q)
9295 extra_make_args=" ${extra_make_args} host-qemu-reconfigure \\
9396"
@@ -191,15 +194,24 @@ echo
191194
192195common_mkdir
193196
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"
203215
204216# Manage gem5 variants.
205217if " $gem5 " ; then
0 commit comments