-In a aufs stateless configuration, make the underlying branches available to the post-switchroot environment
-Prevent cpio or squashfs images from being transferred to booting stateless nodes until completed, this causes booting stateless nodes to wait for new image git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1337 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
638e6a782e
commit
8cb889fae4
@ -109,24 +109,30 @@ sub process_request {
|
||||
$callback->({data=>["\nNOTE: Contents of $installroot/netboot/$osver/$arch/$profile/rootimg\nMUST be available on all service and management nodes and NFS exported."]});
|
||||
}
|
||||
my $temppath;
|
||||
my $oldumask;
|
||||
if (! -d "$installroot/netboot/$osver/$arch/$profile/rootimg") {
|
||||
$callback->({error=>["$installroot/netboot/$osver/$arch/$profile/rootimg does not exist, run genimage -o $osver -p $profile on a server with matching architecture"]});
|
||||
return;
|
||||
}
|
||||
if ($method =~ /cpio/) {
|
||||
$excludestr =~ s!-a \z!|cpio -H newc -o | gzip -c - > ../rootimg.gz!;
|
||||
unlink("$installroot/netboot/$osver/$arch/$profile/rootimg.gz");
|
||||
$oldmask = umask 0077;
|
||||
} elsif ($method =~ /squashfs/) {
|
||||
$temppath = mkdtemp("/tmp/packimage.$$.XXXXXXXX");
|
||||
$excludestr =~ s!-a \z!|cpio -dump $temppath!;
|
||||
unlink("$installroot/netboot/$osver/$arch/$profile/rootimg.sfs");
|
||||
} elsif ($method =~ /nfs/) {
|
||||
$excludestr = "touch ../rootimg.nfs";
|
||||
} else {
|
||||
$callback->({error=>["Invalid method '$method' requested"],errorcode=>[1]});
|
||||
}
|
||||
|
||||
if (! -d "$installroot/netboot/$osver/$arch/$profile/rootimg") {
|
||||
$callback->({error=>["$installroot/netboot/$osver/$arch/$profile/rootimg does not exist, run genimage -o $osver -p $profile on a server with matching architecture"]});
|
||||
return;
|
||||
}
|
||||
chdir("$installroot/netboot/$osver/$arch/$profile/rootimg");
|
||||
system($excludestr);
|
||||
if ($method =~ /squashfs/) {
|
||||
if ($method =~ /cpio/) {
|
||||
chmod 0644,"$installroot/netboot/$osver/$arch/$profile/rootimg.gz";
|
||||
umask $oldmask;
|
||||
} elsif ($method =~ /squashfs/) {
|
||||
my $flags;
|
||||
if ($arch =~ /x86/) {
|
||||
$flags="-le";
|
||||
|
@ -234,6 +234,10 @@ if [ "\$NFS" = "1" ]; then
|
||||
done
|
||||
mount -t tmpfs rw /rw
|
||||
mount -t aufs -o dirs=/rw:/ro mergedroot /sysroot
|
||||
mkdir -p /sysroot/ro
|
||||
mkdir -p /sysroot/rw
|
||||
mount --move /ro /sysroot/ro
|
||||
mount --move /rw /sysroot/rw
|
||||
cp /etc/resolv.conf /sysroot/etc/
|
||||
elif [ -r /rootimg.sfs ]; then
|
||||
echo Setting up squashfs with ram overlay.
|
||||
@ -243,6 +247,10 @@ elif [ -r /rootimg.sfs ]; then
|
||||
mount -t squashfs /rootimg.sfs /ro
|
||||
mount -t tmpfs rw /rw
|
||||
mount -t aufs -o dirs=/rw:/ro mergedroot /sysroot
|
||||
mkdir -p /sysroot/ro
|
||||
mkdir -p /sysroot/rw
|
||||
mount --move /ro /sysroot/ro
|
||||
mount --move /rw /sysroot/rw
|
||||
EOMS
|
||||
print $inifile "elif [ -r /rootimg.gz ]; then\n";
|
||||
print $inifile "echo Setting up RAM-root tmpfs.\n";
|
||||
|
Loading…
Reference in New Issue
Block a user