aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--grs/Constants.py2
-rw-r--r--grs/Interpret.py3
-rw-r--r--grs/Kernel.py13
-rw-r--r--grs/MountDirectories.py5
4 files changed, 16 insertions, 7 deletions
diff --git a/grs/Constants.py b/grs/Constants.py
index bdaee25..3c4b3bc 100644
--- a/grs/Constants.py
+++ b/grs/Constants.py
@@ -87,6 +87,7 @@ class Constants():
'tmpdir' : '/var/tmp/grs/%s',
'workdir' : '/var/tmp/grs/%s/work',
'package' : '/var/tmp/grs/%s/packages',
+ 'portage' : '/usr/portage',
'kernelroot' : '/var/tmp/grs/%s/kernel',
'portage_configroot' : '/var/tmp/grs/%s/system',
'pidfile' : '/run/grs-%s.pid'
@@ -161,6 +162,7 @@ CONST.LOGFILE = '/var/log/grs.log'
CONST.TMPDIR = '/var/tmp/grs'
CONST.WORKDIR = '/var/tmp/grs/work'
CONST.PACKAGE = '/var/tmp/grs/package'
+CONST.PORTAGE = '/usr/portage'
CONST.KERNELROOT = '/var/tmp/grs/kernel'
CONST.PORTAGE_CONFIGROOT = '/var/tmp/grs/system'
CONST.PIDFILE = '/run/grs.pid'
diff --git a/grs/Interpret.py b/grs/Interpret.py
index 422357d..a06807f 100644
--- a/grs/Interpret.py
+++ b/grs/Interpret.py
@@ -119,6 +119,7 @@ class Interpret(Daemon):
tmpdir = CONST.tmpdirs[self.run_number]
workdir = CONST.workdirs[self.run_number]
package = CONST.packages[self.run_number]
+ portage = CONST.portages[self.run_number]
kernelroot = CONST.kernelroots[self.run_number]
portage_configroot = CONST.portage_configroots[self.run_number]
@@ -128,7 +129,7 @@ class Interpret(Daemon):
_lo = Log(logfile)
_sy = Synchronize(repo_uri, name, libdir, logfile)
_se = Seed(stage_uri, tmpdir, portage_configroot, package, logfile)
- _md = MountDirectories(portage_configroot, package, logfile)
+ _md = MountDirectories(portage_configroot, package, portage, logfile)
_po = Populate(libdir, workdir, portage_configroot, logfile)
_ru = RunScript(libdir, portage_configroot, logfile)
_pc = PivotChroot(tmpdir, portage_configroot, logfile)
diff --git a/grs/Kernel.py b/grs/Kernel.py
index 82e6d04..3abea6a 100644
--- a/grs/Kernel.py
+++ b/grs/Kernel.py
@@ -67,10 +67,15 @@ class Kernel():
pkg_name = flavor + '-sources-' + vanilla_version + '-' + revision
except AttributeError:
# Or the verison is of the form '4.0.6-hardened' with one -
- _match = re.search(r'(\S+?)-(\S+)', gentoo_version)
- vanilla_version = _match.group(1)
- flavor = _match.group(2)
- pkg_name = flavor + '-sources-' + vanilla_version
+ try:
+ _match = re.search(r'(\S+?)-(\S+)', gentoo_version)
+ vanilla_version = _match.group(1)
+ flavor = _match.group(2)
+ pkg_name = flavor + '-sources-' + vanilla_version
+ except AttributeError:
+ # Finally the verison is of the form '4.0.6' with no -
+ vanilla_version = gentoo_version
+ pkg_name = 'vanilla-sources-' + vanilla_version
pkg_name = '=sys-kernel/' + pkg_name
return (gentoo_version, pkg_name, has_modules)
diff --git a/grs/MountDirectories.py b/grs/MountDirectories.py
index 692c320..a1a42af 100644
--- a/grs/MountDirectories.py
+++ b/grs/MountDirectories.py
@@ -27,7 +27,7 @@ class MountDirectories():
"""
def __init__(self, portage_configroot=CONST.PORTAGE_CONFIGROOT, \
- package=CONST.PACKAGE, logfile=CONST.LOGFILE):
+ package=CONST.PACKAGE, portage=CONST.PORTAGE, logfile=CONST.LOGFILE):
# The order is respected. Note that 'dev' needs to be mounted beore 'dev/pts'.
self.directories = [
'dev',
@@ -35,12 +35,13 @@ class MountDirectories():
{'dev/shm' : ('tmpfs', 'shm')},
'proc',
'sys',
- 'usr/portage',
+ [portage, 'usr/portage'],
[package, 'usr/portage/packages']
]
# Once initiated, we only work with one portage_configroot
self.portage_configroot = portage_configroot
self.package = package
+ self.portage = portage
self.logfile = logfile
# We need to umount in the reverse order
self.rev_directories = deepcopy(self.directories)