Giter Club home page Giter Club logo

debian_foreign's Introduction

What is this?

A collection of scripts to {build, run, push} a Docker image to Docker Hub.

So what?

Well, this Docker image contains a Debian userland of AMD64/x86-64 architecture.

Pfft! Why should I care...

But this Debian in turn contains other Debian userlands...

Okay so you do a chroot, been there done that.

... of differing architectures via schroot and qemu user-mode emulation -- working transparently.

Hmm, tell me more.

This permits easy testing across many architectures. E.g. the for_each_arch function which runs a command within each defined architecture's environment in turn:

$ for_each_arch file /bin/true
/bin/true: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamica
/bin/true: ELF 32-bit MSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dyn
/bin/true: ELF 32-bit LSB shared object, MIPS, MIPS32 rel2 version 1 (SYSV), dyn

Oh that is neat. But I could also just have spun up 3 full-system QEMUs and installed 3 Linux distros.

True, but:

  1. This takes care of all the setup. With these scripts, moving to other {arch, debian version} is super easy.
  2. It would run slower since you now emulate peripherals and another Linux kernel. BTW, which boards would you pick?
  3. This runs under the same Linux kernel so the different programs under each architectures can interact normally; named pipes, even shared memory and IPC.

Cool! This would be great for automated {build, run-time} testing of various Linux software following a {git clone, configure, make, test}-pattern.

Yes! And when running, one could use gdb with rbreak, info variables and commands to dump scalar variables to a log. Diffing the logs between MIPS and MIPSel (with suitable magic) would reveal endianess bugs encountered. This forms the idea for an empirical endianess-bug detector.

Caveats

There is just one caveat: For now, Docker --privileged is required as binfmt must be mounted. There are ways around this though by patching QEMU user mode itself.

I just want the pre-built image

OK but this is my personal one, https://hub.docker.com/r/mpedoticon/debian_foreign/ . Disclaimer: Not production ready! I may change this image into a banana if I feel like it.

How to

Currently you do need this git cheked out first. Steps to run:

  1. Git clone this.
  2. Read through what payload.sh does, before you run it under a privileged Docker :)
  3. Run: sudo docker run --privileged -v ${PWD}:/this_dir -it mpedoticon/debian_foreign bash -x /this_dir/payload.sh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.