feat: enable dracut zstd compression by default
This commit is contained in:
parent
07799f47b3
commit
5f36dfb3d0
|
@ -135,27 +135,28 @@ function generate_initramfs() {
|
||||||
kver="${kver#linux-}"
|
kver="${kver#linux-}"
|
||||||
|
|
||||||
# Generate initramfs
|
# Generate initramfs
|
||||||
#--conf "/dev/null" \
|
# TODO --conf "/dev/null" \
|
||||||
#--confdir "/dev/null" \
|
# TODO --confdir "/dev/null" \
|
||||||
try dracut \
|
try dracut \
|
||||||
--kver "$kver" \
|
--kver "$kver" \
|
||||||
--no-compress \
|
--zstd \
|
||||||
--no-hostonly \
|
--no-hostonly \
|
||||||
--ro-mnt \
|
--ro-mnt \
|
||||||
--add "bash ${modules[*]}" \
|
--add "bash ${modules[*]}" \
|
||||||
--force \
|
--force \
|
||||||
"$output"
|
"$output"
|
||||||
|
|
||||||
|
# TODO --conf "/dev/null" \\
|
||||||
|
# TODO --confdir "/dev/null" \\
|
||||||
# Create script to repeat initramfs generation
|
# Create script to repeat initramfs generation
|
||||||
cat > "$(dirname "$output")/generate_initramfs.sh" <<EOF
|
cat > "$(dirname "$output")/generate_initramfs.sh" <<EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
kver="\$1"
|
kver="\$1"
|
||||||
[[ -n "\$kver" ]] || { echo "usage \$0 <kernel_version>" >&2; exit 1; }
|
output="\$2"
|
||||||
|
[[ -n "\$kver" ]] || { echo "usage \$0 <kernel_version> <output>" >&2; exit 1; }
|
||||||
dracut \\
|
dracut \\
|
||||||
--conf "/dev/null" \\
|
|
||||||
--confdir "/dev/null" \\
|
|
||||||
--kver "\$kver" \\
|
--kver "\$kver" \\
|
||||||
--no-compress \\
|
--zstd \\
|
||||||
--no-hostonly \\
|
--no-hostonly \\
|
||||||
--ro-mnt \\
|
--ro-mnt \\
|
||||||
--add "bash ${modules[*]}" \\
|
--add "bash ${modules[*]}" \\
|
||||||
|
@ -258,7 +259,7 @@ function install_kernel_bios() {
|
||||||
function install_kernel() {
|
function install_kernel() {
|
||||||
# Install vanilla kernel
|
# Install vanilla kernel
|
||||||
einfo "Installing vanilla kernel and related tools"
|
einfo "Installing vanilla kernel and related tools"
|
||||||
try emerge --verbose sys-kernel/dracut sys-kernel/gentoo-kernel-bin
|
try emerge --verbose sys-kernel/dracut sys-kernel/gentoo-kernel-bin app-arch/zstd
|
||||||
|
|
||||||
if [[ $IS_EFI == "true" ]]; then
|
if [[ $IS_EFI == "true" ]]; then
|
||||||
install_kernel_efi
|
install_kernel_efi
|
||||||
|
@ -395,14 +396,6 @@ EOF
|
||||||
install_sshd
|
install_sshd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $SYSTEMD != "true" ]]; then
|
|
||||||
# Install and enable dhcpcd
|
|
||||||
einfo "Installing dhcpcd"
|
|
||||||
try emerge --verbose net-misc/dhcpcd
|
|
||||||
|
|
||||||
enable_service dhcpcd
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $SYSTEMD == "true" ]]; then
|
if [[ $SYSTEMD == "true" ]]; then
|
||||||
# Enable systemd networking and dhcp
|
# Enable systemd networking and dhcp
|
||||||
enable_service systemd-networkd
|
enable_service systemd-networkd
|
||||||
|
@ -413,6 +406,12 @@ EOF
|
||||||
|| die "Could not change owner of '/etc/systemd/network/20-wired-dhcp.network'"
|
|| die "Could not change owner of '/etc/systemd/network/20-wired-dhcp.network'"
|
||||||
chmod 640 /etc/systemd/network/20-wired-dhcp.network \
|
chmod 640 /etc/systemd/network/20-wired-dhcp.network \
|
||||||
|| die "Could not change permissions of '/etc/systemd/network/20-wired-dhcp.network'"
|
|| die "Could not change permissions of '/etc/systemd/network/20-wired-dhcp.network'"
|
||||||
|
else
|
||||||
|
# Install and enable dhcpcd
|
||||||
|
einfo "Installing dhcpcd"
|
||||||
|
try emerge --verbose net-misc/dhcpcd
|
||||||
|
|
||||||
|
enable_service dhcpcd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install additional packages, if any.
|
# Install additional packages, if any.
|
||||||
|
|
Loading…
Reference in New Issue