summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader/systemd-boot
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-04-20 00:22:31 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-04-20 00:37:02 +0200
commite662e035f9ed4d125c7534bc65e01fc73a0b0f62 (patch)
tree0549a35cc251aa0262c21c67df9da145d1590151 /nixos/modules/system/boot/loader/systemd-boot
parent0602b9d1943591d1ee9b056fca7919af8696d599 (diff)
downloadnixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar.gz
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar.bz2
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar.lz
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar.xz
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.tar.zst
nixlib-e662e035f9ed4d125c7534bc65e01fc73a0b0f62.zip
nixos/systemd-boot-builder: Don't write .pyc files
This has surfaced since d990aa716327abb018e8352dcf7ba2fcfb4fc34c.

The "simpleUefiGummiboot" installer test fails since this commit,
because that commit introduced a small check to verify whether the store
was altered.

While installing NixOS for the first time, the store is usually in
/mnt/nix/store and without the read-only bind mount that's preventing
programs from altering the store.

So after nixos-install is done creating the system closure and setting
it as the active system profile, the bootloader is written from the
closure inside the chroot. The systemd-boot-builder is invoked during
this step, which adds .pyc files for various Python modules of the
Python 3 store path, which in turn invalidates the hash of the Python 3
store path itself.

At the time the system is booted up again, the nix-store is verified and
fails with something like this:

path /nix/store/zvm545rqc4d97caqq9h7344bnd06jhzb-python3-3.5.3 was
modified! expected hash
b2c975f4b8d197443fbb09690fb3f6545e165dd44c9309d7d6df2fce0579ebeb, got
bccca19f39c9d26d857ccf1fb72818b2b817967e6d497a25a1283e36ed0acf01

Running the interpreter with the -B argument prevents Python from
writing those byte code files:

https://docs.python.org/3/using/cmdline.html#cmdoption-B

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/system/boot/loader/systemd-boot')
-rw-r--r--nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
index d5e00129a82c..704c574b822e 100644
--- a/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
+++ b/nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
@@ -1,4 +1,4 @@
-#! @python3@/bin/python3
+#! @python3@/bin/python3 -B
 import argparse
 import shutil
 import os