diff --git a/README.md b/README.md index d8cf99c..7f538ed 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,15 @@ netboot 1. `dmesg | grep enp0` <- find the usb interface 2. Disable power saving: `echo -1 | sudo tee /sys/bus/usb/devices/2-1/power/autosuspend`. +Testing netboot +--------------- + +``` +sudo ip tuntap add dev tap0 mode tap user "$USER" +sudo ip link set dev tap0 up +sudo ip link set dev tap0 master br0 +``` + efi: qemu-system-x86_64 \ diff --git a/flake.nix b/flake.nix index d822a56..f214287 100644 --- a/flake.nix +++ b/flake.nix @@ -105,7 +105,9 @@ tmuxbash = super.callPackage ./pkgs/tmuxbash.nix { }; sentinelone = super.callPackage ./pkgs/sentinelone { }; chronoctl = super.callPackage ./pkgs/chronoctl.nix { }; - mrescue = super.callPackage ./pkgs/mrescue.nix { }; + mrescue-alpine = super.callPackage ./pkgs/mrescue-alpine.nix { }; + mrescue-debian-standard = super.callPackage ./pkgs/mrescue-debian-standard.nix { }; + mrescue-debian-xfce = super.callPackage ./pkgs/mrescue-debian-xfce.nix { }; vanta-agent = super.callPackage ./pkgs/vanta-agent.nix { }; gcloud-wrapped = super.callPackage ./pkgs/gcloud-wrapped { }; go-raceless = super.callPackage ./pkgs/go-raceless { inherit (nicer) ; }; @@ -391,7 +393,9 @@ weather gamja chronoctl - mrescue + mrescue-alpine + mrescue-debian-standard + mrescue-debian-xfce sentinelone ; }; diff --git a/hosts/mtworx/configuration.nix b/hosts/mtworx/configuration.nix index ae74815..bd1917d 100644 --- a/hosts/mtworx/configuration.nix +++ b/hosts/mtworx/configuration.nix @@ -16,15 +16,27 @@ let :menu menu PXE Boot Menu - item mrescue Boot mrescue (Rescue System) + item alpine Boot Alpine Linux 3.23.2 + item debian-standard Boot Debian Live 13.3.0 (Standard) + item debian-xfce Boot Debian Live 13.3.0 (XFCE) item netbootxyz Boot netboot.xyz item shell iPXE Shell - choose --default mrescue --timeout 10000 selected || goto menu + choose --default alpine --timeout 10000 selected || goto menu goto ''${selected} - :mrescue - kernel http://10.14.143.1/boot/mrescue/kernel - initrd http://10.14.143.1/boot/mrescue/initrd + :alpine + kernel http://10.14.143.1/boot/alpine/kernel + initrd http://10.14.143.1/boot/alpine/initrd + boot + + :debian-standard + kernel http://10.14.143.1/boot/debian-standard/kernel boot=live components fetch=http://10.14.143.1/boot/debian-standard/filesystem.squashfs + initrd http://10.14.143.1/boot/debian-standard/initrd + boot + + :debian-xfce + kernel http://10.14.143.1/boot/debian-xfce/kernel boot=live components fetch=http://10.14.143.1/boot/debian-xfce/filesystem.squashfs + initrd http://10.14.143.1/boot/debian-xfce/initrd boot :netbootxyz @@ -47,11 +59,26 @@ let # TFTP root directory with all boot files tftp-root = pkgs.runCommand "tftp-root" { } '' - mkdir -p $out/mrescue + mkdir -p $out/alpine + mkdir -p $out/debian-standard + mkdir -p $out/debian-xfce + cp ${customIpxeEfi}/ipxe.efi $out/boot.efi cp ${customIpxeBios}/undionly.kpxe $out/boot.kpxe - cp ${pkgs.mrescue}/kernel $out/mrescue/kernel - cp ${pkgs.mrescue}/initrd $out/mrescue/initrd + + # Alpine + cp ${pkgs.mrescue-alpine}/kernel $out/alpine/kernel + cp ${pkgs.mrescue-alpine}/initrd $out/alpine/initrd + + # Debian Standard + cp ${pkgs.mrescue-debian-standard}/kernel $out/debian-standard/kernel + cp ${pkgs.mrescue-debian-standard}/initrd $out/debian-standard/initrd + cp ${pkgs.mrescue-debian-standard}/filesystem.squashfs $out/debian-standard/filesystem.squashfs + + # Debian XFCE + cp ${pkgs.mrescue-debian-xfce}/kernel $out/debian-xfce/kernel + cp ${pkgs.mrescue-debian-xfce}/initrd $out/debian-xfce/initrd + cp ${pkgs.mrescue-debian-xfce}/filesystem.squashfs $out/debian-xfce/filesystem.squashfs ''; in { diff --git a/pkgs/mrescue.nix b/pkgs/mrescue-alpine.nix similarity index 98% rename from pkgs/mrescue.nix rename to pkgs/mrescue-alpine.nix index bbeb5b6..fd9502a 100644 --- a/pkgs/mrescue.nix +++ b/pkgs/mrescue-alpine.nix @@ -5,7 +5,7 @@ }: stdenv.mkDerivation rec { - pname = "mrescue"; + pname = "mrescue-alpine"; version = "3.23.2"; src = fetchurl { diff --git a/pkgs/mrescue-debian-standard.nix b/pkgs/mrescue-debian-standard.nix new file mode 100644 index 0000000..5e0b4b7 --- /dev/null +++ b/pkgs/mrescue-debian-standard.nix @@ -0,0 +1,45 @@ +{ + pkgs, + stdenv, + fetchurl, +}: + +stdenv.mkDerivation rec { + pname = "mrescue-debian-standard"; + version = "13.3.0"; + + src = fetchurl { + url = "https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-${version}-amd64-standard.iso"; + hash = "sha256-7is9X5vGfYAe7+3b1WmO+7CzU1hyS37T20Yb4/Xn7NY="; + }; + + nativeBuildInputs = with pkgs; [ + p7zip + ]; + + sourceRoot = "."; + + unpackPhase = '' + runHook preUnpack + mkdir debian-live + 7z x -odebian-live $src >/dev/null + runHook postUnpack + ''; + + buildPhase = '' + runHook preBuild + # No build phase needed - files are extracted directly + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + install -Dm644 debian-live/live/vmlinuz $out/kernel + install -Dm644 debian-live/live/initrd.img $out/initrd + install -Dm644 debian-live/live/filesystem.squashfs $out/filesystem.squashfs + + runHook postInstall + ''; +} diff --git a/pkgs/mrescue-debian-xfce.nix b/pkgs/mrescue-debian-xfce.nix new file mode 100644 index 0000000..1d060d2 --- /dev/null +++ b/pkgs/mrescue-debian-xfce.nix @@ -0,0 +1,45 @@ +{ + pkgs, + stdenv, + fetchurl, +}: + +stdenv.mkDerivation rec { + pname = "mrescue-debian-xfce"; + version = "13.3.0"; + + src = fetchurl { + url = "https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-${version}-amd64-xfce.iso"; + hash = "sha256-xvHLR2gOOdsTIu7FrOZdxgfG6keqniEhhf9ywJmtNXQ="; + }; + + nativeBuildInputs = with pkgs; [ + p7zip + ]; + + sourceRoot = "."; + + unpackPhase = '' + runHook preUnpack + mkdir debian-live + 7z x -odebian-live $src >/dev/null + runHook postUnpack + ''; + + buildPhase = '' + runHook preBuild + # No build phase needed - files are extracted directly + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + install -Dm644 debian-live/live/vmlinuz $out/kernel + install -Dm644 debian-live/live/initrd.img $out/initrd + install -Dm644 debian-live/live/filesystem.squashfs $out/filesystem.squashfs + + runHook postInstall + ''; +}