mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 04:58:21 +00:00
41 lines
11 KiB
HTML
41 lines
11 KiB
HTML
|
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>systemd-boot</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
||
|
MathJax = {
|
||
|
tex: {
|
||
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
||
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
||
|
},
|
||
|
options = {
|
||
|
processHtmlClass = "math"
|
||
|
}
|
||
|
}
|
||
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>systemd-boot</h1><section class="post-metadata"><span>Date: <!-- -->2021-08-07 20:08:09 +08:00</span><span>Date modified: <!-- -->2022-05-22 21:24:33 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"></ol></nav><p>systemd also comes with a bootloader aptly named <code class="inline-verbatim">systemd-boot</code> though it only supports UEFI-based firmware.
|
||
|
Just like GRUB, they can be configured through plain-text files.
|
||
|
</p><p>For detailed information about the bootloader, see the manual page <code class="inline-verbatim">systemd-boot.7</code>.
|
||
|
</p><p>With a complete installation, the bootloader config folder may look like the following list.
|
||
|
</p><pre class="src-block"><code>/boot/
|
||
|
`-- loader
|
||
|
|-- entries # (ref:loader-entries)
|
||
|
| `-- arch.conf
|
||
|
|-- loader.conf # (ref:loader-conf)
|
||
|
`-- random-seed
|
||
|
</code></pre><ul><li><p><a href="/wiki/(loader-entries)"><code class="inline-verbatim">loader/entries/</code></a> is a directory containing all of the entries available to be booted.
|
||
|
</p></li><li><p><a href="/wiki/(loader-conf)"><code class="inline-verbatim">loader.conf</code></a> contains the loader configuration.
|
||
|
</p></li></ul><p>Most Linux distros with systemd installed should have a sample config file somewhere. <!-- -->
|
||
|
As an example, we'll show what those look like.
|
||
|
</p><p><code class="inline-verbatim">loader.conf</code> is the configuration for the boot loader including the timeout seconds among others.
|
||
|
Here is a sample of a bootloader configuration.
|
||
|
</p><pre class="src-block"><code>default arch
|
||
|
timeout 4
|
||
|
</code></pre><p>In this config, this simply makes the <code class="inline-verbatim">arch</code> loader entry to be default when no actions has occurred.
|
||
|
It will start loading it automatically after a timeout of 4 seconds.
|
||
|
</p><p>The <code class="inline-verbatim">arch</code> loader entry can be found at <code class="inline-verbatim">${ESP}/loader/entries/arch.conf</code>.
|
||
|
The following code block shows what a loader entry looks like.
|
||
|
</p><pre class="src-block"><code>title Arch Linux
|
||
|
linux /vmlinuz-linux
|
||
|
initrd /initramfs-linux.img
|
||
|
options root="PARTUUID=${PARTUUID}"
|
||
|
</code></pre><p>You can customize and create extra entries for the same installation.
|
||
|
This is what <a href="/wiki/linux.distros.nixos">NixOS</a> does with its system generations, letting the user to boot to a specific point in time from the boot loader.
|
||
|
Very useful for emergency boots in case the current generation breaks for whatever reason.
|
||
|
</p><p>For complete details of the configuration file, you can see <code class="inline-verbatim">loader.conf.5</code> manual page.
|
||
|
</p><section><h2>Backlinks</h2><ul><li><a href="/wiki/linux.systemd">systemd</a></li></ul></section></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"2021-08-07 20:08:09 +08:00","date_modified":"2022-05-22 21:24:33 +08:00","language":"en","source":""},"title":"systemd-boot","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"systemd also comes with a bootloader aptly named "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd-boot"}]},{"type":"text","value":" though it only supports UEFI-based firmware.\nJust like GRUB, they can be configured through plain-text files.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"For detailed information about the bootloader, see the manual page "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd-boot.7"}]},{"type":"text","value":".\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With a complete installation, the bootloader config folder may look like the following list.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/boot/\n`-- loader\n |-- entries # (ref:loader-entries)\n | `-- arch.conf\n |-- loader.conf # (ref:loader-conf)\n `-- random-seed\n"}]}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/(loader-entries)"},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"loader/entries/"}]}]},{"type":"text","value":" is a directory containing all of the entries available to be booted.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/(loader-conf)"},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"loader.conf"}]}]},{"type":"text","value":" contains the loader configuration.\n"}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Most Linux distros with systemd installed should have a sample config file somewhere. "},{"type":"text","value":"\nAs an example, we'll show what those look like.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"loader.conf"}]},{"type":"text","value":" is the configuration for the boot loader including the timeout seconds among others.\nHere is a sample of a bootloader configuration.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"default arch\ntimeout 4\n"}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this config, this simply makes the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"arch"}]},{"type":"text","value":" loader entry to be default when no actions has occurred.\nIt will start loading it automatically after a timeout of 4 seconds.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The "},{"type":"element","tagName":"code","propertie
|