diff --git a/machines/storage/s0/configuration.nix b/machines/storage/s0/configuration.nix index 497b8b0..5574351 100644 --- a/machines/storage/s0/configuration.nix +++ b/machines/storage/s0/configuration.nix @@ -28,5 +28,9 @@ services.pykms.enable = true; services.pykms.openFirewallPort = true; + users.users.googlebot.packages = with pkgs; [ + bcachefs-tools + ]; + zramSwap.enable = true; } diff --git a/machines/storage/s0/helios64/115200baud.patch b/machines/storage/s0/helios64/115200baud.patch deleted file mode 100644 index b0fcdd9..0000000 --- a/machines/storage/s0/helios64/115200baud.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts -index 714616618..b1fb824f3 100644 ---- a/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts -+++ b/arch/arm64/boot/dts/rockchip/rk3399-kobol-helios64.dts -@@ -16,6 +16,11 @@ - compatible = "kobol,helios64", "rockchip,rk3399"; - -+ chosen { -+ bootargs = "earlycon=uart8250,mmio32,0xff1a0000 earlyprintk"; -+ stdout-path = "serial2:115200n8"; -+ }; -+ - adc-keys { - compatible = "adc-keys"; diff --git a/machines/storage/s0/helios64/default.nix b/machines/storage/s0/helios64/default.nix index 0357d8a..cb39d37 100644 --- a/machines/storage/s0/helios64/default.nix +++ b/machines/storage/s0/helios64/default.nix @@ -8,15 +8,19 @@ ./modules/usbnet.nix ]; - nixpkgs.overlays = [ - (import ./overlay.nix) - ]; - boot.kernelParams = lib.mkAfter [ "console=ttyS2,115200n8" "earlyprintk" "earlycon=uart8250,mmio32,0xff1a0000" ]; - boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_5_10_helios64; + # disabled because, when enabled, bcachefs wants a different but still adequate kernel + # boot.kernelPackages = pkgs.linuxKernel.packages.linux_5_16; + + # bcachefs kernel is 5.15. but need a patch that is only in 5.16 + # Patch the device tree to add support for getting the cpu thermal temp + hardware.deviceTree.enable = true; + hardware.deviceTree.overlays = [ + ./helios64-cpu-temp.dtbo + ]; } diff --git a/machines/storage/s0/helios64/helios64-cpu-temp.dtbo b/machines/storage/s0/helios64/helios64-cpu-temp.dtbo new file mode 100644 index 0000000..35f8ab3 Binary files /dev/null and b/machines/storage/s0/helios64/helios64-cpu-temp.dtbo differ diff --git a/machines/storage/s0/helios64/helios64-cpu-temp.dts b/machines/storage/s0/helios64/helios64-cpu-temp.dts new file mode 100644 index 0000000..107ee5f --- /dev/null +++ b/machines/storage/s0/helios64/helios64-cpu-temp.dts @@ -0,0 +1,17 @@ +/* rk3399-kobol-helios64.dts */ + +/dts-v1/; +/ { + model = "Kobol Helios64"; + compatible = "kobol,helios64\0rockchip,rk3399"; + fragment@0 { + target-path = "/"; + __overlay__ { + tsadc@ff260000 { + status = "okay"; + rockchip,hw-tshut-mode = <0x01>; + rockchip,hw-tshut-polarity = <0x01>; + }; + }; + }; +}; diff --git a/machines/storage/s0/helios64/modules/bsp/50-usb-realtek-net.rules b/machines/storage/s0/helios64/modules/bsp/50-usb-realtek-net.rules deleted file mode 100644 index 71c9961..0000000 --- a/machines/storage/s0/helios64/modules/bsp/50-usb-realtek-net.rules +++ /dev/null @@ -1,38 +0,0 @@ -# This is used to change the default configuration of Realtek USB ethernet adapters - -ACTION!="add", GOTO="usb_realtek_net_end" -SUBSYSTEM!="usb", GOTO="usb_realtek_net_end" -ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end" - -# Modify this to change the default value -ENV{REALTEK_NIC_MODE}="1" - -# Realtek -ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="0bda", ATTR{idProduct}=="8153", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="0bda", ATTR{idProduct}=="8152", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" - -# Samsung -ATTR{idVendor}=="04e8", ATTR{idProduct}=="a101", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" - -# Lenovo -ATTR{idVendor}=="17ef", ATTR{idProduct}=="304f", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="3052", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="3054", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="3057", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="3082", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="7205", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="720a", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="720b", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="720c", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="721e", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="a359", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" -ATTR{idVendor}=="17ef", ATTR{idProduct}=="a387", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" - -# TP-LINK -ATTR{idVendor}=="2357", ATTR{idProduct}=="0601", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" - -# Nvidia -ATTR{idVendor}=="0955", ATTR{idProduct}=="09ff", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}" - -LABEL="usb_realtek_net_end" diff --git a/machines/storage/s0/helios64/modules/bsp/70-keep-usb-lan-as-eth1.rules b/machines/storage/s0/helios64/modules/bsp/70-keep-usb-lan-as-eth1.rules deleted file mode 100644 index 532abd1..0000000 --- a/machines/storage/s0/helios64/modules/bsp/70-keep-usb-lan-as-eth1.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="net", ACTION=="add", DRIVERS=="r8152", KERNEL=="eth1", NAME="eth1" diff --git a/machines/storage/s0/helios64/modules/bsp/90-helios64-hwmon.rules b/machines/storage/s0/helios64/modules/bsp/90-helios64-hwmon.rules index 59288d3..b43bf4a 100755 --- a/machines/storage/s0/helios64/modules/bsp/90-helios64-hwmon.rules +++ b/machines/storage/s0/helios64/modules/bsp/90-helios64-hwmon.rules @@ -3,15 +3,15 @@ ACTION=="remove", GOTO="helios64_hwmon_end" # -KERNELS=="p6-fan", SUBSYSTEMS=="platform", ENV{_HELIOS64_FAN_}="p6", ENV{_IS_HELIOS64_FAN_}="1", ENV{IS_HELIOS64_HWMON}="1" -KERNELS=="p7-fan", SUBSYSTEMS=="platform", ENV{_HELIOS64_FAN_}="p7", ENV{_IS_HELIOS64_FAN_}="1", ENV{IS_HELIOS64_HWMON}="1" +KERNELS=="fan1", SUBSYSTEMS=="platform", ENV{_HELIOS64_FAN_}="p6", ENV{_IS_HELIOS64_FAN_}="1", ENV{IS_HELIOS64_HWMON}="1" +KERNELS=="fan2", SUBSYSTEMS=="platform", ENV{_HELIOS64_FAN_}="p7", ENV{_IS_HELIOS64_FAN_}="1", ENV{IS_HELIOS64_HWMON}="1" KERNELS=="2-004c", SUBSYSTEMS=="i2c", DRIVERS=="lm75", ENV{IS_HELIOS64_HWMON}="1" SUBSYSTEM!="hwmon", GOTO="helios64_hwmon_end" ENV{HWMON_PATH}="/sys%p" # -ATTR{name}=="cpu", ENV{IS_HELIOS64_HWMON}="1", ENV{HELIOS64_SYMLINK}="/dev/thermal-cpu" +ATTR{name}=="cpu_thermal", ENV{IS_HELIOS64_HWMON}="1", ENV{HELIOS64_SYMLINK}="/dev/thermal-cpu" # ENV{IS_HELIOS64_HWMON}=="1", ATTR{name}=="lm75", ENV{HELIOS64_SYMLINK}="/dev/thermal-board" ENV{_IS_HELIOS64_FAN_}=="1", ENV{HELIOS64_SYMLINK}="/dev/fan-$env{_HELIOS64_FAN_}" diff --git a/machines/storage/s0/helios64/modules/heartbeat.nix b/machines/storage/s0/helios64/modules/heartbeat.nix index 70aa33b..0059c51 100644 --- a/machines/storage/s0/helios64/modules/heartbeat.nix +++ b/machines/storage/s0/helios64/modules/heartbeat.nix @@ -6,12 +6,14 @@ serviceConfig = { Type = "oneshot"; ExecStart = '' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo heartbeat | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:\\:status/trigger' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo netdev | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/trigger' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo eth0 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/device_name' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/link' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/rx' - ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/tx' + ${lib.getBin pkgs.bash}/bin/bash -c 'echo heartbeat | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:green\\:status/trigger' + + # this led is not supported yet in the kernel i'm using + # ${lib.getBin pkgs.bash}/bin/bash -c 'echo netdev | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/trigger' + # ${lib.getBin pkgs.bash}/bin/bash -c 'echo eth0 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/device_name' + # ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/link' + # ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/rx' + # ${lib.getBin pkgs.bash}/bin/bash -c 'echo 1 | ${lib.getBin pkgs.coreutils}/bin/tee /sys/class/leds/helios64\\:blue\\:net/tx' ''; }; after = [ "getty.target" ]; diff --git a/machines/storage/s0/helios64/modules/usbnet.nix b/machines/storage/s0/helios64/modules/usbnet.nix deleted file mode 100644 index 4736710..0000000 --- a/machines/storage/s0/helios64/modules/usbnet.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ pkgs, ... }: - -{ - services.udev.packages = [ - # this one will set the usb net ethernet into the right mode - # and stop it from spamming the console. - (pkgs.callPackage ( - { stdenv, lib, coreutils }: - stdenv.mkDerivation { - name = "helios64-udev-usb-net"; - - dontUnpack = true; - dontBuild = true; - - installPhase = '' - mkdir -p "$out/etc/udev/rules.d/"; - install -Dm644 "${./bsp/50-usb-realtek-net.rules}" \ - "$out/etc/udev/rules.d/50-usb-realtek-net.rules" - install -Dm644 "${./bsp/70-keep-usb-lan-as-eth1.rules}" \ - "$out/etc/udev/rules.d/70-keep-usb-lan-as-eth1.rules" - substituteInPlace "$out/etc/udev/rules.d/50-usb-realtek-net.rules" \ - --replace '/bin/ln' '${lib.getBin coreutils}/bin/ln' - ''; - - meta = with lib; { - description = "Udev rules for the USB network interface for the Helios64"; - platforms = platforms.linux; - }; - } - ) {}) - ]; -} diff --git a/machines/storage/s0/helios64/overlay.nix b/machines/storage/s0/helios64/overlay.nix deleted file mode 100644 index eb26a75..0000000 --- a/machines/storage/s0/helios64/overlay.nix +++ /dev/null @@ -1,75 +0,0 @@ -self: super: { - linux_5_10_helios64 = self.linux_5_10.override { - - kernelPatches = [ - { - name = "helios64-patch-set.patch"; - patch = self.fetchurl { - # v5.10.68..v5.10-helios64-2021-10-10 @ https://github.com/samueldr/linux - # Hosted as a pre-rendered patch because `fetchpatch` strips added files. - url = "https://gist.githubusercontent.com/samueldr/1a409f88f2107054c87a70403686b871/raw/abee3d5d5415c466f8111371b63f759f614547c6/helios64.patch"; - sha256 = "1gx2z345vb4r2mdfmydbzc5baj58rrn416rzb2fz7azxpyib5ym4"; - }; - } - { name = "115200 baud"; patch = ./115200baud.patch; } - ]; - - # Configuration mainly to remove unused platforms and things. - structuredExtraConfig = with self.lib.kernel; { - ARCH_ROCKCHIP = yes; - - ARCH_ACTIONS = no; - ARCH_AGILEX = no; - ARCH_SUNXI = no; - ARCH_ALPINE = no; - ARCH_BCM2835 = no; - ARCH_BERLIN = no; - ARCH_BRCMSTB = no; - ARCH_EXYNOS = no; - ARCH_K3 = no; - ARCH_LAYERSCAPE = no; - ARCH_LG1K = no; - ARCH_HISI = no; - ARCH_MEDIATEK = no; - ARCH_MESON = no; - ARCH_MVEBU = no; - ARCH_MXC = no; - ARCH_QCOM = no; - ARCH_RENESAS = no; - ARCH_S32 = no; - ARCH_SEATTLE = no; - ARCH_STRATIX10 = no; - ARCH_SYNQUACER = no; - ARCH_TEGRA = no; - ARCH_SPRD = no; - ARCH_THUNDER = no; - ARCH_THUNDER2 = no; - ARCH_UNIPHIER = no; - ARCH_VEXPRESS = no; - ARCH_VISCONTI = no; - ARCH_XGENE = no; - ARCH_ZX = no; - ARCH_ZYNQMP = no; - ARCH_RANDOM = no; - ARCH_R8A77995 = no; - ARCH_R8A77990 = no; - ARCH_R8A77950 = no; - ARCH_R8A77951 = no; - ARCH_R8A77965 = no; - ARCH_R8A77960 = no; - ARCH_R8A77961 = no; - ARCH_R8A77980 = no; - ARCH_R8A77970 = no; - ARCH_R8A774C0 = no; - ARCH_R8A774E1 = no; - ARCH_R8A774A1 = no; - ARCH_R8A774B1 = no; - ARCH_STACKWALK = no; - }; - }; - - # Force modules closure to be built even if some modules are missing - # (Workaround for a NixOS change in strictness) - makeModulesClosure = x: - super.makeModulesClosure (x // { allowMissing = true; }); -}