Browse Source

* fixed typo in initrd target output format and improved to also

preserve empty /sys, /proc, /mnt and /tmp


git-svn-id: svn://svn.opensde.net/opensde/opensde/trunk@21056 10447126-35f2-4685-b0cf-6dd780d3921f
misl/sde-wrapper
Alejandro Mery 17 years ago
parent
commit
202c802c52
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      target/share/initrd/build.sh

+ 6
- 6
target/share/initrd/build.sh

@ -21,7 +21,7 @@ mkdir -p "$initrddir"
INITRD_POSTFLIST_HOOK=""
INITRD_FLIST_PATTERN="-e '/\.\(h\|o\|a\|la\)$/d;' -e '/ usr\/share\/\(doc\|info\|man\)\//d;'"
INITRD_EMPTY_PATTERN="-e '/\/lib\/udev\/devices\//d;'"
INITRD_EMPTY_PATTERN="-e '/\.\/lib\/udev\/devices\//d;'"
# source target specific code
#
@ -43,17 +43,17 @@ done
# hook
#
[ -z "$INITRD_POSTFLIST" ] || eval "$INITRD_POSTFLIST"
[ -z "$INITRD_POSTFLIST_HOOK" ] || eval "$INITRD_POSTFLIST_HOOK"
# remove empty folder, use $INITRD_EMPTY_PATTERN to skip folders
#
echo_status "Removing empty folders ..."
find "$initrddir" -type d | tac | eval "sed -e '/\/dev\$/d;' $INITRD_EMPTY_PATTERN" | while read folder; do
count=$( find "$folder" | wc -l )
( cd "$initrddir"; find . -type d ) | tac | eval "sed -e '/\.\/\(dev\|sys\|proc\|mnt\|tmp\)\$/d;' $INITRD_EMPTY_PATTERN" | while read folder; do
count=$( find "${initrddir}/$folder" | wc -l )
if [ $count -eq 1 ]; then
rm -r "$folder"
#echo_status "- ${folder#$initrddir} deleted."
rm -r "${initrddir}/$folder"
# echo_status "- ${folder} deleted."
fi
done

Loading…
Cancel
Save