patches and low-level development discussion
 help / color / mirror / code / Atom feed
ae4dd6579f5a335fe4b2ce0ceed5b0a1b8582d20 blob 1645 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
{ runCommandNoCC, writeScript, writeReferencesToFile, makeFontsConf, lib
, dash, execline, s6, s6-rc, s6-portable-utils, s6-linux-utils, s6-linux-init, busybox
, mesa, squashfs-tools-ng, makeDBusConf
}:

{ services, rcServices ? {}, fonts ? [], path ? [] }:

let
  stage1 = import ./stage1.nix {
    inherit writeScript lib
      execline s6 s6-rc s6-portable-utils s6-linux-utils s6-linux-init busybox mesa
      path;
  };

  makeServicesDir = import ./services.nix {
    inherit runCommandNoCC writeScript lib execline;
  };

  makeRcServicesDir = import ./rc-services.nix {
    inherit runCommandNoCC lib s6-rc;
  };

  fontsConf = makeFontsConf { fontDirectories = fonts; };

  squashfs = runCommandNoCC "root-squashfs" {} ''
    cd ${rootfs}
    (
        grep -v ^${rootfs} ${writeReferencesToFile rootfs}
        printf "%s\n" *
    ) \
        | xargs tar -cP --owner root:0 --group root:0 --hard-dereference \
        | ${squashfs-tools-ng}/bin/tar2sqfs -c gzip -X level=1 $out
  '';

  rootfs = runCommandNoCC "rootfs" { passthru = { inherit squashfs; }; } ''
    mkdir $out
    cd $out

    mkdir -p bin sbin dev proc run sys tmp var/lib
    ln -s /run var/run
    ln -s ${dash}/bin/dash bin/sh
    ln -s ${stage1} sbin/init
    cp -r ${./etc} etc
    chmod u+w etc
    ln -s ${makeDBusConf {
      suidHelper = "/run/dbus-daemon-launch-helper";
      serviceDirectories = [];
    }} etc/dbus-1

    mkdir etc/fonts
    ln -s ${fontsConf} etc/fonts/fonts.conf

    touch etc/login.defs
    cp -r ${makeServicesDir { inherit services; }} etc/service
    cp -r ${makeRcServicesDir { services = rcServices; }} etc/s6-rc
  '';
in
rootfs
debug log:

solving ae4dd6579f5 ...
found ae4dd6579f5 in https://spectrum-os.org/git/nixpkgs

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).