Skip to content

Commit

Permalink
New version: 1.18.2 - corrected error while installing the new kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Javinator9889 committed May 10, 2018
1 parent 7e09350 commit 83a40a1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -99,3 +99,7 @@ ENV/

# mypy
.mypy_cache/

# Custom
old_logging.txt
Singleton.txt
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@
A Python tool for upgrade your kernel safely from https://kernel.org


[![PyPi](https://img.shields.io/badge/v1.18.1%20-PyPi-green.svg)](https://pypi.org/project/KernelUpgrader/)
[![PyPi](https://img.shields.io/badge/v1.18.2%20-PyPi-green.svg)](https://pypi.org/project/KernelUpgrader/)
[![ZIP](https://img.shields.io/badge/Package%20-Zip-green.svg)](https://github.com/Javinator9889/KernelUpgrader/archive/master.zip)
[![GIT](https://img.shields.io/badge/Package%20-Git-green.svg)](https://github.com/Javinator9889/KernelUpgrader.git)

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -3,7 +3,7 @@ KernelUpgrader

A Python tool for upgrade your kernel safely from https://kernel.org

.. image :: https://img.shields.io/badge/v1.18.1%20-PyPi-green.svg
.. image :: https://img.shields.io/badge/v1.18.2%20-PyPi-green.svg
:target: https://pypi.org/project/KernelUpgrader/
:alt: PyPi
.. image :: https://img.shields.io/badge/Package%20-Zip-green.svg
Expand Down
17 changes: 10 additions & 7 deletions kernel_upgrader/data_manager/__init__.py
Expand Up @@ -49,9 +49,9 @@ def __init__(self, kernel_folder, new_kernel_version, current_date):
new_kernel_version,
current_date,
kernel_folder)
self.__decompressed_path = "{}/linux_{}_{}/".format(home_dir,
new_kernel_version,
current_date)
self.__decompressed_path = "{}/linux_{}_{}".format(home_dir,
new_kernel_version,
current_date)
self.__log = logging.getLogger(LOG_KERNEL)
self.__log.debug("Kernel path: \"" + self.__kernel_path + "\"")
self.__log.debug("Decompressed kernel path: \"" + self.__decompressed_path + "\"")
Expand Down Expand Up @@ -83,7 +83,6 @@ def copy_latest_config(self):
self.__log.error(
"An error occurred while copying latest kernel. Error output: " + terminal_process.stderr
.decode("utf-8"))
# self.__log.finish()
raise CopyConfigError(OutputColors.FAIL + "No configuration was found or an error occurred while "
"copying latest kernel boot configuration. Error output: "
+ terminal_process.stderr.decode("utf-8") + OutputColors.ENDC)
Expand All @@ -93,7 +92,6 @@ def copy_latest_config(self):
return True
else:
self.__log.error("No boot configuration found for the current kernel version")
# self.__log.finish()
raise CopyConfigError(OutputColors.FAIL + "No boot configuration was found for the current kernel version."
" Searching a config for version \"" + kernel_version.rstrip() +
"\" for these files in \"/boot/\" partition\n" + str(files_found) + OutputColors.ENDC)
Expand Down Expand Up @@ -154,11 +152,16 @@ def compileKernel(self):
+ OutputColors.ENDC)

def installKernel(self):
from kernel_upgrader.values.Constants import COMPILE_INSTALL_NEW_KERNEL
from glob import glob
from kernel_upgrader.values.Constants import COMPILE_INSTALL_NEW_KERNEL, COMPILE_DEB_PKG

returnToHomeDir()
self.__log.debug("Starting kernel installation | Kernel source installation path: " + self.__decompressed_path)
process = subprocess.run(COMPILE_INSTALL_NEW_KERNEL.split(), stderr=subprocess.PIPE, stdout=subprocess.PIPE,
self.__log.info("Using \"glob\" for applying special chars to command")
deb_pkg_glob = glob(COMPILE_DEB_PKG)
process = subprocess.run(COMPILE_INSTALL_NEW_KERNEL.split() + deb_pkg_glob,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
cwd=self.__decompressed_path)
if process.returncode != 0:
self.__log.error("There was an error while installing kernel. Error: " + process.stderr.decode("utf-8"))
Expand Down
5 changes: 3 additions & 2 deletions kernel_upgrader/values/Constants.py
Expand Up @@ -33,11 +33,12 @@
COMPILE_ADAPT_OLD_CONFIG = "make olddefconfig"
COMPILE_RPM_OR_DEB = "/usr/bin/rpm -q -f /usr/bin/dpkg"
COMPILE_COMPILE_NEW_KERNEL = "make -j{} deb-pkg"
COMPILE_INSTALL_NEW_KERNEL = "dpkg -i linux-*.deb"
COMPILE_INSTALL_NEW_KERNEL = "dpkg -i"
COMPILE_DEB_PKG = "linux-*.deb"

# Other params
OP_REPO_URL = "https://goo.gl/ZJ4zP9"
OP_VERSION = "1.18.1"
OP_VERSION = "1.18.2"
OP_VERSION_RAW = "https://github.com/Javinator9889/KernelUpgrader/raw/master/version.json"

# Program extended usage
Expand Down
Binary file modified version.json
Binary file not shown.

0 comments on commit 83a40a1

Please sign in to comment.