14 Star 0 Fork 32

src-openEuler/dracut

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
add-option-to-include-file-metadata-in-initramfs.patch 3.15 KB
一键复制 编辑 原始数据 按行查看 历史
chenjiayi 提交于 2023-01-17 18:38 . Update to 059 and fix some bugs in spec
From ad794fcc9c8e24592f1cca2580ff73b0b115900f Mon Sep 17 00:00:00 2001
From: Anakin Zhang <benjamin93@163.com>
Date: Tue, 17 Jan 2023 14:34:40 +0800
Subject: [PATCH] add option to include file metadata in initramfs
Signed-off-by: Anakin Zhang <benjamin93@163.com>
---
dracut.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dracut.sh b/dracut.sh
index bbb3469..d708cbf 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -277,6 +277,9 @@ Creates initial ramdisk images for preloading modules
-p, --parallel Use parallel processing if possible (currently only
supported --regenerate-all)
images simultaneously.
+ -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.
@@ -372,7 +375,7 @@ rearrange_params() {
TEMP=$(
unset POSIXLY_CORRECT
getopt \
- -o "a:m:o:d:I:k:c:r:L:fvqlHhMNp" \
+ -o "a:m:o:d:I:k:c:r:L:fvqlHhMNpe:" \
--long kver: \
--long add: \
--long force-add: \
@@ -467,6 +470,7 @@ rearrange_params() {
--long hostonly-i18n \
--long hostonly-nics: \
--long no-machineid \
+ --long file-metadata: \
--long version \
-- "$@"
)
@@ -843,6 +847,11 @@ 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
@@ -1079,6 +1088,7 @@ drivers_dir="${drivers_dir%%+(/)}"
[[ $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
@@ -2479,7 +2489,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 "Creation of $outfile failed"
exit 1
@@ -2584,7 +2594,7 @@ else
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 "Creation of $outfile failed"
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/dracut.git
git@gitee.com:src-openeuler/dracut.git
src-openeuler
dracut
dracut
master

搜索帮助