- name: Build ${{ matrix.distro }} initrd
if: matrix.prebuilt-initrd == 'yes'
# Run the build in .github/workflows/ so we don't pick up any of the configuration files in .github/
- run: python3 -m mkosi -d ${{ matrix.distro }} -t cpio -p systemd -p udev -p kmod -o $PWD/initrd build
+ run: python3 -m mkosi -d ${{ matrix.distro }} -t cpio -p systemd -p udev -p kmod --make-initrd -o $PWD/initrd build
working-directory: ./.github/workflows
- name: Configure ${{ matrix.distro }}/${{ matrix.format }}
files. This option may be used multiple times in which case the initrd lists
are combined.
+`MakeInitrd=`, `--make-initrd`
+
+: Add `/etc/initrd-release` and `/init` to the image so that it can be
+ used as an initramfs.
+
### [Validation] Section
`Checksum=`, `--checksum`
def configure_initrd(state: MkosiState) -> None:
- if state.for_cache or not state.config.output_format == OutputFormat.cpio:
+ if state.for_cache or not state.config.make_initrd:
return
if not state.root.joinpath("init").exists():
auto_bump: bool
workspace_dir: Optional[Path]
initrds: list[Path]
+ make_initrd: bool
kernel_command_line_extra: list[str]
acl: bool
pager: bool
section="Content",
parse=config_make_list_parser(delimiter=",", parse=make_path_parser(required=False)),
),
+ MkosiConfigSetting(
+ dest="make_initrd",
+ section="Content",
+ parse=config_parse_boolean,
+ ),
MkosiConfigSetting(
dest="checksum",
section="Validation",
dest="initrds",
action=action,
)
+ group.add_argument(
+ "--make-initrd",
+ help="Make sure the image can be used as an initramfs",
+ metavar="BOOL",
+ nargs="?",
+ action=action,
+ )
group = parser.add_argument_group("Validation options")
group.add_argument(