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

Merge branch 'master' of git:./create-iso/create-iso

parents 6e70cb99 8f2c7660
No related branches found
No related tags found
No related merge requests found
...@@ -28,6 +28,7 @@ sudo ./create-iso.sh --all "iso/$ISO" \ ...@@ -28,6 +28,7 @@ sudo ./create-iso.sh --all "iso/$ISO" \
--dist "$DIST" \ --dist "$DIST" \
--host "$MIRROR" \ --host "$MIRROR" \
--mirror "$REPO" \ --mirror "$REPO" \
--clean \
--output "$OUTPUT" <<< y --output "$OUTPUT" <<< y
RESULT=$? RESULT=$?
......
...@@ -142,8 +142,9 @@ replaceIso() ...@@ -142,8 +142,9 @@ replaceIso()
if [ "$ack" == "y" ]; then if [ "$ack" == "y" ]; then
log "Cleaning temporary directory ..." log "Cleaning temporary directory ..."
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || return 6 if ! cleanFiles; then
#$0 --clean --dist $1 || exit 6 return 6
fi
else else
log "Extraction canceled!" log "Extraction canceled!"
return 1 return 1
...@@ -153,6 +154,13 @@ replaceIso() ...@@ -153,6 +154,13 @@ replaceIso()
return 0 return 0
} }
# Remove files used on the generation process and umount files
cleanFiles()
{
checkMountedFS
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || return 6
}
log() log()
{ {
if "$LOGINFO" && [ "$1" ]; then if "$LOGINFO" && [ "$1" ]; then
...@@ -253,7 +261,6 @@ checkOutput "$OUTPUT" || exit 8 ...@@ -253,7 +261,6 @@ checkOutput "$OUTPUT" || exit 8
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Init routines # Init routines
if $iso; then if $iso; then
if ! regenerateManifest | log; then if ! regenerateManifest | log; then
log "Error to regenarate manifest file" log "Error to regenarate manifest file"
...@@ -272,10 +279,6 @@ elif $edit; then ...@@ -272,10 +279,6 @@ elif $edit; then
log "Error to edit Squash image" log "Error to edit Squash image"
exit 2 exit 2
fi fi
elif $clean; then
log "Cleaning temporary directory ..."
rm -rf "$TMP"/* "$CHROOTDIR" "$CDDIR" "$SQUASHIMAGE" || exit 6
elif $all; then elif $all; then
replaceIso $distName || exit 6 replaceIso $distName || exit 6
...@@ -300,7 +303,9 @@ elif $all; then ...@@ -300,7 +303,9 @@ elif $all; then
exit 5 exit 5
fi fi
fi fi
if $clean; then
#/root/teste_ram/rsync.sh log "Cleaning temporary directory ..."
cleanFiles || exit $?
fi
exit 0 exit 0
...@@ -69,7 +69,7 @@ closeChroot() ...@@ -69,7 +69,7 @@ closeChroot()
umount -l "$CHROOTDIR"/sys && removeMountList "$CHROOTDIR"/sys umount -l "$CHROOTDIR"/sys && removeMountList "$CHROOTDIR"/sys
fi fi
if grep -qs "$CHROOTDIR/proc" /proc/mounts; then if grep -qs "$CHROOTDIR/proc" /proc/mounts; then
umount -l "$CHROOTDIR"/proc && removeMountLit "$CHROOTDIR"/proc umount -l "$CHROOTDIR"/proc && removeMountList "$CHROOTDIR"/proc
fi fi
if grep -qs "$CHROOTDIR/dev" /proc/mounts; then if grep -qs "$CHROOTDIR/dev" /proc/mounts; then
umount -l "$CHROOTDIR"/dev && removeMountList "$CHROOTDIR"/dev umount -l "$CHROOTDIR"/dev && removeMountList "$CHROOTDIR"/dev
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment