Commit 8f3c8051 authored by Daniel Bissani Furlin's avatar Daniel Bissani Furlin

SCRUM#495: Add parameters to functions in overlay.sh and mktmpfs.sh

parent 87aa45c4
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
# USA. # USA.
mountTmpfs() { mountTmpfs() {
local TMPFS=$1
if mount | grep -q ${TMPFS}; then if mount | grep -q ${TMPFS}; then
return 1 return 1
fi fi
...@@ -33,6 +35,7 @@ mountTmpfs() { ...@@ -33,6 +35,7 @@ mountTmpfs() {
} }
umountTmpfs() { umountTmpfs() {
local TMPFS=$1
if mountpoint -q ${TMPFS}; then if mountpoint -q ${TMPFS}; then
umount ${TMPFS} umount ${TMPFS}
fi fi
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
# USA. # USA.
mountOverlay() { mountOverlay() {
local CHROOTDIR=$1
local TMPFS=$2
local PREFIX=$(pwd)
mkdir -p "${TMPFS}/upper" mkdir -p "${TMPFS}/upper"
mkdir -p "${TMPFS}/work" mkdir -p "${TMPFS}/work"
mkdir -p ${CHROOTDIR} mkdir -p ${CHROOTDIR}
...@@ -59,6 +63,8 @@ mountOverlay() { ...@@ -59,6 +63,8 @@ mountOverlay() {
} }
umountOverlay() { umountOverlay() {
local CHROOTDIR=$1
local TMPFS=$2
if mountpoint -q ${CHROOTDIR}; then if mountpoint -q ${CHROOTDIR}; then
umount ${CHROOTDIR} umount ${CHROOTDIR}
fi fi
......
...@@ -75,8 +75,8 @@ source lib/overlay.sh ...@@ -75,8 +75,8 @@ source lib/overlay.sh
sudo apt-get install syslinux squashfs-tools genisoimage xorriso \ sudo apt-get install syslinux squashfs-tools genisoimage xorriso \
|| log ERROR "Failed to install basic tools: \"${_DIST}\"" || log ERROR "Failed to install basic tools: \"${_DIST}\""
mountTmpfs mountTmpfs ${TMPFS}
mountOverlay mountOverlay ${CHROOTDIR} ${TMPFS}
mkdir -p ${TMP} mkdir -p ${TMP}
for file in $(ls ${SCRIPTSDIR}); do for file in $(ls ${SCRIPTSDIR}); do
...@@ -97,7 +97,7 @@ sudo xorriso -as mkisofs -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c isolin ...@@ -97,7 +97,7 @@ sudo xorriso -as mkisofs -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -c isolin
cd - cd -
cleanTmpFiles cleanTmpFiles
umountOverlay umountOverlay ${CHROOTDIR} ${TMPFS}
umountTmpfs umountTmpfs ${TMPFS}
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment