mpm

morphux package manager
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/mpm

commit 8f1ed6c3e48a1cd45ed6f9cf53fc8ed596bf748b
parent c9fc84936e1a50b74e19c9cb76c2c997d2783b33
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon, 14 Dec 2015 22:10:31 +0000

Fix(Kernel): Add reboot with kernel re

Diffstat:
Minc/Kernel.hpp | 1+
Msrc/Kernel.cpp | 13+++++++++++++
Msrc/main.cpp | 4++++
3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/inc/Kernel.hpp b/inc/Kernel.hpp @@ -28,6 +28,7 @@ class Kernel { void setConfig(std::string name, std::string value); void make(void); + void install(void); static int recompile; diff --git a/src/Kernel.cpp b/src/Kernel.cpp @@ -105,4 +105,17 @@ void Kernel::make(void) { "/boot/System-map-" + std::string(s_uname.release)}); } +void Kernel::install(void) { + int res; + Exec *e = new Exec(); + + res = Error::input("Kernel has been recompiled. Reboot now ? [Yes/no] "); + for (res = 0; res != 'y' && res != 'n' && res != 'Y' && res != 10; ) { + Error::warning("Please type Yes, no or enter."); + res = Error::input("Kernel has been recompiled. Reboot now ? [Yes/no] "); + } + if (res == 'y' || res == 'Y' || res == 10) + e->execute({"reboot"}); +} + int Kernel::recompile = 0; diff --git a/src/main.cpp b/src/main.cpp @@ -59,6 +59,10 @@ void execute(void) { } else { Error::error("Unknown action: " + cmd); } + if (Kernel::recompile) { + Kernel *k = new Kernel(); + k->install(); + } Error::info("Quitting"); }