Compare commits
3 Commits
420552ce98
...
812e35b7b9
Author | SHA1 | Date | |
---|---|---|---|
812e35b7b9 | |||
172f368633 | |||
1af9a39db1 |
@ -225,11 +225,6 @@
|
|||||||
# WARNING: unmet direct dependencies detected for ARCH_WANT_LIBATA_LEDS
|
# WARNING: unmet direct dependencies detected for ARCH_WANT_LIBATA_LEDS
|
||||||
ATA = "y";
|
ATA = "y";
|
||||||
|
|
||||||
PSTORE = "y";
|
|
||||||
PSTORE_RAM = "y";
|
|
||||||
PSTORE_CONSOLE = "y";
|
|
||||||
# PSTORE_DEFLATE_COMPRESS = "n";
|
|
||||||
|
|
||||||
BLOCK = "y";
|
BLOCK = "y";
|
||||||
MMC="y";
|
MMC="y";
|
||||||
PWRSEQ_EMMC="y"; # ???
|
PWRSEQ_EMMC="y"; # ???
|
||||||
|
@ -138,9 +138,15 @@ Logs written to :file:`/run/log/` will not survive a reboot or crash,
|
|||||||
as it is an ephemeral filesystem.
|
as it is an ephemeral filesystem.
|
||||||
|
|
||||||
On supported hardware you can enable logging to `pstore
|
On supported hardware you can enable logging to `pstore
|
||||||
<https://www.kernel.org/doc/Documentation/ABI/testing/pstore>` which
|
<https://www.kernel.org/doc/Documentation/ABI/testing/pstore>`_ which
|
||||||
means the most recent log messages will be preserved on reboot.
|
means the most recent log messages will be preserved on reboot. Set
|
||||||
Set the config option ``logging.persistent.enable = true``, log messages will be written to :file:/dev/pmsg0. After rebooting,
|
the config option ``logging.persistent.enable = true`` to log messages
|
||||||
|
to :file:`/dev/pmsg0` as well as to the regular log. This is a
|
||||||
|
circular buffer, so when it fills up newer messages will overwrite the
|
||||||
|
oldest messages.
|
||||||
|
|
||||||
|
To check the previous messages after a (planned or forced) reboot,
|
||||||
|
you need to mooun the pstore filesystem.
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
|
@ -56,31 +56,31 @@ let
|
|||||||
else "";
|
else "";
|
||||||
in "unlink(${qpathname}); ${cmd} ${chown}";
|
in "unlink(${qpathname}); ${cmd} ${chown}";
|
||||||
in mapAttrsToList (makeFile prefix) attrset;
|
in mapAttrsToList (makeFile prefix) attrset;
|
||||||
activateScript = attrset: writeText "makedevs.c" ''
|
in attrset:
|
||||||
|
let
|
||||||
|
activateScript = writeText "activate.c" ''
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
chdir(argv[1]);
|
chdir(argv[1]);
|
||||||
${(builtins.concatStringsSep "\n" (visit "." attrset))}
|
${(builtins.concatStringsSep "\n" (visit "." attrset))}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in attrset:
|
|
||||||
let makedevs = activateScript attrset;
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name="make-stuff";
|
name="system-configuration";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
CFLAGS = "-Os";
|
CFLAGS = "-Os";
|
||||||
LDFLAGS = "-static -Xlinker -static";
|
LDFLAGS = "-static -Xlinker -static";
|
||||||
|
|
||||||
postConfigure = ''
|
postConfigure = ''
|
||||||
cp ${makedevs} makedevs.c
|
cp ${activateScript} activate.c
|
||||||
'';
|
'';
|
||||||
makeFlags = ["makedevs"];
|
makeFlags = ["activate"];
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
closure=${closureInfo { rootPaths = [ makedevs ]; }}
|
closure=${closureInfo { rootPaths = [ activateScript ]; }}
|
||||||
mkdir -p $out/bin $out/etc
|
mkdir -p $out/bin $out/etc
|
||||||
cp $closure/store-paths $out/etc/nix-store-paths
|
cp $closure/store-paths $out/etc/nix-store-paths
|
||||||
$STRIP --remove-section=.note --remove-section=.comment --strip-all makedevs -o $out/bin/activate
|
$STRIP --remove-section=.note --remove-section=.comment --strip-all activate -o $out/bin/activate
|
||||||
ln -s ${s6-init-bin}/bin/init $out/bin/init
|
ln -s ${s6-init-bin}/bin/init $out/bin/init
|
||||||
cp -p ${writeFennel "restart-services" {} ./restart-services.fnl} $out/bin/restart-services
|
cp -p ${writeFennel "restart-services" {} ./restart-services.fnl} $out/bin/restart-services
|
||||||
# obfuscate the store path of min-copy-closure so that the output
|
# obfuscate the store path of min-copy-closure so that the output
|
||||||
|
Loading…
Reference in New Issue
Block a user