export LC_MESSAGES=C kernel
-if [[ $EUID == "0" ]] && ! [[ ${DRACUT_NO_XATTR-} ]]; then
- export DRACUT_CP="cp --reflink=auto --preserve=mode,timestamps,xattr,links -dfr"
-else
- export DRACUT_CP="cp --reflink=auto --preserve=mode,timestamps,links -dfr"
-fi
-
if ! [[ ${dracutbasedir-} ]]; then
dracutbasedir=${BASH_SOURCE[0]%/*}
[[ $dracutbasedir == dracut-functions* ]] && dracutbasedir="."
dracut_module_included "squash-lib" && mkdir -p "$squashdir"
+# disable xattr when creating cpio, but do not change the default for squashfs/erofs
+if ! dracut_module_included "squash-lib"; then
+ export DRACUT_NO_XATTR="${DRACUT_NO_XATTR:=1}"
+fi
+
+if [[ $EUID == "0" ]] && ! [[ ${DRACUT_NO_XATTR-} ]]; then
+ export DRACUT_CP="cp --reflink=auto --preserve=mode,timestamps,xattr,links -dfr"
+else
+ export DRACUT_CP="cp --reflink=auto --preserve=mode,timestamps,links -dfr"
+fi
+
_isize=0 #initramfs size
modules_loaded=" "
# Allow all modules to update the config. Do this before installing anything.