1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-09-11 03:55:23 +03:00

Merge pull request #583 from samueldr-wip/feature/misc-cleanups

boot: Misc. cleanups
This commit is contained in:
Samuel Dionne-Riel 2023-05-05 15:51:33 -04:00 committed by GitHub
commit f5d45fb35f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 14 deletions

View File

@ -102,16 +102,12 @@ module System
# The return format is a hash, with keys being mount point paths,
# and values being their respective line from /proc/mounts.
def self.mount_points()
# This is the most horrible hack :(
mounted_proc = false
unless File.exists?("/proc/mounts")
$logger.debug("Temporarily mounting /proc...")
FileUtils.mkdir_p("/proc")
run("mount", "-t", "proc", "proc", "/proc")
mounted_proc = true
unless File.exists?("/.proc/mounts")
$logger.debug("Mounting private procfs at /.proc...")
FileUtils.mkdir_p("/.proc")
run("mount", "-t", "proc", "proc", "/.proc")
end
result = File.read("/proc/mounts").split("\n")
run("umount", "-f", "/proc") if mounted_proc
result = File.read("/.proc/mounts").split("\n")
result = result.map do |line|
[
@ -122,9 +118,6 @@ module System
]
end.to_h
# We mounted /proc? Hide it! We've now unmounted it.
result.delete("/proc") if mounted_proc
result
end

View File

@ -9,7 +9,7 @@ class Tasks::Symlink < Task
end
def run()
File.symlink(@source, @target)
System.symlink(@source, @target)
end
def name()

View File

@ -10,7 +10,8 @@ lib.mkIf (luks.devices != {} || luks.forceLuksSupportInInitrd) {
luksDevices = luks.devices;
};
kernel = {
modules = [
modules = [ "dm_mod" ];
additionalModules = [
"dm_mod" "dm_crypt" "cryptd" "input_leds"
] ++ luks.cryptoModules
;