This commit is contained in:
Valeria Fadeeva 2023-10-29 13:09:04 +05:00
parent a7eca40609
commit 4f8d689c69
1 changed files with 13 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash -e
#!/bin/bash
function usage {
echo "$(basename "$0") [OPTIONS]"
@ -77,11 +77,13 @@ while getopts ":hag:xyz" arg; do
kernel_image="$BOOT_PATH/vmlinuz-$kernel_name"
initrd_image="$BOOT_PATH/initramfs-$kernel_name.img"
initrd_image_fallback="$BOOT_PATH/initramfs-$kernel_name-fallback.img"
initrd_image_fallback_terminal="$BOOT_PATH/initramfs-$kernel_name-fallback-terminal.img"
declare -a images=()
images+=("$kernel_image")
images+=("$initrd_image")
images+=("$initrd_image_fallback")
images+=("$initrd_image_fallback_terminal")
for image in "${images[@]}";
do
@ -153,21 +155,29 @@ function gen_image() {
cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline")
fi
cmdline_terminal="$cmdline systemd.unit=multi-user.target"
vmlinuz="$kernel_dir/vmlinuz"
kernel_image="$BOOT_PATH/vmlinuz-$kernel_name"
initrd_image="$BOOT_PATH/initramfs-$kernel_name.img"
initrd_image_fallback="$BOOT_PATH/initramfs-$kernel_name-fallback.img"
initrd_image_fallback_terminal="$BOOT_PATH/initramfs-$kernel_name-fallback-terminal.img"
echo "==> Building initrd image $kernel_name $initrd_image"
#dracut --force --hostonly --kver "$kernel_version" --kernel-cmdline="$cmdline" "$BOOT_PATH/initramfs-$kernel_name.img"
#dracut --force --hostonly --no-hostonly-cmdline --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name.img"
dracut --force --hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline" --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name.img"
dracut --force --hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline" --kver "$kernel_version" "$initrd_image"
echo "==> Building initrd image $kernel_name $initrd_image_fallback"
#dracut --force --no-hostonly --kver "$kernel_version" --kernel-cmdline="$cmdline" "$BOOT_PATH/initramfs-$kernel_name-fallback.img"
#dracut --force --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name-fallback.img"
dracut --force --no-hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline" --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name-fallback.img"
dracut --force --no-hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline" --kver "$kernel_version" "$initrd_image_fallback"
echo "==> Building initrd image $kernel_name $initrd_image_fallback_terminal TERMINAL"
#dracut --force --no-hostonly --kver "$kernel_version" --kernel-cmdline="$cmdline" "$BOOT_PATH/initramfs-$kernel_name-fallback.img"
#dracut --force --kver "$kernel_version" "$BOOT_PATH/initramfs-$kernel_name-fallback.img"
dracut --force --no-hostonly --no-hostonly-i18n --early-microcode --kernel-cmdline="$cmdline_terminal" --kver "$kernel_version" "$initrd_image_fallback_terminal"
cp -vrf "$vmlinuz" "$kernel_image"
}