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
186 _cpu=arm186 _cpu=arm
187 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00"187 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00"
188 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"188 _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
190 ;;189 ;;
191 aarch64)190 aarch64)
192 _cpu=aarch64191 _cpu=aarch64
193 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7"192 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7"
194 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"193 _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
196 ;;194 ;;
197 ppc64le)195 ppc64le)
198 _cpu=ppc64le196 _cpu=ppc64le
199 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00"197 _magic="\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00"
200 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00"198 _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
202 ;;199 ;;
203 ppc64)200 ppc64)
204 _cpu=ppc64201 _cpu=ppc64
205 _magic="\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15"202 _magic="\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15"
206 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"203 _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
208 ;;204 ;;
209 ppc)205 ppc)
210 if [ "$_hostarch" = "ppc64" ] ; then206 if [ "$_hostarch" = "ppc64" ] ; then
@@ -213,7 +209,6 @@ register_binfmt() { · 2 unmodified lines
213 _cpu=ppc209 _cpu=ppc
214 _magic="\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14"210 _magic="\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14"
215 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff"211 _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
217 ;;212 ;;
218 mipsel)213 mipsel)
219 if [ "$_hostarch" = "mips64el" ] ; then214 if [ "$_hostarch" = "mips64el" ] ; then
@@ -222,13 +217,11 @@ register_binfmt() { · 2 unmodified lines
222 _cpu=mipsel217 _cpu=mipsel
223 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00"218 _magic="\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00"
224 _mask="\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"219 _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
226 ;;220 ;;
227 x86_64)221 x86_64)
228 _cpu=x86_64222 _cpu=x86_64
229 _magic="\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00"223 _magic="\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00"
230 _mask="\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"224 _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
232 ;;225 ;;
233 i686)226 i686)
234 if [ "$_hostarch" = "x86_64" ] ; then227 if [ "$_hostarch" = "x86_64" ] ; then
@@ -237,7 +230,6 @@ register_binfmt() { · 2 unmodified lines
237 _cpu=i386230 _cpu=i386
238 _magic="\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00"231 _magic="\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00"
239 _mask="\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff"232 _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
241 ;;233 ;;
242 *)234 *)
243 die "Unknown target architecture!"235 die "Unknown target architecture!"
@@ -246,6 +238,7 @@ register_binfmt() { · 2 unmodified lines
246 238
247 # For builds that do not match the host architecture, the correct239 # For builds that do not match the host architecture, the correct
248 # qemu binary will be required.240 # qemu binary will be required.
241 QEMU_BIN="qemu-${_cpu}-static"
249 if ! $QEMU_BIN -version >/dev/null 2>&1; then242 if ! $QEMU_BIN -version >/dev/null 2>&1; then
250 die "$QEMU_BIN binary is missing in your system, exiting."243 die "$QEMU_BIN binary is missing in your system, exiting."
251 fi244 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