aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-07-17 13:10:34 +0900
committerAlice Ferrazzi <alicef@gentoo.org>2017-07-17 13:10:34 +0900
commit446686984ccb8f9bfca1bd6b99ec1f09ee057855 (patch)
tree063a2ee1ae2238570ebc546db47b8f169681897e
parentadded todo cases (diff)
downloadelivepatch-446686984ccb8f9bfca1bd6b99ec1f09ee057855.tar.gz
elivepatch-446686984ccb8f9bfca1bd6b99ec1f09ee057855.tar.bz2
elivepatch-446686984ccb8f9bfca1bd6b99ec1f09ee057855.zip
removed sudo from kpatch-build
fixed docstring fixed comment merge ebuild commands in one
-rw-r--r--elivepatch_server/resources/livepatch.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/elivepatch_server/resources/livepatch.py b/elivepatch_server/resources/livepatch.py
index 11762ea..2f66f04 100644
--- a/elivepatch_server/resources/livepatch.py
+++ b/elivepatch_server/resources/livepatch.py
@@ -82,7 +82,7 @@ class PaTch(object):
"""
Function for building the livepatch
- :param kernel_source: directory of the kernel source
+ :param uuid: UUID session identification
:param vmlinux: path to the vmlinux file
:return: void
"""
@@ -92,7 +92,7 @@ class PaTch(object):
if not os.path.isfile(vmlinux_source):
self.build_kernel(uuid)
debug=True
- bashCommand = ['sudo','kpatch-build']
+ bashCommand = ['kpatch-build']
bashCommand.extend(['-s',kernel_source])
bashCommand.extend(['-v',vmlinux_source])
bashCommand.extend(['-c',self.config_file])
@@ -112,9 +112,8 @@ class PaTch(object):
try:
command(['git','clone','https://github.com/aliceinwire/gentoo-sources_overlay.git'])
except:
- print('Gentoo-sources overlay already present.')
- command(['sudo','ROOT=/tmp/elivepatch-' + uuid_dir,'ebuild','gentoo-sources_overlay/sys-kernel/gentoo-sources/gentoo-sources-' + kernel_version + '.ebuild', 'clean'])
- command(['sudo','ROOT=/tmp/elivepatch-' + uuid_dir,'ebuild','gentoo-sources_overlay/sys-kernel/gentoo-sources/gentoo-sources-' + kernel_version + '.ebuild', 'merge'])
+ print('git clone failed.')
+ command(['sudo','ROOT=/tmp/elivepatch-' + uuid_dir,'ebuild','gentoo-sources_overlay/sys-kernel/gentoo-sources/gentoo-sources-' + kernel_version + '.ebuild', 'clean', 'merge'])
def build_kernel(self, uuid_dir):
kernel_source_dir = '/tmp/elivepatch-' + uuid_dir + '/usr/src/linux/'