-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use XZ compression for integrated initramfs by default now; some systems will not boot if a large, uncompressed initramfs is used (even though the enclosing kernel is compressed).
- Loading branch information
Showing
4 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Build kernel, modules and initial ramdisk in correct sequence, ensuring kernel | ||
# config is conformed, then sign if possible and copy to EFI boot partition. | ||
# | ||
# Copyright (c) 2014-2017 sakaki <[email protected]> | ||
# Copyright (c) 2014-2018 sakaki <[email protected]> | ||
# | ||
# License (GPL v3.0) | ||
# ------------------ | ||
|
@@ -31,7 +31,7 @@ shopt -s nullglob | |
# ********************** variables ********************* | ||
PROGNAME="$(basename "${0}")" | ||
CONFFILE="/etc/${PROGNAME}.conf" | ||
VERSION="1.0.29" | ||
VERSION="1.0.30" | ||
ETCPROFILE="/etc/profile" | ||
DEFAULTEFIBOOTFILE="bootx64.efi" | ||
EFIBOOTFILE="${DEFAULTEFIBOOTFILE}" | ||
|
@@ -77,6 +77,8 @@ CMDLINE_REAL_ROOT="/dev/mapper/vg1-root" | |
CMDLINE_REAL_RESUME="/dev/mapper/vg1-swap" | ||
declare -i DEFAULTCREATEEFIBOOT=1 | ||
declare -i CREATEEFIBOOT="${DEFAULTCREATEEFIBOOT}" | ||
declare -i DEFAULTCOMPRESSINITRAMFS=1 | ||
declare -i COMPRESSINITRAMFS="${DEFAULTCOMPRESSINITRAMFS}" | ||
# you can use xconfig etc if you like - override in /etc/buildkernel.conf | ||
CONFIGTYPE="menuconfig" | ||
# following should already be in the environment; but to be safe... | ||
|
@@ -1633,12 +1635,28 @@ conform_config_file() { | |
set_kernel_config "CMDLINE" "\"${KERNEL_CMD_LINE}\"" | ||
show "Setting up initramfs location and type..." | ||
set_kernel_config "INITRAMFS_SOURCE" "\"${UNCOMPRESSEDINITRAMFS}\"" | ||
# initramfs compression must be 'none' - not as big a deal as it sounds, | ||
# since the encapsulating kernel image will itself be compressed... | ||
for COMP_TYPE in "GZIP" "BZIP2" "LZMA" "XZ" "LZO"; do | ||
unset_kernel_config "INITRAMFS_COMPRESSION_${COMP_TYPE}" | ||
done | ||
set_kernel_config "INITRAMFS_COMPRESSION_NONE" "y" | ||
# unless the user specifically directs, we will compress the initramfs with | ||
# XZ - although the enclosing kernel will be compressed anyway, this can | ||
# help on low-memory systems; also the need to leave compression off seems | ||
# to no longer apply with modern kernels | ||
if ((COMPRESSINITRAMFS==1)); then | ||
show "Using XZ compression for built-in initramfs" | ||
unset_kernel_config "INITRAMFS_COMPRESSION_NONE" | ||
for COMP_TYPE in "GZIP" "BZIP2" "LZMA" "LZO" "LZ4"; do | ||
unset_kernel_config "INITRAMFS_COMPRESSION_${COMP_TYPE}" | ||
done | ||
set_kernel_config "INITRAMFS_COMPRESSION_XZ" "y" | ||
set_kernel_config "INITRAMFS_COMPRESSION" ".xz" | ||
else | ||
warning "As requested, not compressing the built-in initramfs" | ||
warning "This can lead to boot failure on memory-constrained systems" | ||
for COMP_TYPE in "GZIP" "BZIP2" "LZMA" "XZ" "LZO" "LZ4"; do | ||
unset_kernel_config "INITRAMFS_COMPRESSION_${COMP_TYPE}" | ||
done | ||
set_kernel_config "INITRAMFS_COMPRESSION_NONE" "y" | ||
set_kernel_config "INITRAMFS_COMPRESSION" "" | ||
fi | ||
|
||
# ensure we can get at the LUKS volume! note that these could also be | ||
# modules really, since we copy all modules into the initramfs | ||
show "Ensuring Serpent, Whirlpool and SHA-512 are included..." | ||
|
@@ -1767,7 +1785,9 @@ rebuild_external_modules_if_necessary() { | |
create_initramfs_using_genkernel() { | ||
show "Creating initramfs (uncompressed)..." | ||
# this is a partial use of genkernel, we don't use it to build the kernel | ||
# itself; also note, EFI kernels *require* an uncompressed ramdisk | ||
# itself; also note, we build an uncompressed ramdisk, as the kernel | ||
# build process will compress it on integration into the | ||
# unified kernel image | ||
# we suppress gpg here as we don't want to add gpg v2 which is installed, | ||
# but rather our static gpg v1, which will be inserted into the initramfs | ||
local PLYMOUTH_OPTS="" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters