Enchanted Makefile to umount loop device if it was mounted from the build...

Enchanted Makefile to umount loop device if it was mounted from the build script, but the script failed to build
parent 2dc4a8f2
Pipeline #177 canceled with stages
in 55 seconds
...@@ -30,6 +30,7 @@ SHA1SUMIMG=$(IMAGENAME).sha1sum.txt ...@@ -30,6 +30,7 @@ SHA1SUMIMG=$(IMAGENAME).sha1sum.txt
TARXZFILE=$(IMAGENAME).tar.xz TARXZFILE=$(IMAGENAME).tar.xz
MD5SUMTARXZFILE=$(TARXZFILE).md5sum.txt MD5SUMTARXZFILE=$(TARXZFILE).md5sum.txt
SHA1SUMTARXZFILE=$(TARXZFILE).sha1sum.txt SHA1SUMTARXZFILE=$(TARXZFILE).sha1sum.txt
LOOPDEVICE=$$(losetup -O name -j $(IMAGENAME) | tail -1)
BLOCKDEVICE= BLOCKDEVICE=
all: all:
...@@ -117,6 +118,10 @@ clean: ...@@ -117,6 +118,10 @@ clean:
fi fi
clean1: clean1:
if [ ! -z $(LOOPDEVICE) ]; then \
sudo losetup -d $(LOOPDEVICE); true; \
fi
sudo lb clean --purge sudo lb clean --purge
rm -f $(BASEIMG)-*; true rm -f $(BASEIMG)-*; true
rm -rf config; true rm -rf config; true
......
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