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:
commit
f5d45fb35f
@ -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
|
||||
|
||||
|
@ -9,7 +9,7 @@ class Tasks::Symlink < Task
|
||||
end
|
||||
|
||||
def run()
|
||||
File.symlink(@source, @target)
|
||||
System.symlink(@source, @target)
|
||||
end
|
||||
|
||||
def name()
|
||||
|
@ -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
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user