mirror of
				https://github.com/linuxkit/linuxkit.git
				synced 2025-10-31 05:52:56 +00:00 
			
		
		
		
	Merge pull request #3253 from johanneswuerbach/s390x-support
Add s390x support to binfmt_misc
This commit is contained in:
		| @@ -17,7 +17,7 @@ onboot: | |||||||
|   - name: sysfs |   - name: sysfs | ||||||
|     image: linuxkit/sysfs:v0.6 |     image: linuxkit/sysfs:v0.6 | ||||||
|   - name: binfmt |   - name: binfmt | ||||||
|     image: linuxkit/binfmt:v0.6 |     image: linuxkit/binfmt:e2d222038867ebd13b0b723c8351be559267050b | ||||||
|   # Format and mount the disk image in /var/lib/docker |   # Format and mount the disk image in /var/lib/docker | ||||||
|   - name: format |   - name: format | ||||||
|     image: linuxkit/format:v0.6 |     image: linuxkit/format:v0.6 | ||||||
|   | |||||||
| @@ -3,7 +3,8 @@ FROM debian@sha256:de3eac83cd481c04c5d6c7344cd7327625a1d8b2540e82a8231b5675cef0a | |||||||
| RUN apt-get update && apt-get install -y qemu-user-static && \ | RUN apt-get update && apt-get install -y qemu-user-static && \ | ||||||
|     mv /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64 && \ |     mv /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64 && \ | ||||||
|     mv /usr/bin/qemu-arm-static /usr/bin/qemu-arm && \ |     mv /usr/bin/qemu-arm-static /usr/bin/qemu-arm && \ | ||||||
|     mv /usr/bin/qemu-ppc64le-static /usr/bin/qemu-ppc64le |     mv /usr/bin/qemu-ppc64le-static /usr/bin/qemu-ppc64le && \ | ||||||
|  |     mv /usr/bin/qemu-s390x-static /usr/bin/qemu-s390x | ||||||
|  |  | ||||||
| FROM linuxkit/alpine:3683c9a66cd4da40bd7d6c7da599b2dcd738b559 AS mirror | FROM linuxkit/alpine:3683c9a66cd4da40bd7d6c7da599b2dcd738b559 AS mirror | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,8 @@ | |||||||
|  | # Register other architecture binary formats https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html | ||||||
|  | # Architecture masks and magics can be found here | ||||||
|  | # https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh | ||||||
|  | # Replace ELF with `\x45\x4c\x46` | ||||||
| :qemu-aarch64:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:CF | :qemu-aarch64:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64:CF | ||||||
| :qemu-arm:M:0:\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:CF | :qemu-arm:M:0:\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:CF | ||||||
| :qemu-ppc64le:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/bin/qemu-ppc64le:CF | :qemu-ppc64le:M:0:\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00:\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00:/usr/bin/qemu-ppc64le:CF | ||||||
|  | :qemu-s390x:M:0:\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x:CF | ||||||
|   | |||||||
| @@ -89,6 +89,10 @@ func main() { | |||||||
| 			if len(line) == 0 { | 			if len(line) == 0 { | ||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
|  | 			// ignore comments | ||||||
|  | 			if line[0] == '#' { | ||||||
|  | 				continue | ||||||
|  | 			} | ||||||
| 			err = binfmt(line) | 			err = binfmt(line) | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				log.Fatal(err) | 				log.Fatal(err) | ||||||
|   | |||||||
| @@ -6,7 +6,7 @@ init: | |||||||
|   - linuxkit/runc:b87c49e73eb14ba73d23eabf75423e987a043209 |   - linuxkit/runc:b87c49e73eb14ba73d23eabf75423e987a043209 | ||||||
| onboot: | onboot: | ||||||
|   - name: binfmt |   - name: binfmt | ||||||
|     image: linuxkit/binfmt:v0.6 |     image: linuxkit/binfmt:e2d222038867ebd13b0b723c8351be559267050b | ||||||
|   - name: test |   - name: test | ||||||
|     image: alpine:3.8 |     image: alpine:3.8 | ||||||
|     binds: |     binds: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user