Skip to content
Snippets Groups Projects
Commit d23bb80d authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

create-iso.sh: Allow user to clean files after iso generation


This prevents trash on /dev/shm

Signed-off-by: default avatarDiego Giovane Pasqualin <dpasqualin@c3sl.ufpr.br>
parent 20e4367e
No related branches found
No related tags found
No related merge requests found
......@@ -142,8 +142,9 @@ replaceIso()
if [ "$ack" == "y" ]; then
log "Cleaning temporary directory ..."
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || return 6
#$0 --clean --dist $1 || exit 6
if ! cleanFiles; then
return 6
fi
else
log "Extraction canceled!"
return 1
......@@ -153,6 +154,13 @@ replaceIso()
return 0
}
# Remove files used on the generation process and umount files
cleanFiles()
{
checkMountedFS
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || return 6
}
log()
{
if "$LOGINFO" && [ "$1" ]; then
......@@ -253,7 +261,6 @@ checkOutput "$OUTPUT" || exit 8
#------------------------------------------------------------------------------
# Init routines
if $iso; then
if ! regenerateManifest | log; then
log "Error to regenarate manifest file"
......@@ -272,10 +279,6 @@ elif $edit; then
log "Error to edit Squash image"
exit 2
fi
elif $clean; then
log "Cleaning temporary directory ..."
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || exit 6
elif $all; then
replaceIso $distName || exit 6
......@@ -300,7 +303,9 @@ elif $all; then
exit 5
fi
fi
#/root/teste_ram/rsync.sh
if $clean; then
log "Cleaning temporary directory ..."
cleanFiles || exit $?
fi
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment