Comments (14)
@kalbasit If you want a temporary fix before #34 goes away, this is (a simplified version of) what I use in my personal RPI deployment:
{
network = {
description = "RPI3 Server";
pkgs = (import <nixpkgs> {
system = "aarch64-linux";
});
};
"nixos-rpi.local" = { config, pkgs, ... }: {
# stuff...
};
}
from morph.
Sure. I'll give it a shot sometime in the next couple of days and get back to you.
Perfect. We've merged #67 to master now, since all our tests had good results. We're cutting a release momentarily and PR'ing that against nixpkgs. However; very interested in the result of your test still. If we still see issues, we'll do a bugfix release.
from morph.
I also tried with the nixpkgs given in the example and I got the same issue.
# Pin the deployment package-set to a specific version of nixpkgs
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/98c1150f2cc62b94b693dce63adc1fbcbfe616f1.tar.gz";
sha256 = "1mdwn0qrjc8jli8cbi4cfkar6xq15l232r371p4b48v2d4bah3wp";
}) {};
from morph.
@kalbasit Thanks for reporting. Strange... Sounds like the wrong interpreter is being used. Bash? That would explain command not found
, when the shell tries to exec use ...
. This could happen of course, if the shebang is not being read/interpreted correctly.
I just found a random switch-to-configuration script from one of my x86_64 systems. The shebang is: #! /nix/store/c8sbqdfvykyp3lgd2fcphr9rzr3l92vw-perl-5.28.1/bin/perl -I/nix/store/njlwlvhjj5v41wkly5m5fqhl7gm8ipla-perl5.28.1-File-Slurp-9999.26/lib/perl5/site_perl -I/nix/store/3400256pm5dmbnhr1mykvppkgp5mk1c4-perl5.28.1-Net-DBus-1.1.0/lib/perl5/site_perl -I/nix/store/azrfqx8wjmjh5niyghf39nymcz05g077-perl5.28.1-XML-Parser-2.44/lib/perl5/site_perl -I/nix/store/mw5ggn3cqkz7fz18p3n3vbhycgd5id5g-perl5.28.1-XML-Twig-3.52/lib/perl5/site_perl
Could it be an aarch-variant of: https://lwn.net/Articles/779997/ ?
Can you paste the shebang of your switch-to-configuration
-script, and perhaps the kernel version here?
from morph.
Yea I see the shebang is perl.
#! /nix/store/4h33limcvfdr6ivyjqfbzr6k62y8ipjg-perl-5.28.2/bin/perl -I/nix/store/qb80pgq401g9pc5mjxlmd6ynd76c47xx-perl5.28.2-File-Slurp-9999.27/lib/perl5/site_perl -I/nix/store/xbv2g30ik34g9kixgqylgwjbkn93xkvv-perl5.28.2-Net-DBus-1.1.0/lib/perl5/site_perl -I/nix/store/cwx0j181avl4x8p2cbba3s438a8cxa31-perl5.28.2-XML-Parser-2.44/lib/perl5/site_perl -I/nix/store/r8cqgfn69fz1ckg6ir63d9avc5mgqhpb-perl5.28.2-XML-Twig-3.52/lib/perl5/site_perl
Does morph execute bash switch-to-configuration
? I think it should just execute the switch-to-configuration
directly given that it's executable with a shebang.
cc @grahamc
from morph.
It looks like the famous kernel bug to be honest :) what is your target kernel version?
No, morph doesn't enforce Bash or any other interpreter.
from morph.
@johanot whatever kernel is currently shipped by nixpkgs-stable
as well as the version used by simple.nix
# Pin the deployment package-set to a specific version of nixpkgs
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs-channels/archive/98c1150f2cc62b94b693dce63adc1fbcbfe616f1.tar.gz";
sha256 = "1mdwn0qrjc8jli8cbi4cfkar6xq15l232r371p4b48v2d4bah3wp";
}) {};```
from morph.
Try uname -a
on the target machine. If it's 4.19.21 or 4.14.99, you can rollback, or run perl /nix/store/wckw45dkz19ncfi5nzfb736qnhzv77zg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration
to finish the switch-to-configuration step, then reboot into a working kernel.
from morph.
[root@kore:~]# uname -a
Linux kore 4.19.61 #1-NixOS SMP Fri Jul 26 07:14:31 UTC 2019 aarch64 GNU/Linux
[root@kore:~]# /nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 3: use: command not found
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 4: use: command not found
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 5: use: command not found
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 6: use: command not found
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 7: use: command not found
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 8: syntax error near unexpected token `('
/nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration: line 8: `use Sys::Syslog qw(:standard :macros);'
[root@kore:~]# head /nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration
#! /nix/store/4h33limcvfdr6ivyjqfbzr6k62y8ipjg-perl-5.28.2/bin/perl -I/nix/store/qb80pgq401g9pc5mjxlmd6ynd76c47xx-perl5.28.2-File-Slurp-9999.27/lib/perl5/site_perl -I/nix/store/xbv2g30ik34g9kixgqylgwjbkn93xkvv-perl5.28.2-Net-DBus-1.1.0/lib/perl5/site_perl -I/nix/store/cwx0j181avl4x8p2cbba3s438a8cxa31-perl5.28.2-XML-Parser-2.44/lib/perl5/site_perl -I/nix/store/r8cqgfn69fz1ckg6ir63d9avc5mgqhpb-perl5.28.2-XML-Twig-3.52/lib/perl5/site_perl
use strict;
use warnings;
use File::Basename;
use File::Slurp;
use Net::DBus;
use Sys::Syslog qw(:standard :macros);
use Cwd 'abs_path';
[root@kore:~]# /nix/store/4h33limcvfdr6ivyjqfbzr6k62y8ipjg-perl-5.28.2/bin/perl -I/nix/store/qb80pgq401g9pc5mjxlmd6ynd76c47xx-perl5.28.2-File-Slurp-9999.27/lib/perl5/site_perl -I/nix/store/xbv2g30ik34g9kixgqylgwjbkn93xkvv-perl5.28.2-Net-DBus-1.1.0/lib/perl5/site_perl -I/nix/store/cwx0j181avl4x8p2cbba3s438a8cxa31-perl5.28.2-XML-Parser-2.44/lib/perl5/site_perl -I/nix/store/r8cqgfn69fz1ckg6ir63d9avc5mgqhpb-perl5.28.2-XML-Twig-3.52/lib/perl5/site_perl /nix/store/80xxmcq4l6ayjb14z3j6mkgdxn6r8kgg-nixos-system-kore-19.09pre-git/bin/switch-to-configuration
-bash: /nix/store/4h33limcvfdr6ivyjqfbzr6k62y8ipjg-perl-5.28.2/bin/perl: cannot execute binary file: Exec format error
[root@kore:~]# nix run nixpkgs.binutils -c readelf -h /nix/store/4h33limcvfdr6ivyjqfbzr6k62y8ipjg-perl-5.28.2/bin/perl
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
Version: 0x1
Entry point address: 0x401270
Start of program headers: 64 (bytes into file)
Start of section headers: 15256 (bytes into file)
Flags: 0x0
Size of this header: 64 (bytes)
Size of program headers: 56 (bytes)
Number of program headers: 11
Size of section headers: 64 (bytes)
Number of section headers: 28
Section header string table index: 27
I don't think I understand building systems cross-platform.
I thought adding nixpkgs.system = "aarch64-linux";
to the host configuration is enough to build an aarch64 system from an x86_64 system.
I'm going to try out @cleverca22 's module: https://nixos.wiki/wiki/NixOS_on_ARM#Crosscompiling
from morph.
@kalbasit Thanks for the extra info. Your kernel is not affected, but the wrong ELF-arch of Perl definitely explains the issue.
Based on your question about nixpkgs.system
, I now suspect that what you are seeing is another face of #34. Unfortunately most of the nixpkgs.
-options are not honored by morph, due to the way morph evals machine configs. We are aware of this, and it is clearly a priority to fix it. We just need to decide on the right fix.
from morph.
@leotaku thank you, I'll give it a shot then.
from morph.
@kalbasit Is it possible for you to test with: #67 ?
from morph.
Sure. I'll give it a shot sometime in the next couple of days and get back to you.
from morph.
Please open a new issue if #67 didn't fix this.
from morph.
Related Issues (20)
- Document what names are not possible as machine names.
- Deployment is slow HOT 2
- Morph requires experimental nix-commands to be enabled HOT 5
- Push nodes into their own attrset
- A Question on morph and nix.autoUpgrade HOT 8
- set targetHost at runtime
- add `?compress=true` to ssh store urls
- Require Nix 2.4? HOT 2
- warning: The extraArgs argument to eval-config.nix is deprecated HOT 1
- Check for target host disk space before copying
- Maintaining a per-host gc-root
- Issues with repairing broken path in server HOT 6
- How to use repl to inspect configs? HOT 2
- (option to) use `nix build` instead of `nix-build` HOT 1
- Support alternative sudo authentication methods
- Enhance README with an example and instructions? HOT 1
- Error when building system, caused by extraModuleSources
- Connection fails when deploying, but works outside of morph HOT 1
- `bash: make-build: command not found` HOT 2
- bug: exit `--passcmd` failure cleanly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from morph.