Create the temporary directory for the driver update disk with ramdom dir name

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7187 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2010-08-23 08:00:51 +00:00
parent 3382424f78
commit 24fd95b6e7
4 changed files with 8 additions and 30 deletions

View File

@ -20,6 +20,7 @@ Getopt::Long::Configure("bundling");
Getopt::Long::Configure("pass_through");
use File::Path;
use File::Copy;
use File::Temp qw/mkdtemp/;
use Socket;
@ -1271,10 +1272,7 @@ sub insert_dd {
}
# Create the tmp dir for dd hack
my $dd_dir = "/tmp/dd_tmp";
if (-d $dd_dir) {
rmtree "$dd_dir";
}
my $dd_dir = mkdtemp("/tmp/ddtmpXXXXXXX");
mkpath "$dd_dir/initrd_img"; # The dir for the new initrd
# unzip the initrd image

View File

@ -19,6 +19,7 @@ Getopt::Long::Configure("bundling");
Getopt::Long::Configure("pass_through");
use File::Path;
use File::Copy;
use File::Temp qw/mkdtemp/;
use Socket;
@ -1036,7 +1037,6 @@ sub insert_dd {
my $arch = shift;
my $img = shift;
my $dd_dir = "/tmp/dd_tmp";
my $install_dir = xCAT::Utils->getInstallDir();
# Find out the dirver disk which need to be insert into initrd
@ -1051,9 +1051,7 @@ sub insert_dd {
}
# Create the tmp dir for dd hack
if (-d $dd_dir) {
rmtree "$dd_dir";
}
my $dd_dir = mkdtemp("/tmp/ddtmpXXXXXXX");
mkpath "$dd_dir/initrd_img";

View File

@ -13,6 +13,7 @@ use File::Copy qw/copy cp mv move/;
use File::Find;
use Getopt::Long;
use Cwd qw(realpath);
use File::Temp qw/mkdtemp/;
use imgutils;
@ -1350,16 +1351,7 @@ sub load_dd ()
}
# Create the work space for initrd hack
my $dd_dir = "/tmp/dd_tmp";
# If $dd_dir was not cleaned, try to umount mnt first
if (-d "$dd_dir/mnt") {
system ("umount $dd_dir/mnt >/dev/null 2>&1");
}
if( -d "$dd_dir") {
rmtree "$dd_dir";
}
mkpath "$dd_dir";
my $dd_dir = mkdtemp("/tmp/ddtmpXXXXXXX");
mkpath "$dd_dir/mnt";
mkpath "$dd_dir/mods";

View File

@ -13,6 +13,7 @@ use File::Copy;
use File::Find;
use Getopt::Long;
use Cwd qw(realpath);
use File::Temp qw/mkdtemp/;
use imgutils;
@ -1318,18 +1319,7 @@ sub load_dd()
}
# Create the work space, it should be cleaned at end of genimage
my $dd_dir = "/tmp/dd_tmp";
# If $dd_dir was not cleaned, try to unmount mnt first
if (-d "$dd_dir/mnt") {
system ("umount $dd_dir/mnt >/dev/null 2>&1");
}
if( -d "$dd_dir") {
rmtree "$dd_dir";
}
mkpath "$dd_dir";
my $dd_dir = mkdtemp("/tmp/ddtmpXXXXXXX");
mkpath "$dd_dir/mnt";
mkpath "$dd_dir/mods";