!13 add -e option to include file metadata in initramfs
Merge pull request !13 from nettingsisyphus/mycode
This commit is contained in:
commit
e6e66d5334
79
add-option-to-include-file-metadata-in-initramfs.patch
Normal file
79
add-option-to-include-file-metadata-in-initramfs.patch
Normal file
@ -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 e683a9b..6ec0839 100644
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -235,6 +235,9 @@ Creates initial ramdisk images for preloading modules
|
||||
kernel combined
|
||||
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
|
||||
--kernel-image [FILE] location of the kernel image
|
||||
+ -e, --file-metadata [TYPE]
|
||||
+ Include file metadata in the initramfs. Specify "xattr"
|
||||
+ to include file extended attributes.
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
@@ -312,7 +315,7 @@ rearrange_params()
|
||||
set -- "${newat[@]}" # Set new $@
|
||||
|
||||
TEMP=$(unset POSIXLY_CORRECT; getopt \
|
||||
- -o "a:m:o:d:I:k:c:L:fvqlHhMN" \
|
||||
+ -o "a:m:o:d:I:k:c:L:fvqlHhMNe:" \
|
||||
--long kver: \
|
||||
--long add: \
|
||||
--long force-add: \
|
||||
@@ -399,6 +402,7 @@ rearrange_params()
|
||||
--long no-hostonly-i18n \
|
||||
--long hostonly-i18n \
|
||||
--long no-machineid \
|
||||
+ --long file-metadata: \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -596,6 +600,8 @@ while :; do
|
||||
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--no-machineid)
|
||||
machine_id_l="no";;
|
||||
+ -e|--file-metadata)
|
||||
+ file_metadata_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--) shift; break;;
|
||||
|
||||
*) # should not even reach this point
|
||||
@@ -765,6 +771,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_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
|
||||
@@ -1891,7 +1898,7 @@ if [[ $create_early_cpio = yes ]]; then
|
||||
if ! (
|
||||
umask 077; cd "$early_cpio_dir/d"
|
||||
find . -print0 | sort -z \
|
||||
- | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc -o --quiet > "${DRACUT_TMPDIR}/initramfs.img"
|
||||
+ | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc $file_metadata_opt -o --quiet > "${DRACUT_TMPDIR}/initramfs.img"
|
||||
); then
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
@@ -1901,7 +1908,7 @@ fi
|
||||
if ! (
|
||||
umask 077; cd "$initdir"
|
||||
find . -print0 | sort -z \
|
||||
- | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc -o --quiet \
|
||||
+ | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc $file_metadata_opt -o --quiet \
|
||||
| $compress >> "${DRACUT_TMPDIR}/initramfs.img"
|
||||
); then
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
Name: dracut
|
||||
Version: 049
|
||||
Release: 8
|
||||
Release: 9
|
||||
|
||||
Summary: Initramfs generator using udev
|
||||
|
||||
@ -34,6 +34,7 @@ Patch9000: check_vol_slaves_all-must-return-1-when-lvm-vgs-fail.patch
|
||||
Patch9001: dracut-network-fixed-net-rules-issue-hence-systemd-r.patch
|
||||
Patch9002: skip-the-broken-sd-in-initqueue.patch
|
||||
Patch9003: use-sleep-replace-check-sys-block.patch
|
||||
Patch9004: add-option-to-include-file-metadata-in-initramfs.patch
|
||||
|
||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
Source2: openEuler.conf.example
|
||||
@ -481,6 +482,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Jul 2 2020 Anakin Zhang <benjamin93@163.com> - 049-9
|
||||
- add -e option to include file metadata in initramfs
|
||||
|
||||
* Sat Mar 21 2020 openEuler Buildteam <buildteam@openeuler.or
|
||||
g> - 049-8
|
||||
- Add buildrequires of gdb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user