mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
CI: fixes for armv6+v7
This commit is contained in:
parent
fcb19fefb5
commit
f9c42b57ab
4 changed files with 38 additions and 36 deletions
6
.github/workflows/niv-update.yml
vendored
6
.github/workflows/niv-update.yml
vendored
|
|
@ -48,9 +48,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.niv-update.run.bootstrap
|
attrs: ci.job.niv-update.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for aarch64 builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which aarch64binfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
'
|
'
|
||||||
- id: ci-dirty
|
- id: ci-dirty
|
||||||
|
|
|
||||||
16
.github/workflows/nodes.yml
vendored
16
.github/workflows/nodes.yml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.athame.run.bootstrap
|
attrs: ci.job.athame.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.beltane.run.bootstrap
|
attrs: ci.job.beltane.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -170,7 +170,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.daiyousei.run.bootstrap
|
attrs: ci.job.daiyousei.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -232,7 +232,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.ostara.run.bootstrap
|
attrs: ci.job.ostara.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -294,7 +294,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.rinnosuke.run.bootstrap
|
attrs: ci.job.rinnosuke.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -356,7 +356,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.samhain.run.bootstrap
|
attrs: ci.job.samhain.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -418,7 +418,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.shinmyoumaru.run.bootstrap
|
attrs: ci.job.shinmyoumaru.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
@ -480,7 +480,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
attrs: ci.job.yule.run.bootstrap
|
attrs: ci.job.yule.run.bootstrap
|
||||||
quiet: false
|
quiet: false
|
||||||
- id: aarch64
|
- id: architectures
|
||||||
name: prepare for emulated builds
|
name: prepare for emulated builds
|
||||||
run: 'sudo $(which archbinfmt)
|
run: 'sudo $(which archbinfmt)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,31 +5,34 @@ with lib; {
|
||||||
ci.gh-actions.export = true;
|
ci.gh-actions.export = true;
|
||||||
|
|
||||||
|
|
||||||
nix.config = {
|
|
||||||
extra-platforms = "aarch64-linux";
|
|
||||||
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
|
||||||
};
|
|
||||||
|
|
||||||
gh-actions.env.OPENSSH_PRIVATE_KEY = "\${{ secrets.OPENSSH_PRIVATE_KEY }}";
|
gh-actions.env.OPENSSH_PRIVATE_KEY = "\${{ secrets.OPENSSH_PRIVATE_KEY }}";
|
||||||
gh-actions.env.CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}";
|
gh-actions.env.CACHIX_SIGNING_KEY = "\${{ secrets.CACHIX_SIGNING_KEY }}";
|
||||||
|
|
||||||
# ensure sources are fetched and available in the local store before evaluating host configs
|
|
||||||
|
nix.config = {
|
||||||
|
extra-platforms = ["aarch64-linux" "armv6l-linux" "armv7l-linux"];
|
||||||
|
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
||||||
|
};
|
||||||
|
|
||||||
environment.bootstrap = {
|
environment.bootstrap = {
|
||||||
aarch64binfmt =
|
archbinfmt =
|
||||||
let
|
let
|
||||||
makeQemuWrapper = name: ''
|
makeQemuWrapper = name: ''
|
||||||
mkdir -p /run/binfmt
|
mkdir -p /run/binfmt
|
||||||
rm -f /run/binfmt/${name}
|
rm -f /run/binfmt/${name}-linux
|
||||||
cat > /run/binfmt/${name} << 'EOF'
|
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||||
#!${channels.cipkgs.bash}/bin/sh
|
#!${channels.cipkgs.bash}/bin/sh
|
||||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /run/binfmt/${name}
|
chmod +x /run/binfmt/${name}-linux
|
||||||
''; in
|
''; in
|
||||||
channels.cipkgs.writeShellScriptBin "aarch64binfmt" ''
|
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
|
||||||
${makeQemuWrapper "aarch64"}
|
${makeQemuWrapper "aarch64"}
|
||||||
|
${makeQemuWrapper "arm"}
|
||||||
echo 'extra-sandbox-paths = ${channels.cipkgs.bash} ${channels.cipkgs.qemu} /run/binfmt' >> /etc/nix/nix.conf
|
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 ':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-linux:' > /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/arm-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/arm-linux:' > /proc/sys/fs/binfmt_misc/register
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -54,11 +57,11 @@ with lib; {
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
jobs = mkIf (config.id != "ci") {
|
jobs = mkIf (config.id != "ci") {
|
||||||
${config.id}.step.aarch64 = {
|
${config.id}.step.architectures = {
|
||||||
order = 201;
|
order = 201;
|
||||||
name = "prepare for aarch64 builds";
|
name = "prepare for emulated builds";
|
||||||
run = ''
|
run = ''
|
||||||
sudo $(which aarch64binfmt)
|
sudo $(which archbinfmt)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
19
ci/nodes.nix
19
ci/nodes.nix
|
|
@ -5,13 +5,13 @@
|
||||||
channels.nixfiles.path = ../.;
|
channels.nixfiles.path = ../.;
|
||||||
|
|
||||||
nix.config = {
|
nix.config = {
|
||||||
extra-platforms = ["aarch64-linux" "armv6l" "armv7l"];
|
extra-platforms = ["aarch64-linux" "armv6l-linux" "armv7l-linux"];
|
||||||
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
#extra-sandbox-paths = with channels.cipkgs; map (package: builtins.unsafeDiscardStringContext "${package}?") [bash qemu "/run/binfmt"];
|
||||||
};
|
};
|
||||||
|
|
||||||
gh-actions = {
|
gh-actions = {
|
||||||
jobs = mkIf (config.id != "ci") {
|
jobs = mkIf (config.id != "ci") {
|
||||||
${config.id}.step.aarch64 = {
|
${config.id}.step.architectures = {
|
||||||
order = 201;
|
order = 201;
|
||||||
name = "prepare for emulated builds";
|
name = "prepare for emulated builds";
|
||||||
run = ''
|
run = ''
|
||||||
|
|
@ -27,21 +27,20 @@
|
||||||
let
|
let
|
||||||
makeQemuWrapper = name: ''
|
makeQemuWrapper = name: ''
|
||||||
mkdir -p /run/binfmt
|
mkdir -p /run/binfmt
|
||||||
rm -f /run/binfmt/${name}
|
rm -f /run/binfmt/${name}-linux
|
||||||
cat > /run/binfmt/${name} << 'EOF'
|
cat > /run/binfmt/${name}-linux << 'EOF'
|
||||||
#!${channels.cipkgs.bash}/bin/sh
|
#!${channels.cipkgs.bash}/bin/sh
|
||||||
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
exec -- ${channels.cipkgs.qemu}/bin/qemu-${name} "$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /run/binfmt/${name}
|
chmod +x /run/binfmt/${name}-linux
|
||||||
''; in
|
''; in
|
||||||
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
|
channels.cipkgs.writeShellScriptBin "archbinfmt" ''
|
||||||
${makeQemuWrapper "aarch64"}
|
${makeQemuWrapper "aarch64"}
|
||||||
${makeQemuWrapper "armv6l"}
|
${makeQemuWrapper "arm"}
|
||||||
${makeQemuWrapper "armv7l"}
|
|
||||||
echo 'extra-sandbox-paths = ${channels.cipkgs.bash} ${channels.cipkgs.qemu} /run/binfmt' >> /etc/nix/nix.conf
|
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 ':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-linux:' > /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 ':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/arm-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
|
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/arm-linux:' > /proc/sys/fs/binfmt_misc/register
|
||||||
'';
|
'';
|
||||||
sourceCache = channels.cipkgs.runCommand "sources"
|
sourceCache = channels.cipkgs.runCommand "sources"
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue