History

lib: determine qemu binary from target cpu string

Piraty committed 5 years ago

Commit 61bc8941 parent 35209b21 file · +1 −8Browse files

Unified · Split

lib.sh.in+1−8
@@ -186,25 +186,21 @@ register_binfmt() { · 185 unmodified lines
186186 _cpu=arm
187187 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00"
188188 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
189− QEMU_BIN=qemu-arm-static
190189 ;;
191190 aarch64)
192191 _cpu=aarch64
193192 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7"
194193 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
195− QEMU_BIN=qemu-aarch64-static
196194 ;;
197195 ppc64le)
198196 _cpu=ppc64le
199197 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00"
200198 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00"
201− QEMU_BIN=qemu-ppc64le-static
202199 ;;
203200 ppc64)
204201 _cpu=ppc64
205202 _magic="\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15"
206203 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
207− QEMU_BIN=qemu-ppc64-static
208204 ;;
209205 ppc)
210206 if [ "$_hostarch" = "ppc64" ] ; then
@@ -213,7 +209,6 @@ register_binfmt() { · 2 unmodified lines
213209 _cpu=ppc
214210 _magic="\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14"
215211 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"
216− QEMU_BIN=qemu-ppc-static
217212 ;;
218213 mipsel)
219214 if [ "$_hostarch" = "mips64el" ] ; then
@@ -222,13 +217,11 @@ register_binfmt() { · 2 unmodified lines
222217 _cpu=mipsel
223218 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00"
224219 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
225− QEMU_BIN=qemu-mipsel-static
226220 ;;
227221 x86_64)
228222 _cpu=x86_64
229223 _magic="\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00"
230224 _mask="\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
231− QEMU_BIN=qemu-x86_64-static
232225 ;;
233226 i686)
234227 if [ "$_hostarch" = "x86_64" ] ; then
@@ -237,7 +230,6 @@ register_binfmt() { · 2 unmodified lines
237230 _cpu=i386
238231 _magic="\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00"
239232 _mask="\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"
240− QEMU_BIN=qemu-i386-static
241233 ;;
242234 *)
243235 die "Unknown target architecture!"
@@ -246,6 +238,7 @@ register_binfmt() { · 2 unmodified lines
246238
247239 # For builds that do not match the host architecture, the correct
248240 # qemu binary will be required.
241+ QEMU_BIN="qemu-${_cpu}-static"
249242 if ! $QEMU_BIN -version >/dev/null 2>&1; then
250243 die "$QEMU_BIN binary is missing in your system, exiting."
251244 fi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t