|
|
@ -705,28 +705,47 @@ create_initramfs() {
|
|
|
|
cmd_bzip2=$(type -p bzip2)
|
|
|
|
cmd_bzip2=$(type -p bzip2)
|
|
|
|
cmd_gzip=$(type -p gzip)
|
|
|
|
cmd_gzip=$(type -p gzip)
|
|
|
|
cmd_lzop=$(type -p lzop)
|
|
|
|
cmd_lzop=$(type -p lzop)
|
|
|
|
|
|
|
|
pkg_xz='app-arch/xz-utils'
|
|
|
|
|
|
|
|
pkg_lzma='app-arch/xz-utils'
|
|
|
|
|
|
|
|
pkg_bzip2='app-arch/bzip2'
|
|
|
|
|
|
|
|
pkg_gzip='app-arch/gzip'
|
|
|
|
|
|
|
|
pkg_lzop='app-arch/lzop'
|
|
|
|
local compression
|
|
|
|
local compression
|
|
|
|
case ${COMPRESS_INITRD_TYPE} in
|
|
|
|
case ${COMPRESS_INITRD_TYPE} in
|
|
|
|
xz|lzma|bzip2|gzip2|lzo) compression=${COMPRESS_INITRD_TYPE} ;;
|
|
|
|
xz|lzma|bzip2|gzip|lzop) compression=${COMPRESS_INITRD_TYPE} ;;
|
|
|
|
best)
|
|
|
|
lzo) compression=lzop ;;
|
|
|
|
if grep -sq '^CONFIG_RD_XZ=y' ${KERNEL_DIR}/.config && test -n "${cmd_xz}" ; then
|
|
|
|
best|fastest)
|
|
|
|
compression=xz
|
|
|
|
for tuple in \
|
|
|
|
elif grep -sq '^CONFIG_RD_LZMA=y' ${KERNEL_DIR}/.config && test -n "${cmd_lzma}" ; then
|
|
|
|
'CONFIG_RD_XZ cmd_xz xz' \
|
|
|
|
compression=lzma
|
|
|
|
'CONFIG_RD_LZMA cmd_lzma lzma' \
|
|
|
|
elif grep -sq '^CONFIG_RD_BZIP2=y' ${KERNEL_DIR}/.config && test -n "${cmd_bzip2}" ; then
|
|
|
|
'CONFIG_RD_BZIP2 cmd_bzip2 bzip' \
|
|
|
|
compression=bzip2
|
|
|
|
'CONFIG_RD_GZIP cmd_gzip gzip' \
|
|
|
|
elif grep -sq '^CONFIG_RD_GZIP=y' ${KERNEL_DIR}/.config && test -n "${cmd_gzip}" ; then
|
|
|
|
'CONFIG_RD_LZO cmd_lzop lzop'; do
|
|
|
|
compression=gzip
|
|
|
|
set -- ${tuple}
|
|
|
|
elif grep -sq '^CONFIG_RD_LZO=y' ${KERNEL_DIR}/.config && test -n "${cmd_lzop}" ; then
|
|
|
|
kernel_option=$1
|
|
|
|
compression=lzo
|
|
|
|
cmd_variable_name=$2
|
|
|
|
fi ;;
|
|
|
|
if grep -sq "^${kernel_option}=y" ${KERNEL_DIR}/.config && test -n "${!cmd_variable_name}" ; then
|
|
|
|
|
|
|
|
compression=$3
|
|
|
|
|
|
|
|
[[ ${COMPRESS_INITRD_TYPE} == best ]] && break
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
|
|
|
|
gen_die "Compression '${COMPRESS_INITRD_TYPE}' unknown"
|
|
|
|
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check for actual availability
|
|
|
|
|
|
|
|
cmd_variable_name=cmd_${compression}
|
|
|
|
|
|
|
|
pkg_variable_name=pkg_${compression}
|
|
|
|
|
|
|
|
[[ -z "${!cmd_variable_name}" ]] && gen_die "Compression '${compression}' is not available. Please install package '${!pkg_variable_name}'."
|
|
|
|
|
|
|
|
|
|
|
|
case $compression in
|
|
|
|
case $compression in
|
|
|
|
xz) compress_ext='.xz' compress_cmd="${cmd_xz} -e --check=none -z -f -9" ;;
|
|
|
|
xz) compress_ext='.xz' compress_cmd="${cmd_xz} -e --check=none -z -f -9" ;;
|
|
|
|
lzma) compress_ext='.lzma' compress_cmd="${cmd_lzma} -z -f -9" ;;
|
|
|
|
lzma) compress_ext='.lzma' compress_cmd="${cmd_lzma} -z -f -9" ;;
|
|
|
|
bzip2) compress_ext='.bz2' compress_cmd="${cmd_bzip2} -z -f -9" ;;
|
|
|
|
bzip2) compress_ext='.bz2' compress_cmd="${cmd_bzip2} -z -f -9" ;;
|
|
|
|
gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;;
|
|
|
|
gzip) compress_ext='.gz' compress_cmd="${cmd_gzip} -f -9" ;;
|
|
|
|
lzo) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;;
|
|
|
|
lzop) compress_ext='.lzo' compress_cmd="${cmd_lzop} -f -9" ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${compression}" ]; then
|
|
|
|
if [ -n "${compression}" ]; then
|
|
|
|