Skip to content

Commit

Permalink
Merge pull request #85 from drauger-os-development/dev
Browse files Browse the repository at this point in the history
improve extras and updates installation
  • Loading branch information
Batcastle authored Dec 3, 2022
2 parents a02293a + 6b2bd6e commit 5d843c3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 49 deletions.
2 changes: 1 addition & 1 deletion DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: system-installer
Version: 2.4.1
Version: 2.4.3
Maintainer: Thomas Castleman <[email protected]>
Homepage: https://github.com/drauger-os-development/system-installer
Section: admin
Expand Down
2 changes: 1 addition & 1 deletion usr/bin/system-installer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

using namespace std;

str VERSION = "2.4.1";
str VERSION = "2.4.3";
str R = "\033[0;31m";
str G = "\033[0;32m";
str Y = "\033[1;33m";
Expand Down
34 changes: 18 additions & 16 deletions usr/share/system-installer/UI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,18 +1636,18 @@ def options(self, button):
self.extras = self._set_default_margins(self.extras)
self.grid.attach(self.extras, 1, 3, 2, 1)

label2 = Gtk.Label()
label2.set_markup("""
Update the system during installation""")
label2.set_justify(Gtk.Justification.LEFT)
label2 = self._set_default_margins(label2)
self.grid.attach(label2, 1, 4, 2, 1)

self.updates = Gtk.CheckButton.new_with_label("Update before reboot")
if self.data["UPDATES"] == 1:
self.updates.set_active(True)
self.updates = self._set_default_margins(self.updates)
self.grid.attach(self.updates, 1, 5, 2, 1)
# label2 = Gtk.Label()
# label2.set_markup("""
# Update the system during installation""")
# label2.set_justify(Gtk.Justification.LEFT)
# label2 = self._set_default_margins(label2)
# self.grid.attach(label2, 1, 4, 2, 1)

# self.updates = Gtk.CheckButton.new_with_label("Update during Installation")
# if self.data["UPDATES"] == 1:
# self.updates.set_active(True)
# self.updates = self._set_default_margins(self.updates)
# self.grid.attach(self.updates, 1, 5, 2, 1)

label2 = Gtk.Label()
label2.set_markup("""
Expand Down Expand Up @@ -1680,10 +1680,10 @@ def options_next(self, button):
self.data["EXTRAS"] = 1
else:
self.data["EXTRAS"] = 0
if self.updates.get_active():
self.data["UPDATES"] = 1
else:
self.data["UPDATES"] = 0
# if self.updates.get_active():
# self.data["UPDATES"] = 1
# else:
self.data["UPDATES"] = 0
if self.login.get_active():
self.data["LOGIN"] = 1
else:
Expand Down Expand Up @@ -1838,6 +1838,8 @@ def keyboard(self, button):
self.model_menu.append(model[each8], each8)
if self.data["MODEL"] != "":
self.model_menu.set_active_id(self.data["MODEL"])
else:
self.model_menu.set_active_id("pc105")
self.model_menu = self._set_default_margins(self.model_menu)
self.grid.attach(self.model_menu, 2, 2, 3, 1)

Expand Down
39 changes: 9 additions & 30 deletions usr/share/system-installer/modules/install_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,47 +53,26 @@ def install_extras():
# Newer cards take different drivers from older cards
for each in ("BCM43142", "BCM4331", "BCM4360", "BCM4352"):
if each in pci:
install_list = install_list + ["broadcom-sta-dkms", "dkms", "wireless-tools"]
install_list = install_list + ["broadcom-sta-dkms", "dkms",
"wireless-tools"]
break
if len(install_list) == 2:
for each in ("BCM4311", "BCM4312", "BCM4313", "BCM4321", "BCM4322", "BCM43224", "BCM43225", "BCM43227", "BCM43228"):
for each in ("BCM4311", "BCM4312", "BCM4313", "BCM4321", "BCM4322",
"BCM43224", "BCM43225", "BCM43227", "BCM43228"):
if each in pci:
install_list = install_list.append("bcmwl-kernel-source")
install_list.append("bcmwl-kernel-source")
break
# Nvidia graphics cards
if "nvidia" in pci.lower():
drivers = []
# We have other work we need to do after installing the Nvidia driver
NVIDIA = True
with cache.actiongroup():
for each in cache:
if "nvidia-driver-" in each.name:
drivers.append(each.name)
for each in range(len(drivers) - 1, -1, -1):
try:
drivers[each] = int(drivers[each].split("-")[-1])
except ValueError:
pass
# Get the latest Nvidia driver
largest = drivers[0]
for each in drivers:
try:
if int(each) > largest:
largest = each
except ValueError:
pass
install_list.append("nvidia-driver-" + str(largest))
# this isn't the ideal thing to do. Logic will be added later to handle
# installing drivers and `disable-nouveau` for older cards.
install_list.append("nvidia-driver-latest")
# Install everything we want
with cache.actiongroup():
for each in install_list:
cache[each].mark_install()
cache.commit()
# Puge all the stuff we don't
# Purge all the stuff we don't want
purge.purge_package("gstreamer1.0-fluendo-mp3")
cache.close()
# Blacklist Nouveau if we installed the Nvidia drivers
if NVIDIA:
__eprint__(" ### NVIDIA DRIVERS MAY HAVE BEEN INSTALLED. DISABLING NOUVEAU. ### ")
with open("/etc/modprobe.d/blacklist-nvidia-nouveau.conf", "w+") as blacklist:
blacklist.write("blacklist nouveau\noptions nouveau modeset=0\n")
__eprint__(" ### install_extras.py CLOSED ### ")
5 changes: 4 additions & 1 deletion usr/share/system-installer/modules/install_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def update_system():
cache = apt.cache.Cache()
cache.update()
cache.open()
cache.upgrade(dist_upgrade=True)
try:
cache.upgrade(dist_upgrade=True)
except apt.apt_pkg.Error:
print("ERROR: Possible held packages. Update may be partially completed.")
cache.commit()
purge.autoremove(cache)
cache.close()
Expand Down

0 comments on commit 5d843c3

Please sign in to comment.