1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
|