summaryrefslogtreecommitdiff
path: root/add-option-to-include-file-metadata-in-initramfs.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-19 03:22:19 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-19 03:22:19 +0000
commitbb2d27c6843d99793e50a67e20e64852c3dd4d85 (patch)
tree74f3f8647e43cc7f39873fb2ba713cebe9862c1d /add-option-to-include-file-metadata-in-initramfs.patch
parentff3056a5eddb9b203fdd900eeecc0771d981d138 (diff)
automatic import of dracutopeneuler20.03
Diffstat (limited to 'add-option-to-include-file-metadata-in-initramfs.patch')
-rw-r--r--add-option-to-include-file-metadata-in-initramfs.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/add-option-to-include-file-metadata-in-initramfs.patch b/add-option-to-include-file-metadata-in-initramfs.patch
new file mode 100644
index 0000000..8b90265
--- /dev/null
+++ b/add-option-to-include-file-metadata-in-initramfs.patch
@@ -0,0 +1,79 @@
+From 9d267e664c6f95a7b940c5706643b055623a39d7 Mon Sep 17 00:00:00 2001
+From: Anakin Zhang <benjamin93@163.com>
+Date: Thu, 2 Jul 2020 14:46:51 +0800
+Subject: [PATCH] add option to include file metadata in initramfs
+
+Signed-off-by: Anakin Zhang <benjamin93@163.com>
+---
+ dracut.sh | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/dracut.sh b/dracut.sh
+index 60ac46f..bab91ca 100755
+--- a/dracut.sh
++++ b/dracut.sh
+@@ -246,6 +246,9 @@ Creates initial ramdisk images for preloading modules
+ --kernel-image [FILE] location of the kernel image
+ --regenerate-all Regenerate all initramfs images at the default location
+ for the kernel versions found on the system
++ -e, --file-metadata [TYPE]
++ Include file metadata in the initramfs. Specify "xattr"
++ to include file extended attributes.
+ --version Display version
+
+ If [LIST] has multiple arguments, then you have to put these in quotes.
+@@ -341,7 +344,7 @@ rearrange_params() {
+ TEMP=$(
+ unset POSIXLY_CORRECT
+ getopt \
+- -o "a:m:o:d:I:k:c:r:L:fvqlHhMN" \
++ -o "a:m:o:d:I:k:c:r:L:fvqlHhMNe:" \
+ --long kver: \
+ --long add: \
+ --long force-add: \
+@@ -432,6 +435,7 @@ rearrange_params() {
+ --long hostonly-i18n \
+ --long hostonly-nics: \
+ --long no-machineid \
++ --long file-metadata: \
+ --long version \
+ -- "$@"
+ )
+@@ -800,6 +804,8 @@ while :; do
+ --no-machineid)
+ machine_id_l="no"
+ ;;
++ -e|--file-metadata)
++ file_metadata_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
+ --version)
+ long_version
+ exit 1
+@@ -998,6 +1004,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
+ [[ $uefi_splash_image_l ]] && uefi_splash_image="$uefi_splash_image_l"
+ [[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
+ [[ $machine_id_l ]] && machine_id="$machine_id_l"
++[[ $file_metadata_l ]] && file_metadata_opt="-e $file_metadata_l"
+
+ if ! [[ $outfile ]]; then
+ if [[ $machine_id != "no" ]]; then
+@@ -2324,7 +2331,7 @@ if [[ $create_early_cpio == yes ]]; then
+ cd "$early_cpio_dir/d"
+ find . -print0 | sort -z \
+ | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null \
+- ${cpio_owner:+-R "$cpio_owner"} -H newc -o --quiet > "${DRACUT_TMPDIR}/initramfs.img"
++ ${cpio_owner:+-R "$cpio_owner"} -H newc $file_metadata_opt -o --quiet > "${DRACUT_TMPDIR}/initramfs.img"
+ ); then
+ dfatal "dracut: creation of $outfile failed"
+ exit 1
+@@ -2382,7 +2389,7 @@ if ! (
+ umask 077
+ cd "$initdir"
+ find . -print0 | sort -z \
+- | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null ${cpio_owner:+-R "$cpio_owner"} -H newc -o --quiet \
++ | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null ${cpio_owner:+-R "$cpio_owner"} -H newc $file_metadata_opt -o --quiet \
+ | $compress >> "${DRACUT_TMPDIR}/initramfs.img"
+ ); then
+ dfatal "dracut: creation of $outfile failed"
+--
+1.8.3.1
+