hosts/shinmyoumaru: init, cross: armv6+v7 emulated, stripped base, exprs

This commit is contained in:
kat witch 2021-09-02 21:17:59 +01:00
parent c7d8d0b3d4
commit 37950bc59a
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
19 changed files with 153 additions and 28 deletions

View file

@ -5,7 +5,7 @@
channels.nixfiles.path = ../.;
nix.config = {
extra-platforms = "aarch64-linux";
extra-platforms = ["aarch64-linux" "armv6l" "armv7l"];
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
};
@ -13,9 +13,9 @@
jobs = mkIf (config.id != "ci") {
${config.id}.step.aarch64 = {
order = 201;
name = "prepare for aarch64 builds";
name = "prepare for emulated builds";
run = ''
sudo $(which aarch64binfmt)
sudo $(which archbinfmt)
'';
};
};
@ -23,7 +23,7 @@
# ensure sources are fetched and available in the local store before evaluating host configs
environment.bootstrap = {
aarch64binfmt =
archbinfmt =
let
makeQemuWrapper = name: ''
mkdir -p /run/binfmt
@ -34,10 +34,14 @@
EOF
chmod +x /run/binfmt/${name}
''; in
channels.cipkgs.writeShellScriptBin "aarch64binfmt" ''
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
${makeQemuWrapper "aarch64"}
${makeQemuWrapper "armv6l"}
${makeQemuWrapper "armv7l"}
echo 'extra-sandbox-paths = ${channels.cipkgs.bash} ${channels.cipkgs.qemu} /run/binfmt' >> /etc/nix/nix.conf
echo ':aarch64-linux:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/run/binfmt/aarch64:' > /proc/sys/fs/binfmt_misc/register
echo ':armv6l-linux: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\x00\xff\xfe\xff\xff\xff:/run/binfmt/armv6l-linux:' > /proc/sys/fs/binfmt_misc/register
echo ':armv7l-linux: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\x00\xff\xfe\xff\xff\xff:/run/binfmt/armv7l-linux:' > /proc/sys/fs/binfmt_misc/register
'';
sourceCache = channels.cipkgs.runCommand "sources"
{