1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-28 02:55:38 +02:00
tldr/pages/linux/mkinitcpio.md

37 lines
1.2 KiB
Markdown
Raw Normal View History

2021-02-18 20:09:54 -03:00
# mkinitcpio
> Generate initial ramdisk environments for booting the Linux kernel based on the specified preset(s).
> More information: <https://manned.org/mkinitcpio.8>.
2021-02-18 20:09:54 -03:00
- Perform a dry run (print what would be done without actually doing it):
`mkinitcpio`
2025-04-28 20:48:35 +03:00
- Generate ramdisk environments based on all existing presets (used to regenerate all the initramfs images after a change in `/etc/mkinitcpio.conf`):
2021-02-18 20:09:54 -03:00
2025-04-28 20:48:35 +03:00
`sudo mkinitcpio {{[-P|--allpresets]}}`
2021-02-18 20:09:54 -03:00
2025-04-28 20:48:35 +03:00
- Generate a ramdisk environment based on the `linux` preset:
2021-02-18 20:09:54 -03:00
2025-04-28 20:48:35 +03:00
`sudo mkinitcpio {{[-p|--preset]}} {{linux}}`
2021-02-18 20:09:54 -03:00
2025-04-28 20:48:35 +03:00
- Generate a ramdisk environment based on the `linux-lts` preset:
2021-02-18 20:09:54 -03:00
2025-04-28 20:48:35 +03:00
`sudo mkinitcpio {{[-p|--preset]}} {{linux-lts}}`
2021-02-18 20:09:54 -03:00
- Generate an initramfs image using an alternative configuration file:
2025-04-28 20:48:35 +03:00
`sudo mkinitcpio {{[-c|--config]}} {{path/to/mkinitcpio.conf}} {{[-g|--generate]}} {{path/to/initramfs.img}}`
2021-02-18 20:09:54 -03:00
- Generate an initramfs image for a kernel other than the one currently running (the installed kernel releases can be found in `/usr/lib/modules/`):
2025-04-28 20:48:35 +03:00
`sudo mkinitcpio {{[-k|--kernel]}} {{kernel_version}} {{[-g|--generate]}} {{path/to/initramfs.img}}`
2021-02-18 20:09:54 -03:00
- List all available hooks:
2025-04-28 20:48:35 +03:00
`mkinitcpio {{[-L|--listhooks]}}`
2021-02-18 20:09:54 -03:00
- Display help for a specific hook:
2025-04-28 20:48:35 +03:00
`mkinitcpio {{[-H|--hookhelp]}} {{hook_name}}`