@@ -25,6 +25,44 @@ datarootdir="/usr/share"
25
25
26
26
CLASS=" --class gnu-linux --class gnu --class os --class acrn"
27
27
28
+ file_is_not_sym () {
29
+ case " $1 " in
30
+ * /acrn-syms-* )
31
+ return 1;;
32
+ * )
33
+ return 0;;
34
+ esac
35
+ }
36
+
37
+ # use ELF *.out files for multiboot
38
+ acrn_out_list=
39
+ for i in /boot/acrn* .out; do
40
+ if grub_file_is_not_garbage " $i " && file_is_not_sym " $i " && grub-file --is-x86-multiboot " $i " ; then
41
+ acrn_out_list=" $acrn_out_list $i "
42
+ fi
43
+ done
44
+ # use raw binary *.bin files for multiboot2
45
+ acrn_bin_list=
46
+ for i in /boot/acrn* .bin; do
47
+ if grub_file_is_not_garbage " $i " && file_is_not_sym " $i " && grub-file --is-x86-multiboot2 " $i " ; then
48
+ acrn_bin_list=" $acrn_bin_list $i "
49
+ fi
50
+ done
51
+ # we prefer multiboot2
52
+ if [ " x${acrn_bin_list} " != " x" ]; then
53
+ acrn_list=" ${acrn_bin_list} "
54
+ acrn_loader=" multiboot2"
55
+ module_loader=" module2"
56
+ else
57
+ acrn_list=" ${acrn_out_list} "
58
+ acrn_loader=" multiboot --quirk-modules-after-kernel"
59
+ module_loader=" module"
60
+ fi
61
+ # no ACRN binary found
62
+ if [ " x${acrn_list} " = " x" ] ; then
63
+ exit 0
64
+ fi
65
+
28
66
# we obtain any data from scenario config
29
67
ACRN_SCENARIO_FILE=/usr/share/acrn/scenario.xml
30
68
if [ ! -f ${ACRN_SCENARIO_FILE} ]; then
@@ -253,44 +291,6 @@ for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
253
291
fi
254
292
done
255
293
256
- file_is_not_sym () {
257
- case " $1 " in
258
- * /acrn-syms-* )
259
- return 1;;
260
- * )
261
- return 0;;
262
- esac
263
- }
264
-
265
- # use ELF *.out files for multiboot
266
- acrn_out_list=
267
- for i in /boot/acrn* .out; do
268
- if grub_file_is_not_garbage " $i " && file_is_not_sym " $i " && grub-file --is-x86-multiboot " $i " ; then
269
- acrn_out_list=" $acrn_out_list $i "
270
- fi
271
- done
272
- # use raw binary *.bin files for multiboot2
273
- acrn_bin_list=
274
- for i in /boot/acrn* .bin; do
275
- if grub_file_is_not_garbage " $i " && file_is_not_sym " $i " && grub-file --is-x86-multiboot2 " $i " ; then
276
- acrn_bin_list=" $acrn_bin_list $i "
277
- fi
278
- done
279
- # we prefer multiboot2
280
- if [ " x${acrn_bin_list} " != " x" ]; then
281
- acrn_list=" ${acrn_bin_list} "
282
- acrn_loader=" multiboot2"
283
- module_loader=" module2"
284
- else
285
- acrn_list=" ${acrn_out_list} "
286
- acrn_loader=" multiboot --quirk-modules-after-kernel"
287
- module_loader=" module"
288
- fi
289
- # no ACRN binary found
290
- if [ " x${acrn_list} " = " x" ] ; then
291
- exit 0
292
- fi
293
-
294
294
prepare_boot_cache=
295
295
boot_device_id=
296
296
acrn_first_entry=
0 commit comments