mirror of
https://github.com/erenfro/gen2stage4.git
synced 2024-11-13 02:38:57 -05:00
Added option to include lost+found directory
This commit is contained in:
parent
9b160a089e
commit
4bdf2a8df5
1 changed files with 11 additions and 2 deletions
13
mkstage4.sh
13
mkstage4.sh
|
@ -10,18 +10,20 @@ fi
|
|||
#set flag variables to null
|
||||
EXCLUDE_BOOT=0
|
||||
EXCLUDE_CONNMAN=0
|
||||
EXCLUDE_LOST=1
|
||||
QUIET=0
|
||||
USAGE="usage:\n\
|
||||
`basename $0` [-q -c -b] [-s || -t <target-mountpoint>] <archive-filename> [custom-tar-options]\n\
|
||||
-q: activates quiet mode (no confirmation).\n\
|
||||
-c: excludes connman network lists.\n\
|
||||
-b: excludes boot directory.\n\
|
||||
-l: includes lost+found directory.\n\
|
||||
-s: makes tarball of current system.\n\
|
||||
-t: makes tarball of system located at the <target-mountpoint>.\n\
|
||||
-h: displays help message."
|
||||
|
||||
# reads options:
|
||||
while getopts ':t:sqcbh' flag; do
|
||||
while getopts ':t:sqcblh' flag; do
|
||||
case "${flag}" in
|
||||
t)
|
||||
TARGET="$OPTARG"
|
||||
|
@ -38,6 +40,9 @@ while getopts ':t:sqcbh' flag; do
|
|||
b)
|
||||
EXCLUDE_BOOT=1
|
||||
;;
|
||||
l)
|
||||
EXCLUDE_LOST=0
|
||||
;;
|
||||
h)
|
||||
echo -e "$USAGE"
|
||||
exit 0
|
||||
|
@ -93,7 +98,6 @@ shift;OPTIONS="$@"
|
|||
EXCLUDES="\
|
||||
--exclude=.bash_history \
|
||||
--exclude=dev/* \
|
||||
--exclude=lost+found/* \
|
||||
--exclude=media/* \
|
||||
--exclude=mnt/*/* \
|
||||
--exclude=proc/* \
|
||||
|
@ -120,6 +124,11 @@ then
|
|||
EXCLUDES+=" --exclude=boot/*"
|
||||
fi
|
||||
|
||||
if [ ${EXCLUDE_LOST} -eq 1 ]
|
||||
then
|
||||
EXCLUDES+=" --exclude=lost+found"
|
||||
fi
|
||||
|
||||
# Generic tar options:
|
||||
TAR_OPTIONS="-cjpP --ignore-failed-read -f"
|
||||
|
||||
|
|
Loading…
Reference in a new issue