Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Merge branch '2.4.x-stable' of github.com:manjaro/calamares into 2.4.…
Browse files Browse the repository at this point in the history
…x-stable
  • Loading branch information
philmmanjaro committed Sep 17, 2016
2 parents d935b7d + 9dfbc54 commit 8632c3d
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 185 deletions.
2 changes: 1 addition & 1 deletion settings.conf
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sequence:
- initcpio
- users
- displaymanager
- hardwarecfg
- mhwdcfg
- networkcfg
- hwclock
- services
Expand Down
27 changes: 13 additions & 14 deletions src/modules/bootloader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,14 @@ def install_grub(efi_directory, fw_type):
"--force"])

# VFAT is weird, see issue CAL-385
efi_directory_firmware = case_insensitive_subdir(efi_directory,
["EFI", "Efi", "efi"])
if not efi_directory_firmware:
efi_directory_firmware = os.path.join(efi_directory, "EFI")

efi_boot_directory = case_insensitive_subdir(efi_directory_firmware,
["Boot", "boot", "BOOT"])
if not efi_boot_directory:
efi_boot_directory = os.path.join(efi_directory_firmware, "boot")
efi_directory_firmware = os.path.join(efi_directory, "EFI")
if os.path.exists(efi_directory_firmware):
efi_directory_firmware = vfat_correct_case(efi_directory, "EFI")

efi_boot_directory = os.path.join(efi_directory_firmware, "boot")
if os.path.exists(efi_boot_directory):
efi_boot_directory = vfat_correct_case(efi_directory_firmware, "boot")
else:
check_target_env_call(["mkdir", "-p", efi_boot_directory])

# Workaround for some UEFI firmwares
Expand All @@ -251,11 +250,11 @@ def install_grub(efi_directory, fw_type):
libcalamares.job.configuration["grubCfg"]])


def case_insensitive_subdir(parent, candidate_dirnames):
for dirname in candidate_dirnames:
if os.path.isdir(os.path.join(parent, dirname)):
return os.path.join(parent, dirname)
return ""
def vfat_correct_case(parent, name):
for candidate in os.listdir(parent):
if name.lower() == candidate.lower():
return candidate
return os.path.join(parent, name)


def prepare_bootloader(fw_type):
Expand Down
119 changes: 0 additions & 119 deletions src/modules/hardwarecfg/main.py

This file was deleted.

50 changes: 0 additions & 50 deletions src/modules/hardwarecfg/mhwd.sh

This file was deleted.

97 changes: 97 additions & 0 deletions src/modules/mhwdcfg/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2016, Artoo <[email protected]>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Calamares is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.

import libcalamares

from libcalamares.utils import target_env_call, debug
from os.path import join
from subprocess import call

class MhwdController:
def __init__(self):
self.__root = libcalamares.globalstorage.value( "rootMountPoint" )
self.__bus = libcalamares.job.configuration.get('bus', [])
self.__identifier = libcalamares.job.configuration.get('identifier', [])
self.__local = libcalamares.job.configuration['local']
self.__repo = libcalamares.job.configuration['repo']
self._driver = libcalamares.job.configuration['driver']

@property
def driver(self):
return self._driver

@driver.setter
def driver(self, value):
self._driver = value

@property
def root(self):
return self.__root

@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")
target_env_call(cmd)

if self.local:
self.umount("opt")
self.umount("etc/resolv.conf")

def run(self):
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()
19 changes: 19 additions & 0 deletions src/modules/mhwdcfg/mhwdcfg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
bus:
- pci
# - usb

identifier:
net:
- 200
- 280
video:
- 300
- 302
- 380

driver: free

local: true

repo: /opt/pacman-mhwd.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Syntax is YAML 1.2
---
type: "job"
name: "hardwarecfg"
name: "mhwdcfg"
interface: "python"
script: "main.py" #assumed relative to the current directory
4 changes: 4 additions & 0 deletions src/modules/welcome/WelcomeViewStep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "WelcomePage.h"
#include "checker/RequirementsChecker.h"
#include "utils/Logger.h"


#include <QVariant>
Expand Down Expand Up @@ -128,5 +129,8 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
if ( configurationMap.contains( "requirements" ) &&
configurationMap.value( "requirements" ).type() == QVariant::Map )
m_requirementsChecker->setConfigurationMap( configurationMap.value( "requirements" ).toMap() );
else
cDebug() << "WARNING: no valid requirements map found in welcome "
"module configuration.";
}

Loading

0 comments on commit 8632c3d

Please sign in to comment.