From 1629d13fd74dd3d24306cdc95bb8524abbf48594 Mon Sep 17 00:00:00 2001 From: Alexander Sosedkin Date: Wed, 8 Dec 2021 21:48:38 +0100 Subject: [PATCH] pkgs/nix-directory: stop using qemu-user to init nix db --- README.md | 2 +- pkgs/default.nix | 3 +-- pkgs/nix-directory.nix | 14 +++++--------- pkgs/qemu-aarch64-static.nix | 15 --------------- 4 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 pkgs/qemu-aarch64-static.nix diff --git a/README.md b/README.md index 05bb6ab..ee510c8 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ Developer's device: 1. `proot` for the target platform is cross-compiled against `bionic`, (to fake file paths like `/nix/store`; think 'userspace `chroot`') 2. Target `nix` is taken from the original release tarball -3. Target `nix` database is initialized (with host `proot` and `qemu-user`) +3. Target `nix` database is initialized (using host `proot`) 4. Support scripts and config files are built with `nix` and the Nix-on-Droid module system 5. From these, a bootstrap zipball is built and published on an HTTP server diff --git a/pkgs/default.nix b/pkgs/default.nix index eaef45c..feb2703 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2020, see AUTHORS. Licensed under MIT License, see LICENSE. +# Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE. { arch, nixOnDroidChannelURL ? null, nixpkgsChannelURL ? null }: @@ -44,7 +44,6 @@ let bootstrap = callPackage ./bootstrap.nix { }; bootstrapZip = callPackage ./bootstrap-zip.nix { }; prootTermux = callPackage ./cross-compiling/proot-termux.nix { }; - qemuAarch64Static = callPackage ./qemu-aarch64-static.nix { }; tallocStatic = callPackage ./cross-compiling/talloc-static.nix { }; }; in diff --git a/pkgs/nix-directory.nix b/pkgs/nix-directory.nix index e3b6642..c9261f5 100644 --- a/pkgs/nix-directory.nix +++ b/pkgs/nix-directory.nix @@ -1,17 +1,13 @@ # Copyright (c) 2019-2021, see AUTHORS. Licensed under MIT License, see LICENSE. -{ config, lib, stdenv, closureInfo, prootTermux, proot, qemuAarch64Static }: +{ config, lib, stdenv, closureInfo, prootTermux, proot, pkgsStatic }: let buildRootDirectory = "root-directory"; prootCommand = lib.concatStringsSep " " [ "${proot}/bin/proot" - ( - if config.build.arch == "aarch64" - then "-q ${qemuAarch64Static}/bin/qemu-aarch64-static" - else "-b /dev" - ) + "-b ${pkgsStatic.nix}:/static-nix" "-r ${buildRootDirectory}" "-w /" ]; @@ -56,9 +52,9 @@ stdenv.mkDerivation { cp --archive "$i" "${buildRootDirectory}$i" done - USER=${config.user.userName} ${prootCommand} "$PKG_NIX/bin/nix-store" --init - USER=${config.user.userName} ${prootCommand} "$PKG_NIX/bin/nix-store" --load-db < .reginfo - USER=${config.user.userName} ${prootCommand} "$PKG_NIX/bin/nix-store" --load-db < ${prootTermuxClosure}/registration + USER=${config.user.userName} ${prootCommand} "/static-nix/bin/nix-store" --init + USER=${config.user.userName} ${prootCommand} "/static-nix/bin/nix-store" --load-db < .reginfo + USER=${config.user.userName} ${prootCommand} "/static-nix/bin/nix-store" --load-db < ${prootTermuxClosure}/registration cat > package-info.nix <