瀏覽代碼

[build] Allow safe concurrent builds of .iso, .liso and .sdsk targets

The geniso, genliso and gensdsk scripts contain hard-coded temporary
directory names, and so could potentially collide with each other when
run as part of a concurrent build (e.g. "make -j 4").

Fix by using mktemp to generate suitable temporary directory names.
tags/v0.9.8
Michael Brown 15 年之前
父節點
當前提交
f42b2932f8
共有 3 個檔案被更改,包括 5 行新增8 行删除
  1. 1
    2
      src/util/geniso
  2. 2
    3
      src/util/genliso
  3. 2
    3
      src/util/gensdsk

+ 1
- 2
src/util/geniso 查看文件

@@ -22,8 +22,7 @@ then
22 22
 fi
23 23
 out=$1
24 24
 shift
25
-dir=bin/iso.dir
26
-mkdir -p $dir
25
+dir=`mktemp -d bin/iso.dir.XXXXXX`
27 26
 cfg=$dir/isolinux.cfg
28 27
 cp -p $isolinux_bin $dir
29 28
 cat > $cfg <<EOF

+ 2
- 3
src/util/genliso 查看文件

@@ -26,13 +26,12 @@ esac
26 26
 out=$1
27 27
 shift
28 28
 
29
-dir=bin/liso.dir
30
-mkdir -p $dir
29
+dir=`mktemp -d bin/liso.dir.XXXXXX`
31 30
 
32 31
 img=$dir/boot.img
33 32
 mformat -f 1440 -C -i $img ::
34 33
 
35
-cfg=bin/syslinux.cfg
34
+cfg=$dir/syslinux.cfg
36 35
 cat > $cfg <<EOF
37 36
 # These default options can be changed in the genliso script
38 37
 SAY gPXE ISO boot image generated by genliso

+ 2
- 3
src/util/gensdsk 查看文件

@@ -24,11 +24,10 @@ Mtools\ version\ 3.9.9*|Mtools\ version\ 3.9.1[0-9]*|Mtools\ version\ 4.*)
24 24
 esac
25 25
 img=$1
26 26
 shift
27
-dir=bin/sdsk.dir
28
-mkdir -p $dir
27
+dir=`mktemp -d bin/sdsk.dir.XXXXXX`
29 28
 
30 29
 mformat -f 1440 -C -i $img ::
31
-cfg=bin/syslinux.cfg
30
+cfg=$dir/syslinux.cfg
32 31
 cat > $cfg <<EOF
33 32
 
34 33
 # These default options can be changed in the gensdsk script

Loading…
取消
儲存