Browse Source

Remove custom bootloader

Signed-off-by: Magic_RB <magic_rb@redalder.org>
master
Magic_RB 2 weeks ago
parent
commit
64bcf63a30
Signed by: Magic_RB GPG Key ID: 08D5287CC5DDCA0E
3 changed files with 0 additions and 119 deletions
  1. +0
    -36
      lib/make-bootloader/default.nix
  2. +0
    -10
      lib/make-bootloader/init.sh
  3. +0
    -73
      overlay/bootloader-linux.nix

+ 0
- 36
lib/make-bootloader/default.nix View File

@ -1,36 +0,0 @@
{ system, pkgs
, writeTextFile
, runCommandNoCC
, bootloaderLinux
, nglib
, name ? "bootloader"
, kernelExtraConfig ? {}
}:
let
init = runCommandNoCC "${name}-init"
{ nativeBuildInputs = [ pkgs.busybox ];
inherit (pkgs) busybox bash;
}
''
mkdir -p $out
substituteAll ${pkgs.writeShellScript "init" (builtins.readFile ./init.sh)} $out/init
chmod +x $out/init
'';
linux = bootloaderLinux {
extraConfig = kernelExtraConfig;
initramfs = nglib.makeInitramfs {
name = "initramfs.cpio";
path = nglib.makeBundle { path = init; name = "init"; };
compress = false;
};
};
in
runCommandNoCC name (with pkgs; {
inherit busybox;
nativeBuildInputs = [ pkgs.busybox ];
})
''
cp ${linux}/bzImage $out
''

+ 0
- 10
lib/make-bootloader/init.sh View File

@ -1,10 +0,0 @@
export PATH=$PATH:@bash@/bin:@busybox@/bin
# mkdir -p /dev /proc /sys /run
# mount -n -t devtmpfs devtmpfs /dev
# mount -n -t proc proc /proc
# mount -n -t sysfs sysfs /sys
# mount -n -t tmpfs tmpfs /run
echo "Hello, world!"
# bash -c 'echo "sdfdsaf"'

+ 0
- 73
overlay/bootloader-linux.nix View File

@ -1,73 +0,0 @@
{ callPackage
, lib
, tinyLinux
}:
{ initramfs
, extraConfig ? {}
}:
tinyLinux.override {
extraConfig = {
# EFI boot and EFI stub
CONFIG_EFI="y";
CONFIG_EFI_STUB="y";
# Enable 64-bit
CONFIG_64BIT="y";
CONFIG_X86_64="y";
# TTY stuff
CONFIG_TTY="y";
CONFIG_VT="y";
CONFIG_VT_CONSOLE="y";
CONFIG_UNIX98_PTYS="y";
CONFIG_LEGACY_PTYS="y";
CONFIG_LEGACY_PTY_COUNT="256";
CONFIG_LDISC_AUTOLOAD="y";
# Serial console, makes it work in QEMU
CONFIG_SERIAL_8250="y";
CONFIG_SERIAL_8250_CONSOLE="y";
# Enables some advanced options, like the printk one
CONFIG_EMBEDDED="y";
# Enable PC speaker, beep boop
CONFIG_PCSPKR_PLATFORM="y";
# Debug logs during boot are always handy
CONFIG_PRINTK="y";
CONFIG_RD_GZIP="y";
# Initrd things, perhaps make the compression configurable?
CONFIG_BLK_DEV_INITRD="y";
CONFIG_INITRAMFS_SOURCE=''"${initramfs}"'';
# CONFIG_INITRAMFS_COMPRESSION="gzip";
# CONFIG_INITRAMFS_COMPRESSION_GZIP="y";
# Required for shebangs
CONFIG_BINFMT_ELF="y"; # general execution
CONFIG_BINFMT_SCRIPT="y"; # bash shebang
## Filesystems
# proc
CONFIG_PROC_FS="y";
CONFIG_PROC_SYSCTL="y";
CONFIG_PROC_PAGE_MONITOR="n";
# sys
CONFIG_SYSFS="y";
# configfs - TODO do we need it?
CONFIG_CONFIGFS_FS="y";
# devtmpfs
CONFIG_DEVTMPFS="y";
## Networking
CONFIG_NET="y"; # NET
# Unix Domain Sockets
CONFIG_UNIX="y"; # udevd
# inotify
CONFIG_INOTIFY_USER="y"; # udevd
CONFIG_KEXEC="y";
CONFIG_BLOCK="y";
} // extraConfig;
}

Loading…
Cancel
Save