1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 21:41:53 +03:00
mobile-nixos/boot/init/main.rb
Samuel Dionne-Riel bdee7cf0e0 boot/init: Removes SingletonTask special dependency
Instead, rely on targets.

Additionally removes the "Boot" special dependency which only made sense
when it was expected that having no dependency was an error.
2020-02-03 16:19:10 -05:00

39 lines
977 B
Ruby

# TODO: Allow defining depending on stage-0/stage-1.
STAGE = 1
log("************************")
log("* Mobile NixOS stage-#{STAGE} *")
log("************************")
log("")
log("Built for device #{Configuration["device"]["name"]}")
log("")
# This file is a hard-coded map of non-implicit tasks.
# To these tasks, add all Singleton tasks found under tasks/*
# Without any added dependency, show a first splash ASAP
Tasks::Splash.new("stage-0")
# Some software (mainly extfs tools) bark angrily and fail when this is missing.
Tasks::Symlink.new("/proc/mounts", "/etc/mtab")
Mounting.create_special_mount_points()
Mounting.create_boot_mount_points()
[
"/etc/udev",
"/var/log",
].each do |dir|
Tasks::Directory.new(dir)
end
Tasks::Splash.new("stage-1")
.add_dependency(:Target, :Devices)
Tasks::Modules.new(*Configuration["kernel"]["modules"])
Tasks::go()
$logger.fatal("Tasks all ran, but we're still here...")
System.failure("did_not_switch", color: "ff0000")