install

installer
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/install

commit 1482a1ede7ff18e611a85d52d8572c5b800bb174
parent 5f4757689db9fddee47ad8d8e16915f4031ba02a
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Wed, 11 Jan 2017 08:03:14 +0100

Add(Grub): Now installing grub

Diffstat:
Mscreens/install/install.py | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/screens/install/install.py b/screens/install/install.py @@ -139,6 +139,7 @@ class Install: self.config_network() self.install_bootscripts() self.fstab() + self.grub() self.dlg.msgbox("The installation is finished. Hit 'Enter' to close this dialog and reboot.", title="Success !") # Need reboot here @@ -963,3 +964,19 @@ class Install: fd.write("tmpfs /run tmpfs defaults 0 0") fd.write("devtmpfs /dev devtmpfs mode=0755,nosuid 0 0") fd.close() + + # This function install grub to the system + def grub(self): + self.dlg.infobox("Installing grub...") + layout = self.conf_lst["partitionning.layout"] + root = [p for p in layout if p["flag"] == "Root"] + + self.e(["grub-install", self.conf_lst["partitionning.disk"]]) + with open("/boot/grub/grub.cfg", "w+") as fd: + fd.write("# Begin /boot/grub/grub.cfg\n") + fd.write("set default=0\n") + fd.write("set timeout=5\n\n") + fd.write("menuentry \"Morphux, GNU/Linux 4.7.2\" {\n") + fd.write(" linux /boot/vmlinuz-4.7.2-morphux root="+ root["part"] +" ro net.ifnames=0\n") + fd.write("}") + fd.close()