@@ -66,39 +66,43 @@ for tap in $tapinterfaces; do
66
66
fi
67
67
done
68
68
69
- # Exporting ARCH=um SUBARCH=x86_64 doesn't seem to work, as it "sometimes" (?)
70
- # results in a 32-bit kernel.
69
+ if [ -z " $KERNEL_BINARY " ]; then
70
+ # Exporting ARCH=um SUBARCH=x86_64 doesn't seem to work, as it "sometimes"
71
+ # (?) results in a 32-bit kernel.
71
72
72
- # If there's no kernel config at all, create one or UML won't work.
73
- [ -f .config ] || make defconfig ARCH=um SUBARCH=x86_64
73
+ # If there's no kernel config at all, create one or UML won't work.
74
+ [ -f .config ] || make defconfig ARCH=um SUBARCH=x86_64
74
75
75
- # Enable the kernel config options listed in $OPTIONS.
76
- cmdline=${OPTIONS// / -e }
77
- ./scripts/config $cmdline
76
+ # Enable the kernel config options listed in $OPTIONS.
77
+ cmdline=${OPTIONS// / -e }
78
+ ./scripts/config $cmdline
78
79
79
- # Disable the kernel config options listed in $DISABLE_OPTIONS.
80
- cmdline=${DISABLE_OPTIONS// / -d }
81
- ./scripts/config $cmdline
80
+ # Disable the kernel config options listed in $DISABLE_OPTIONS.
81
+ cmdline=${DISABLE_OPTIONS// / -d }
82
+ ./scripts/config $cmdline
82
83
83
- # olddefconfig doesn't work on old kernels.
84
- if ! make olddefconfig ARCH=um SUBARCH=x86_64 CROSS_COMPILE= ; then
85
- cat >&2 << EOF
84
+ # olddefconfig doesn't work on old kernels.
85
+ if ! make olddefconfig ARCH=um SUBARCH=x86_64 CROSS_COMPILE= ; then
86
+ cat >&2 << EOF
86
87
87
88
Warning: "make olddefconfig" failed.
88
89
Perhaps this kernel is too old to support it.
89
90
You may get asked lots of questions.
90
91
Keep enter pressed to accept the defaults.
91
92
92
93
EOF
94
+ fi
95
+
96
+ # Compile the kernel.
97
+ make -j32 linux ARCH=um SUBARCH=x86_64 CROSS_COMPILE=
98
+ KERNEL_BINARY=./linux
93
99
fi
94
100
95
- # Compile the kernel.
96
- make -j32 linux ARCH=um SUBARCH=x86_64 CROSS_COMPILE=
97
101
98
102
# Get the absolute path to the test file that's being run.
99
103
dir=/host$( dirname $( readlink -f $0 ) )
100
104
101
105
# Start the VM.
102
- exec ./linux umid=net_test ubda=$( dirname $0 ) /$ROOTFS \
106
+ exec $KERNEL_BINARY umid=net_test ubda=$( dirname $0 ) /$ROOTFS \
103
107
mem=512M init=/sbin/net_test.sh net_test=$dir /$test \
104
108
$netconfig
0 commit comments