Created
September 2, 2016 09:47
-
-
Save mudler/a5d0c472c41ce56e7e7925a521c62085 to your computer and use it in GitHub Desktop.
with fixed network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# corecd.py | |
# | |
# Copyright (C) 2014 Fabio Erculiani | |
# | |
# This program 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 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | |
# | |
from pyanaconda.installclass import BaseInstallClass | |
from pyanaconda.sabayon import Entropy | |
from pyanaconda import network | |
from pyanaconda import nm | |
class InstallClass(BaseInstallClass): | |
id = "sabayon_corecd" | |
name = "Sabayon Core" | |
sortPriority = 9998 | |
_l10n_domain = "anaconda" | |
efi_dir = "sabayon" | |
help_placeholder = "SabayonPlaceholder.html" | |
help_placeholder_with_links = "SabayonPlaceholderWithLinks.html" | |
dmrc = None | |
def configure(self, anaconda): | |
BaseInstallClass.configure(self, anaconda) | |
BaseInstallClass.setDefaultPartitioning(self, anaconda.storage) | |
def getBackend(self): | |
from pyanaconda.sabayon.livecd import LiveCDCopyBackend | |
return LiveCDCopyBackend | |
def setNetworkOnbootDefault(self, ksdata): | |
if network.has_some_wired_autoconnect_device(): | |
return | |
# choose first wired device having link | |
for dev in nm.nm_devices(): | |
if nm.nm_device_type_is_wifi(dev): | |
continue | |
try: | |
link_up = nm.nm_device_carrier(dev) | |
except (nm.UnknownDeviceError, nm.PropertyNotFoundError): | |
continue | |
if link_up: | |
network.update_onboot_value(dev, "yes", ksdata) | |
break | |
def __init__(self): | |
BaseInstallClass.__init__(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment