chore: clean ouput and add comments to installed scripts

This commit is contained in:
oddlama 2022-10-05 15:44:52 +02:00
parent 551423eb4a
commit 8919c61568
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
2 changed files with 13 additions and 9 deletions

View File

@ -240,15 +240,17 @@ function disk_create_partition() {
|| die "Could not create new gpt partition ($new_id) on '$device' ($id)" || die "Could not create new gpt partition ($new_id) on '$device' ($id)"
partprobe "$device" partprobe "$device"
# On some system, we need to wait a bit for the $new_id symlink to show up. # On some system, we need to wait a bit for the partition to show up.
local new_device local new_device
new_device="$(resolve_device_by_id "$new_id")" \ new_device="$(resolve_device_by_id "$new_id")" \
|| die "Could not resolve new device with id=$new_id" || die "Could not resolve new device with id=$new_id"
for i in {1..10}; do for i in {1..10}; do
[[ -f "$new_device" ]] && break [[ -e "$new_device" ]] && break
echo "Waiting for partition $new_device to appear, $i second..." [[ "$i" -eq 1 ]] && printf "Waiting for partition ($new_device) to appear..."
sleep 1 printf " $((10 - i + 1))"
done sleep 1
[[ "$i" -eq 10 ]] && echo
done
} }
function disk_create_raid() { function disk_create_raid() {

View File

@ -161,7 +161,7 @@ function generate_initramfs() {
cat > "$(dirname "$output")/generate_initramfs.sh" <<EOF cat > "$(dirname "$output")/generate_initramfs.sh" <<EOF
#!/bin/bash #!/bin/bash
kver="\$1" kver="\$1"
output="\$2" output="\$2" # At setup time, this was "$output"
[[ -n "\$kver" ]] || { echo "usage \$0 <kernel_version> <output>" >&2; exit 1; } [[ -n "\$kver" ]] || { echo "usage \$0 <kernel_version> <output>" >&2; exit 1; }
dracut \\ dracut \\
--kver "\$kver" \\ --kver "\$kver" \\
@ -171,7 +171,7 @@ dracut \\
--add "bash ${modules[*]}" \\ --add "bash ${modules[*]}" \\
${dracut_opts[@]@Q} \\ ${dracut_opts[@]@Q} \\
--force \\ --force \\
"$output" "\$output"
EOF EOF
} }
@ -216,6 +216,8 @@ function install_kernel_efi() {
# Create script to repeat adding efibootmgr entry # Create script to repeat adding efibootmgr entry
cat > "/boot/efi/efibootmgr_add_entry.sh" <<EOF cat > "/boot/efi/efibootmgr_add_entry.sh" <<EOF
#!/bin/bash #!/bin/bash
# This is the command that was used to create the efibootmgr entry when the
# system was installed using gentoo-install.
efibootmgr --verbose --create --disk "$gptdev" --part "$efipartnum" --label "gentoo" --loader '\\vmlinuz.efi' --unicode 'initrd=\\initramfs.img'" $(get_cmdline)" efibootmgr --verbose --create --disk "$gptdev" --part "$efipartnum" --label "gentoo" --loader '\\vmlinuz.efi' --unicode 'initrd=\\initramfs.img'" $(get_cmdline)"
EOF EOF
} }