Netboot: Difference between revisions

Nh2 (talk | contribs)
Clarify how to run the second example
Nh2 (talk | contribs)
Link issue
 
(2 intermediate revisions by the same user not shown)
Line 49: Line 49:
</syntaxHighlight>Building:<syntaxhighlight lang="bash">
</syntaxHighlight>Building:<syntaxhighlight lang="bash">
# Build pixiecore runner
# Build pixiecore runner
nix build -f system.nix -o /tmp/run-pixiecore
nix-build system.nix -o /tmp/run-pixiecore
</syntaxhighlight>Running:<syntaxhighlight lang="bash">
</syntaxhighlight>Running:<syntaxhighlight lang="bash">
# Open required firewall ports
# Open required firewall ports
Line 127: Line 127:
     modules = [
     modules = [
       <nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix>
       <nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix>
      # Reduce build time by ~7x (~1 minute instead of many minutes) by not using the highest compression (image is 5% larger).
      ({ ... }: { netboot.squashfsCompression = "zstd -Xcompression-level 6"; })
       version-module
       version-module
       example-configuration
       example-configuration
Line 205: Line 207:


in
in
if legacy then run-dnsmasq else run-pixiecore}}
if legacy then run-dnsmasq else run-pixiecore|name=netboot.nix|lang=nix}}


Building:
Building:
<syntaxhighlight lang="bash"># Build pixiecore runner
<syntaxhighlight lang="bash"># Build pixiecore runner
nix build -f netboot.nix -o /tmp/run-pixiecore
nix-build netboot.nix -o /tmp/run-pixiecore


# Build dnsmasq + pxelinux runner
# Build dnsmasq + pxelinux runner
nix build -f netboot.nix --arg legacy true -o /tmp/run-dnsmasq
nix-build netboot.nix --arg legacy true -o /tmp/run-dnsmasq


# Build for some ancient system with a serial console
# Build for some ancient system with a serial console
nix build -f netboot.nix --arg name '"ancient-netboot"' -o /tmp/run-netboot \
nix-build netboot.nix --arg name '"ancient-netboot"' -o /tmp/run-netboot \
   --arg configuration 'import ./ancient-config.nix' \
   --arg configuration 'import ./ancient-config.nix' \
   --arg legacy true --arg proxynets '["10.2.1.0"]' \
   --arg legacy true --arg proxynets '["10.2.1.0"]' \
Line 221: Line 223:


* Run the example exactly like the other example further up on the page.
* Run the example exactly like the other example further up on the page.
=== Troubleshooting ===
* Error "'''autoexec.ipxe... Operation not supported'''": See [https://github.com/NixOS/nixpkgs/pull/378513#pullrequestreview-3081586117 this issue].


=== See also ===
=== See also ===