Merge "Debian: fix the bug of getting the dev's fd"

This commit is contained in:
Zuul 2022-10-27 18:59:00 +00:00 committed by Gerrit Code Review
commit 6c85ea114b
1 changed files with 9 additions and 1 deletions

View File

@ -805,7 +805,15 @@ export prefix=""
# Assume there is no Platform Backup (persistent) Partition
export BACKUP_PART_FOUND=0
export STOR_DEV_FDS="$(ls -1 /proc/$$/fd | egrep -v "^(0|1|2|255)$" | xargs)"
export STOR_DEV_FDS=""
export PROC_SELF_FDS="$(ls -1 /proc/$$/fd | egrep -v "^(0|1|2|255)$" | xargs)"
for fd in ${PROC_SELF_FDS}; do
export realpath=$(readlink -f /proc/$$/fd/"${fd}")
if [ -e "${realpath}" ]; then
STOR_DEV_FDS="${STOR_DEV_FDS} ${fd}"
fi
done
##########################################################################
# Local Kickstart variables #