Initfs features are in profiles

This commit is contained in:
Mike Crute 2020-05-28 15:11:30 -07:00
parent b1da6a47d6
commit 83d07e4b9a
4 changed files with 16 additions and 11 deletions

View File

@ -87,6 +87,7 @@ provisioners = [
"SVCS={{user `svcs`}}"
"KERNEL_MODS={{user `kernel_modules`}}"
"KERNEL_OPTS={{user `kernel_options`}}"
"INITFS_FEATURES={{user `initfs_features`}}"
]
use_env_var_file = "true"
execute_command = "sudo sh -c '. {{.EnvVarFile}} && {{.Path}}'"

View File

@ -91,3 +91,9 @@ kernel_options {
"console=ttyS0" = true
"console=tty0" = true
}
# NOTE: nvme and ena are critical for i3, a1, m6g, and anything in the 5 series
# forward. Without them these instances will not boot.
initfs_features {
nvme = true
ena = true
}

View File

@ -487,13 +487,14 @@ class ConfigBuilder:
self.out_dir = out_dir
self._keys_to_transform = {
"kernel_modules" : self.fold_comma,
"kernel_options" : self.fold_space,
"repos" : self.fold_repos,
"pkgs" : self.fold_packages,
"svcs" : self.fold_services,
"revision" : self.resolve_now,
"end_of_life" : lambda x: \
"kernel_modules" : self.fold_comma,
"kernel_options" : self.fold_space,
"initfs_features" : self.fold_space,
"repos" : self.fold_repos,
"pkgs" : self.fold_packages,
"svcs" : self.fold_services,
"revision" : self.resolve_now,
"end_of_life" : lambda x: \
self.force_iso_date(self.resolve_tomorrow(x)),
}

View File

@ -158,10 +158,7 @@ setup_mdev() {
}
create_initfs() {
# Enable ENA and NVME features these don't hurt for any instance and are
# hard requirements of the 5 series and i3 series of instances
# TODO: profile-ize?
sed -Ei 's/^features="([^"]+)"/features="\1 nvme ena"/' \
sed -Ei "s/^features=\"([^\"]+)\"/features=\"\1 $INITFS_FEATURES\"/" \
"$TARGET/etc/mkinitfs/mkinitfs.conf"
chroot "$TARGET" /sbin/mkinitfs $(basename $(find "$TARGET/lib/modules/"* -maxdepth 0))