summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_install.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-26 21:07:39 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-26 21:07:39 (GMT)
commit77129147b3e07c5596793703004c7d9e35d7daa3 (patch)
treef0460a5a5772a8a55c0b61322ba1bf9162fe9add /abs/core/LinHES-config/mv_install.py
parentc95f3e81458c4e0978ef07cea521fec7130aba8f (diff)
downloadlinhes_pkgbuild-77129147b3e07c5596793703004c7d9e35d7daa3.zip
linhes_pkgbuild-77129147b3e07c5596793703004c7d9e35d7daa3.tar.gz
linhes_pkgbuild-77129147b3e07c5596793703004c7d9e35d7daa3.tar.bz2
LinHES-config: install work
- for upgrades the network must be started. - white space - mv_install fix upgrades. upgrades complete but still need a migration process for the new dir structure.
Diffstat (limited to 'abs/core/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core/LinHES-config/mv_install.py52
1 files changed, 35 insertions, 17 deletions
diff --git a/abs/core/LinHES-config/mv_install.py b/abs/core/LinHES-config/mv_install.py
index af7d8a6..6a52468 100755
--- a/abs/core/LinHES-config/mv_install.py
+++ b/abs/core/LinHES-config/mv_install.py
@@ -581,10 +581,10 @@ def copy_it(install_type):
logging.debug( install_type)
if ( install_type == "install"):
logging.info("Transferring system")
- cmdlist = ['rsync -avrp /image_mount/root/* /new_boot',
- 'rsync -arvp /image_mount/lib/* /new_boot/lib/',
- 'rsync -arvp /image_mount/usr /new_boot',
- 'rsync -arvp /image_mount/var /new_boot']
+ cmdlist = ['rsync -arp /image_mount/root/* /new_boot',
+ 'rsync -arp /image_mount/lib/* /new_boot/lib/',
+ 'rsync -arp /image_mount/usr /new_boot',
+ 'rsync -arp /image_mount/var /new_boot']
#'rsync -arvp /image_mount/lib /new_boot',
@@ -598,10 +598,10 @@ def copy_it(install_type):
if ( install_type == "upgrade"):
logging.info("Upgrading system")
- cmdlist = ['rsync -avrp /image_mount/root/* /new_boot',
- 'rsync -arvp /image_mount/lib/* /new_boot/lib/',
- 'rsync -arvp /image_mount/usr /new_boot',
- 'rsync -arvp /image_mount/var /new_boot']
+ cmdlist = ['rsync -arp /image_mount/root/* /new_boot',
+ 'rsync -arp /image_mount/lib/* /new_boot/lib/',
+ 'rsync -arp /image_mount/usr /new_boot',
+ 'rsync -arp /image_mount/var /new_boot']
#'rsync -arvp /image_mount/lib /new_boot',
@@ -689,16 +689,16 @@ def create_fstab(extralines):
f.close()
def find_uuid(partition):
- logging.info("Finding the UUID for %s...", partition)
+ logging.info(" Finding the UUID for %s...", partition)
cmd = "blkid -s UUID /dev/%s" %partition
tmpuuid = runcmd(cmd)[1]
splituuid = tmpuuid.partition("=")
uuid = splituuid[2].replace('"', "")
- logging.info("The uuid is %s", uuid)
+ logging.info(" The uuid is %s", uuid)
return uuid.strip()
def acl_options(partition):
- logging.info("Finding mount options for %s...", partition)
+ logging.info(" Finding mount options for %s...", partition)
acl_fs_list=["ext3","ext4"]
options = "defaults,noatime"
cmd = "/sbin/fsck -N /dev/%s" %partition
@@ -721,7 +721,7 @@ def acl_options(partition):
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 )
+ logging.info(" Will add acl to the list of options: %s ", rc )
return rc
@@ -775,12 +775,15 @@ def fstab_it(install_type):
rootacl = acl_options(hostoptions["rootpartition"])
fstabfile = data_config.MOUNTPOINT+"/etc/fstab"
- logging.info("Correcting UUID's in %s", fstabfile)
+ logging.info(" Correcting UUID's in %s", fstabfile)
f = open(fstabfile, 'r')
oldfscontents = f.readlines()
newfstab = []
f.close()
for line in oldfscontents:
+ if line.strip("\n") == '':
+ continue
+ #FIX ALL MOUNTS THAT START WITH UUID
if line.startswith("UUID"):
templine = line.split()
if ( templine[1] == "/"):
@@ -799,7 +802,7 @@ def fstab_it(install_type):
logging.debug( newline)
newfstab.append(newline)
- if ( templine[1] == data_config.DATAMOUNT):
+ elif ( templine[1] == data_config.DATAMOUNT):
logging.debug(" Found DATA mount")
logging.debug( templine)
templine[0] = "UUID=%s" %(datauuid)
@@ -814,7 +817,7 @@ def fstab_it(install_type):
logging.debug( newline)
newfstab.append(newline)
- if ( templine[1] == "swap"):
+ elif ( templine[1] == "swap"):
if len(swapuuid) <= 5:
logging.debug(" swapp uuid is to small")
else:
@@ -829,6 +832,12 @@ def fstab_it(install_type):
logging.debug(" New fstab line:")
logging.debug( newline)
newfstab.append(newline)
+ else:
+ logging.debug(" Line didn't match, adding to newfstab:")
+ logging.debug( line)
+ newfstab.append(line)
+
+
elif line.startswith("none"):
templine = line.split()
if ( templine[1] == "/dev/pts" ):
@@ -845,10 +854,14 @@ def fstab_it(install_type):
logging.debug(" Line didn't match, adding to newfstab:")
logging.debug( line)
newfstab.append(line)
- logging.info("Writing out newfstab")
+
+ logging.info(" Writing out newfstab")
logging.debug("______This is the new fstab_____")
+
f = open(fstabfile, 'w')
for line in newfstab:
+ if line.strip("\n") == '':
+ continue
logging.debug(line)
f.write(line)
#f.write("\n")
@@ -1426,9 +1439,10 @@ def find_upgrade():
if os.path.exists(srcfile):
logging.info("Found systemconfig file %s", srcfile)
TEMPLATES = os.environ["TEMPLATES"]+"/settings/syssettings"
+ TEMPLATE_ = os.environ["TEMPLATES"]+"/settings"
cp_and_log2(data_config.MOUNTPOINT+TEMPLATES, data_config.TEMP_TEMPLATES, '')
sane_settings("/tmp/templates/settings/syssettings/settings.txt")
- cp_and_log2(data_config.TEMP_TEMPLATES, TEMPLATES, '')
+ cp_and_log2(data_config.TEMP_TEMPLATES, TEMPLATE_, '*')
cp_and_log(srcfile, "/etc/systemconfig")
cp_and_log(data_config.MOUNTPOINT+"/etc/", "/tmp/etc/")
cp_and_log(data_config.MOUNTPOINT+"/var/lib/alsa/", "/tmp/alsa")
@@ -1596,7 +1610,11 @@ def upgrade(hostoptions):
upgrade_mount_search()
fstab_it("upgrade")
time.sleep(1)
+
+ mount_bind_chroot()
grub_it()
+ umount_bind_chroot()
+
genlocale()
time.sleep(1)
#needed to get around a bug with pacman