From: Sapan Bhatia Date: Mon, 31 Mar 2014 23:00:44 +0000 (-0400) Subject: Don't mount vservers partition if absent X-Git-Tag: bootmanager-5.2-5~1^2~21 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=d1a0576bd8422e66051ebb0fc2f41b2d7438039a Don't mount vservers partition if absent --- diff --git a/source/steps/InstallBootstrapFS.py b/source/steps/InstallBootstrapFS.py index 7354893..1cd3507 100644 --- a/source/steps/InstallBootstrapFS.py +++ b/source/steps/InstallBootstrapFS.py @@ -81,16 +81,20 @@ def Run( vars, log ): utils.sysexec( "mount -t ext3 %s %s" % (PARTITIONS["root"],SYSIMG_PATH), log ) fstype = 'ext3' if vars['virt']=='vs' else 'btrfs' - log.write( "mounting vserver partition in root file system (type %s)\n"%fstype ) - utils.makedirs( SYSIMG_PATH + "/vservers" ) - utils.sysexec( "mount -t %s %s %s/vservers" % \ - (fstype, PARTITIONS["vservers"], SYSIMG_PATH), log ) - - if vars['virt']=='lxc': - # NOTE: btrfs quota is supported from version: >= btrfs-progs-0.20 (f18+) - # older versions will not recongize the 'quota' command. - log.write( "Enabling btrfs quota on %s/vservers\n"%SYSIMG_PATH ) - utils.sysexec_noerr( "btrfs quota enable %s/vservers" % SYSIMG_PATH ) + + one_partition = VARS['ROOT_SIZE']=='-1' + + if (not one_partition): + log.write( "mounting vserver partition in root file system (type %s)\n"%fstype ) + utils.makedirs( SYSIMG_PATH + "/vservers" ) + utils.sysexec( "mount -t %s %s %s/vservers" % \ + (fstype, PARTITIONS["vservers"], SYSIMG_PATH), log ) + + if vars['virt']=='lxc': + # NOTE: btrfs quota is supported from version: >= btrfs-progs-0.20 (f18+) + # older versions will not recongize the 'quota' command. + log.write( "Enabling btrfs quota on %s/vservers\n"%SYSIMG_PATH ) + utils.sysexec_noerr( "btrfs quota enable %s/vservers" % SYSIMG_PATH ) vars['ROOT_MOUNTED']= 1 diff --git a/source/steps/InstallPartitionDisks.py b/source/steps/InstallPartitionDisks.py index 48884e4..fabb939 100644 --- a/source/steps/InstallPartitionDisks.py +++ b/source/steps/InstallPartitionDisks.py @@ -182,7 +182,7 @@ def Run( vars, log ): utils.sysexec( "mkfs.ext2 -q %s -m %d -j %s" % (option,rbp,devname), log ) # disable time/count based filesystems checks utils.sysexec_noerr( "tune2fs -c -1 -i 0 %s" % devname, log) - else: + elif (not one_partition): log.write("formatting %s btrfs partition (%s).\n" % (fs,devname)) # early BootCD's seem to come with a version of mkfs.btrfs that does not support -f # let's check for that before invoking it