From 5610e274ba21b393613a332247dec6bfff8be3d1 Mon Sep 17 00:00:00 2001 From: udeved Date: Mon, 12 Sep 2016 18:30:39 +0200 Subject: [PATCH] [mhwdcfg] adopt development changes --- src/modules/mhwdcfg/main.py | 35 ++++++++++++++++---------------- src/modules/mhwdcfg/mhwdcfg.conf | 7 +++---- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/modules/mhwdcfg/main.py b/src/modules/mhwdcfg/main.py index 95ed66c97..a3ae98d96 100644 --- a/src/modules/mhwdcfg/main.py +++ b/src/modules/mhwdcfg/main.py @@ -40,7 +40,7 @@ class MhwdController: @driver.setter def driver(self, value): self._driver = value - + @property def root(self): return self.__root @@ -48,51 +48,50 @@ class MhwdController: @property def local(self): return self.__local - + @property def repo(self): return self.__repo - + @property def identifier(self): return self.__identifier - + @property def bus(self): return self.__bus - + def umount(self, mp): call(["umount", "-l", join(self.root, mp)]) - + def mount(self, mp): call(["mount", "-Br", "/" + mp, join(self.root, mp)]) - + def configure(self, name, id): cmd = ["mhwd", "-a", str(name), str(self.driver), str(id).zfill(4)] if self.local: self.mount("opt") cmd.extend(["--pmconfig", self.repo]) - + self.mount("etc/resolv.conf") check_target_env_call(cmd) - + if self.local: self.umount("opt") self.umount("etc/resolv.conf") - + def run(self): - for id in self.identifier['net']: - for b in self.bus: - self.configure(b, id) - for id in self.identifier['video']: - for b in self.bus: - self.configure(b, id) - + for b in self.bus: + for id in self.identifier['net']: + self.configure(b, id) + for id in self.identifier['video']: + self.configure(b, id) + return None def run(): """ Configure the hardware """ mhwd = MhwdController() - + return mhwd.run() diff --git a/src/modules/mhwdcfg/mhwdcfg.conf b/src/modules/mhwdcfg/mhwdcfg.conf index a6e2510c3..48d905d9c 100644 --- a/src/modules/mhwdcfg/mhwdcfg.conf +++ b/src/modules/mhwdcfg/mhwdcfg.conf @@ -1,4 +1,7 @@ --- +bus: + - pci + identifier: net: - 200 @@ -8,10 +11,6 @@ identifier: - 302 - 380 -bus: - - pci -# - usb - driver: free local: true