summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_install.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-12-30 23:27:56 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-12-30 23:27:56 (GMT)
commit4f9b3e4a64a5de88017d0b71af15d609c3781490 (patch)
treeacb42c42106b67abb4f927a2da725e6dca50910a /abs/core/LinHES-config/mv_install.py
parent3b20f86a8dd042de6271c30ad8a2a2fed773b9c9 (diff)
downloadlinhes_pkgbuild-4f9b3e4a64a5de88017d0b71af15d609c3781490.zip
linhes_pkgbuild-4f9b3e4a64a5de88017d0b71af15d609c3781490.tar.gz
linhes_pkgbuild-4f9b3e4a64a5de88017d0b71af15d609c3781490.tar.bz2
Linhes-config: for install. Only add "acl" to ext3 and ext4. JFS,XFS,resierfs support acl but do not need the mount option
Diffstat (limited to 'abs/core/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core/LinHES-config/mv_install.py39
1 files changed, 37 insertions, 2 deletions
diff --git a/abs/core/LinHES-config/mv_install.py b/abs/core/LinHES-config/mv_install.py
index 85220cf..9763522 100755
--- a/abs/core/LinHES-config/mv_install.py
+++ b/abs/core/LinHES-config/mv_install.py
@@ -555,9 +555,9 @@ def create_fstab(extralines):
fstab_list.append(line)
line = '''/dev/sr0 /media/cdrom auto ro,user,noauto,unhide 0 0\n'''
fstab_list.append(line)
- line = '''UUID=ROOTUID / auto defaults,noatime,acl 0 1\n'''
+ line = '''UUID=ROOTUID / auto defaults,noatime 0 1\n'''
fstab_list.append(line)
- line = '''UUID=DATAUID %s auto defaults,noatime,acl 0 1\n''' %(data_config.DATAMOUNT)
+ line = '''UUID=DATAUID %s auto defaults,noatime 0 1\n''' %(data_config.DATAMOUNT)
fstab_list.append(line)
line = '''UUID=SWAPUID swap swap defaults 0 0 \n'''
fstab_list.append(line)
@@ -577,6 +577,34 @@ def find_uuid(partition):
logging.info("The uuid is %s", uuid)
return uuid.strip()
+def acl_options(partition):
+ logging.info("Finding mount options for %s...", partition)
+ acl_fs_list=["ext3","ext4"]
+ options = "defaults,noatime"
+ cmd = "/sbin/fsck -N /dev/%s" %partition
+
+ cmdoutput = runcmd(cmd)[1]
+ output = cmdoutput.split("\n")
+ fs_map=[]
+ for i in output:
+ if i.startswith("["):
+ split_line=i.split()
+ #find mount_p and remove the last char
+ mount_p = split_line[3][:-1]
+ fstype = split_line[4].split(".")[1]
+ append_tuple=(mount_p,fstype)
+ fs_map.append(append_tuple)
+
+ rc = False
+ print fs_map
+ for i in fs_map:
+ if i[0] == "/dev/%s" %partition:
+ if i[1] in acl_fs_list:
+ rc=True
+ logging.info("Will add acl to the list of options: %s ", rc )
+ return rc
+
+
def pick_out_vg():
logging.info("Searching for Volume Groups in old fstab")
vglines = []
@@ -619,9 +647,11 @@ def fstab_it(install_type):
logging.info("____UUID check for %s", "data")
datauuid = find_uuid(hostoptions["datapartition"])
+ datacl = acl_options(hostoptions["datapartition"])
logging.info("____UUID check for %s", "root")
rootuuid = find_uuid(hostoptions["rootpartition"])
+ rootacl = acl_options(hostoptions["rootpartition"])
fstabfile = data_config.MOUNTPOINT+"/etc/fstab"
logging.info("Correcting UUID's in %s", fstabfile)
@@ -636,6 +666,9 @@ def fstab_it(install_type):
logging.debug(" Found Root fstab line:")
logging.debug( templine)
templine[0] = "UUID=%s" %(rootuuid)
+ if rootacl:
+ templine[3] = templine[3]+",acl"
+
newline = ''
for i in templine:
newline+=i
@@ -649,6 +682,8 @@ def fstab_it(install_type):
logging.debug(" Found DATA mount")
logging.debug( templine)
templine[0] = "UUID=%s" %(datauuid)
+ if datacl:
+ templine[3] = templine[3]+",acl"
newline = ''
for i in templine:
newline+=i