about summary refs log tree commit diff
path: root/pkgs/tools/cd-dvd/ventoy-bin/002-fix-for-read-only-file-system.diff
blob: d448417bf913edf8e121c685b50c565a91d79290 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- CreatePersistentImg.sh
+++ CreatePersistentImg.sh
@@ -110,7 +110,3 @@ if [ -n "$config" ]; then
-    if [ -d ./persist_tmp_mnt ]; then
-        rm -rf ./persist_tmp_mnt
-    fi
-    
-    mkdir ./persist_tmp_mnt
-    if mount $freeloop ./persist_tmp_mnt; then
-        echo '/ union' > ./persist_tmp_mnt/$config
+    path_to_persist_mnt="`mktemp -d`"
+    if mount $freeloop "$path_to_persist_mnt"; then
+        echo '/ union' > "$path_to_persist_mnt"/$config
@@ -118 +114 @@ if [ -n "$config" ]; then
-        umount ./persist_tmp_mnt
+        umount "$path_to_persist_mnt"
@@ -120 +116 @@ if [ -n "$config" ]; then
-    rm -rf ./persist_tmp_mnt
+    rm -rf "$path_to_persist_mnt"
--- tool/VentoyWorker.sh
+++ tool/VentoyWorker.sh
@@ -162,12 +161,0 @@ fi
-#check tmp_mnt directory
-if [ -d ./tmp_mnt ]; then
-    vtdebug "There is a tmp_mnt directory, now delete it."
-    umount ./tmp_mnt >/dev/null 2>&1
-    rm -rf ./tmp_mnt
-    if [ -d ./tmp_mnt ]; then
-        vterr "tmp_mnt directory exists, please delete it first."
-        exit 1
-    fi
-fi
-
-
@@ -569,2 +557,2 @@ else
-    rm -f ./diskuuid.bin
-    dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of=./diskuuid.bin
+    path_to_diskuuid="`mktemp`"
+    dd status=none conv=fsync if=${DISK} skip=384 bs=1 count=16 of="$path_to_diskuuid"
@@ -573,2 +561,2 @@ else
-    dd status=none conv=fsync if=./diskuuid.bin of=$DISK bs=1 count=16 seek=384
-    rm -f ./diskuuid.bin
+    dd status=none conv=fsync if="$path_to_diskuuid" of=$DISK bs=1 count=16 seek=384
+    rm -f "$path_to_diskuuid"
@@ -577,2 +565,2 @@ else
-    rm -f ./rsvdata.bin
-    dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of=./rsvdata.bin
+    path_to_rsvdata="`mktemp`"
+    dd status=none conv=fsync if=${DISK} skip=2040 bs=512 count=8 of="$path_to_rsvdata"
@@ -600,2 +588,2 @@ else
-    dd status=none conv=fsync if=./rsvdata.bin seek=2040 bs=512 count=8 of=${DISK}
-    rm -f ./rsvdata.bin
+    dd status=none conv=fsync if="$path_to_rsvdata" seek=2040 bs=512 count=8 of=${DISK}
+    rm -f "$path_to_rsvdata"