summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/mv_install.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-11-14 23:12:12 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-11-14 23:12:12 (GMT)
commit7b556fcdbe7739d97221009e3c291d2ae7c2b4a5 (patch)
treef4a232d10f2ca22fe19321a136a0ca1aa019a356 /abs/core/LinHES-config/mv_install.py
parente9de2b12b35f77ce67204c6e1964a5345bb15b6c (diff)
downloadlinhes_pkgbuild-7b556fcdbe7739d97221009e3c291d2ae7c2b4a5.zip
linhes_pkgbuild-7b556fcdbe7739d97221009e3c291d2ae7c2b4a5.tar.gz
linhes_pkgbuild-7b556fcdbe7739d97221009e3c291d2ae7c2b4a5.tar.bz2
linhes-config: Systems with memory less then 1GB sometimes will have problems with an install.
The OOM if needed will kill off a process, most of the time unsquashfs. This causes problems later on, when doing work in the chroot. - catch unsquashfs errors - try to mount swap space if present.
Diffstat (limited to 'abs/core/LinHES-config/mv_install.py')
-rwxr-xr-xabs/core/LinHES-config/mv_install.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/abs/core/LinHES-config/mv_install.py b/abs/core/LinHES-config/mv_install.py
index cc4e4a6..e251291 100755
--- a/abs/core/LinHES-config/mv_install.py
+++ b/abs/core/LinHES-config/mv_install.py
@@ -420,6 +420,9 @@ def mount_it():
# Mount root
cmd = "mount /dev/%s %s" %(hostoptions["rootpartition"], mountpoint)
runcmd(cmd)
+
+
+
#logging.debug(cmd)
#cmdout=commands.getoutput(cmd)
#logging.debug(cmdout)
@@ -457,6 +460,10 @@ def unmount_it():
cmd = "sync"
runcmd(cmd)
+def swapon():
+ logging.info("______starting swap______")
+ cmd = "swapon /dev/%s" %(hostoptions["swappartition"])
+ runcmd(cmd)
def create_squashlist():
logging.debug("Creating squashlist")
@@ -475,7 +482,11 @@ def copy_it(install_type):
if ( install_type == "install"):
logging.info("Transferring system")
cmd = " unsquashfs -f -d %s /.livesys/medium/larch/system.sqf" %(data_config.MOUNTPOINT)
- runcmd(cmd)
+ #runcmd(cmd)
+ rc = runcmd(cmd)[0]
+ if rc != 0 :
+ error_out("Running unsquashfs")
+
#logging.debug(cmd)
#cmdout=commands.getoutput(cmd)
@@ -483,7 +494,10 @@ def copy_it(install_type):
logging.info("Upgrading system")
create_squashlist()
cmd = " unsquashfs -e %s -f -d %s /.livesys/medium/larch/system.sqf" %(data_config.SQUASHFILE, data_config.MOUNTPOINT)
- runcmd(cmd)
+ #runcmd(cmd)
+ rc = runcmd(cmd)[0]
+ if rc != 0 :
+ error_out("Running unsquashfs")
#logging.debug(cmd)
#cmdout=commands.getoutput(cmd)
# Create the missing dir
@@ -1015,6 +1029,8 @@ def full_install(hostoptions):
update_status(statusmsg)
progress(3)
mount_it()
+ swapon()
+
# Find number of bytes written to disk before starting copy. This is used
# to have a somewhat decent progress indication.
@@ -1022,6 +1038,8 @@ def full_install(hostoptions):
msg = "Creating %s" %(systemconfig["hostname"])
update_status(msg)
+
+
# Copy system to disk
copy_it("install")
# Remove old fstab so that a new one is created
@@ -1245,6 +1263,7 @@ def upgrade(hostoptions):
update_status(statusmsg)
progress(3)
mount_it()
+ swapon()
hostoptions["backupfile"] = data_config.BACKUPPATH+data_config.BACKUPFILE
statgrab( hostoptions["rootdisk"])
msg = "Upgrading %s" %(systemconfig["hostname"])