1
0

Compare commits

..

6 Commits

Author SHA1 Message Date
3608cc5e33 add kenrel command line cookie to mips-vm script 2023-03-24 18:48:38 +00:00
c831859513 add flashcp to allow flashing from a running system 2023-03-24 17:32:46 +00:00
404162ac1e support all kinds of boot for arhcive
now we can have flashable and tftpboot in the same configuration
2023-03-24 17:14:15 +00:00
045f10e79b build kexec statically 2023-03-24 17:12:19 +00:00
4ea60a6082 watchdog support for mt300n-v2 2023-03-24 17:11:36 +00:00
561d55ed5f arhcive: rsync daemon needs a group 2023-03-24 17:10:49 +00:00
6 changed files with 27 additions and 8 deletions

View File

@ -167,6 +167,10 @@
BRIDGE_VLAN_FILTERING = "y";
BRIDGE_IGMP_SNOOPING = "y";
WATCHDOG = "y";
RALINK_WDT = "y"; # watchdog
MT7621_WDT = "y"; # or it might be this one
GPIOLIB="y";
GPIO_MT7621 = "y";

View File

@ -34,7 +34,8 @@ in rec {
imports = [
../modules/tftpboot.nix
../modules/wlan.nix
# ./modules/flashable.nix
../modules/flashable.nix
../modules/kexecboot.nix
];
hostname = "arhcive";
@ -181,12 +182,13 @@ in rec {
};
configFile = writeText "rsync.conf" ''
pid file = /run/rsyncd.pid
uid = store
uid = backup
[srv]
path = /srv
use chroot = yes
auth users = backup
read only = false
gid = backup
secrets file = ${secrets_file}/.outputs/secrets
'';
in longrun {
@ -201,12 +203,12 @@ in rec {
] ;
};
services.default = target {
services.default = target {
name = "default";
contents =
let links = config.hardware.networkInterfaces;
in with config.services; [
links.lo links.eth links.wlan
links.lo
defaultroute4
resolvconf
sshd
@ -222,9 +224,12 @@ in rec {
# ];
};
users.store = {
users.backup = {
uid=500; gid=500; gecos="Storage owner"; dir="/srv";
shell="/dev/null"; # authorizedKeys = [];
shell="/dev/null";
};
groups.backup = {
gid=500; usernames = ["backup"];
};
defaultProfile.packages = with pkgs; [e2fsprogs strace tcpdump ];

View File

@ -17,6 +17,10 @@ in {
};
};
programs.busybox.applets = [
"flashcp"
];
outputs.firmware =
let o = config.outputs; in
pkgs.runCommand "firmware" {} ''

View File

@ -26,7 +26,6 @@ in {
outputs.boot-sh =
let
inherit (pkgs) kexec-tools;
inherit (pkgs.lib.trivial) toHexString;
inherit (config.outputs) squashfs kernel;
cmdline = concatStringsSep " " config.boot.commandLine;

View File

@ -17,6 +17,13 @@ extraPkgs // {
strace = prev.strace.override { libunwind = null; };
kexec-tools = prev.kexec-tools.overrideAttrs(o: {
# For kexecboot we copy kexec into a ramdisk on the system being
# upgraded from. This is more likely to work if kexec is
# statically linked so doesn't have dependencies on store paths that
# may not exist on that machine. (We can't nix-copy-closure as
# the store may not be on a writable filesystem)
LDFLAGS = "-static";
patches = o.patches ++ [
(fetchpatch {
# merge user command line options into DTB chosen

View File

@ -29,7 +29,7 @@ echo $QEMU_OPTIONS
qemu-system-mips \
-M malta -m 256 \
-echr 16 \
-append "default console=ttyS0,38400n8 panic=10 oops=panic init=$INIT loglevel=8 root=/dev/vda" \
-append "liminix default console=ttyS0,38400n8 panic=10 oops=panic init=$INIT loglevel=8 root=/dev/vda" \
-drive file=$2,format=raw,readonly=on,if=virtio \
-netdev socket,id=access,mcast=230.0.0.1:1234,localaddr=127.0.0.1 \
-device virtio-net-pci,disable-legacy=on,disable-modern=off,netdev=access,mac=ba:ad:1d:ea:21:02 \