Skip to content

Instantly share code, notes, and snippets.

@gdamjan
Last active July 13, 2022 04:45
Show Gist options
  • Save gdamjan/ce8ec24c69f62a2584bb to your computer and use it in GitHub Desktop.
Save gdamjan/ce8ec24c69f62a2584bb to your computer and use it in GitHub Desktop.
binfmt conf file to run arm elf files on x86 (with qemu-user-static installed)
# /etc/binfmt.d/qemu-arm.conf
:arm:M::\x7fELF\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-static:
# install a static build of qemu (user space emulation)
aurget -S qemu-user-static
# after setting the above binfmt file, reload the kernel settings (or reboot)
sudo systemctl restart systemd-binfmt
# run systemd nspawn with some injected (bind mounted) files
sudo systemd-nspawn -D $ARMROOT \
--bind-ro=/usr/bin/qemu-arm-static \
--bind-ro=/etc/resolv.conf:/run/systemd/resolve/resolv.conf
@gdamjan
Copy link
Author

gdamjan commented Jan 14, 2016

also, after unpacking and entering the nspawn:

pacman -Syu wpa_supplicant avahi nss-mdns vim
echo 'somehostname' > /etc/hostname

@gdamjan
Copy link
Author

gdamjan commented Jan 14, 2016

  • /etc/wpa_supplicant/wifi.conf
  • /etc/systemd/system/wifi.service
  • /etc/systemd/network/wifi.network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment