File tree 1 file changed +12
-5
lines changed
1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2350,6 +2350,17 @@ if [[ $create_early_cpio == yes ]]; then
2350
2350
fi
2351
2351
fi
2352
2352
2353
+ if check_kernel_config CONFIG_RD_ZSTD; then
2354
+ DRACUT_KERNEL_RD_ZSTD=yes
2355
+ else
2356
+ DRACUT_KERNEL_RD_ZSTD=
2357
+ fi
2358
+
2359
+ if [[ $compress == $DRACUT_COMPRESS_ZSTD * && ! $DRACUT_KERNEL_RD_ZSTD ]]; then
2360
+ dwarn " dracut: kernel has no zstd support compiled in."
2361
+ compress=
2362
+ fi
2363
+
2353
2364
if [[ $compress && $compress != cat ]]; then
2354
2365
if ! command -v " ${compress%% * } " & > /dev/null; then
2355
2366
derror " dracut: cannot execute compression command '$compress ', falling back to default"
2360
2371
if ! [[ $compress ]]; then
2361
2372
# check all known compressors, if none specified
2362
2373
for i in $DRACUT_COMPRESS_PIGZ $DRACUT_COMPRESS_GZIP $DRACUT_COMPRESS_LZ4 $DRACUT_COMPRESS_LZOP $DRACUT_COMPRESS_ZSTD $DRACUT_COMPRESS_LZMA $DRACUT_COMPRESS_XZ $DRACUT_COMPRESS_LBZIP2 $DRACUT_COMPRESS_BZIP2 $DRACUT_COMPRESS_CAT ; do
2374
+ [[ $i != " $DRACUT_COMPRESS_ZSTD " || $DRACUT_KERNEL_RD_ZSTD ]] || continue
2363
2375
command -v " $i " & > /dev/null || continue
2364
2376
compress=" $i "
2365
2377
break
@@ -2406,11 +2418,6 @@ case $compress in
2406
2418
;;
2407
2419
esac
2408
2420
2409
- if [[ $compress == $DRACUT_COMPRESS_ZSTD * ]] && ! check_kernel_config CONFIG_RD_ZSTD; then
2410
- dwarn " dracut: kernel has no zstd support compiled in."
2411
- compress=" cat"
2412
- fi
2413
-
2414
2421
if [[ -n $enhanced_cpio ]]; then
2415
2422
if [[ $compress == " cat" ]]; then
2416
2423
# dracut-cpio appends by default, so any ucode remains
You can’t perform that action at this time.
0 commit comments