add support to exclude existing modules from iso generation (actually any path)

pull/65/head
TomasM 2019-02-05 08:33:00 +00:00
parent 33cf295438
commit d27460d958
1 changed files with 20 additions and 2 deletions

View File

@ -3,12 +3,30 @@
CWD=$(pwd) CWD=$(pwd)
SOURCE=/run/initramfs/memory SOURCE=/run/initramfs/memory
TEMP=/tmp/slaxiso.$$ TEMP=/tmp/slaxiso.$$
REGEX='^$'
if [ "$1" = "-e" ]; then
REGEX="$2"
shift
shift
fi
TARGET="$(readlink -f "$1")" TARGET="$(readlink -f "$1")"
if [ "$TARGET" = "" ]; then if [ "$TARGET" = "" ]; then
echo "" echo ""
echo "Generate Slax ISO image, adding specified modules" echo "Generate Slax ISO image, adding specified modules"
echo "Usage: $0 target.iso [[module.sb]] [[module.sb]] ..." echo "Regular expression is used to exclude any existing path or file with -e regex"
echo ""
echo "Usage:"
echo " $0 [[ -e regex ]] target.iso [[module.sb]] [[module.sb]] ..."
echo ""
echo "Examples:"
echo " # to create Slax iso without chromium.sb module:"
echo " $0 -e 'chromium' slax_without_chromium.iso"
echo ""
echo " # to create Slax text-mode core only:"
echo " $0 -e 'firmware|xorg|desktop|apps|chromium' slax_textmode.iso"
exit 1 exit 1
fi fi
@ -28,7 +46,7 @@ fi
GRAFT=\ GRAFT=\
$( $(
cd "$SLAX" cd "$SLAX"
find . -type f | sed -r "s:^[.]/::" | egrep -v "^boot/isolinux.(bin|boot)$" | egrep -v "^changes/" | while read LINE; do find . -type f | sed -r "s:^[.]/::" | egrep -v "^boot/isolinux.(bin|boot)$" | egrep -v "^changes/" | egrep -v "$REGEX" | while read LINE; do
echo "slax/$LINE=$SLAX/$LINE" echo "slax/$LINE=$SLAX/$LINE"
done done
) )