From c3a8e89a4bfab3c64c94fc6df42e94b231be4bff Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Fri, 20 Dec 2024 23:19:18 +0100 Subject: initial attempt at rmpp emulation --- server.nix | 76 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 25 deletions(-) (limited to 'server.nix') diff --git a/server.nix b/server.nix index 31462cd..906e2c6 100644 --- a/server.nix +++ b/server.nix @@ -1,5 +1,5 @@ -{ fetchurl, writeText, libguestfs-with-appliance, pkgsCross, qemu, runCommand -, writeShellApplication, sshPassword, sshPort, httpPort }: +{ lib, fetchurl, writeText, libguestfs-with-appliance, pkgsCross, qemu +, runCommand, cpio, writeShellApplication, sshPassword, sshPort, httpPort }: let updateName = "remarkable-ct-prototype-image-3.16.1.0-ferrari-public"; @@ -7,7 +7,7 @@ let url = # TODO: this is not an official source. might be worth authenticating the updates "https://storage.googleapis.com/remarkable-versions/${updateName}.swu"; - hash = ""; + hash = "sha256-cwx2qcvxZBX0wAprYKls8P+gthwJJQTceVIO+qdPm/w="; }; xochitlConfig = writeText "xochitl.conf" '' @@ -42,14 +42,16 @@ let WantedBy=multi-user.target ''; - fakefbdev = pkgsCross.remarkable2.gcc11Stdenv.mkDerivation { + fakefbdev = pkgsCross.aarch64-multiplatform.gcc11Stdenv.mkDerivation { name = "fakefbdev"; src = ./fakefbdev; installFlags = [ "DESTDIR=${placeholder "out"}" ]; }; - rootfsImage = runCommand "rm-rootfs.ext4" '' + kernel = pkgsCross.aarch64-multiplatform.linux; + + rootfsImage = runCommand "rm-rootfs.ext4" { nativeBuildInputs = [ cpio ]; } '' cpio -i --file ${updateArchive} gzip -dc ${updateName}.ext4.verity.gz > $out ''; @@ -62,35 +64,62 @@ let guestfish --rw --blocksize=512 --add $out <