source: calamares-ubiquity-fixes/trunk/fuentes/ubiquityfixes/main.py @ 7539

Last change on this file since 7539 was 7539, checked in by kbut, 17 months ago

sync with github

File size: 1.6 KB
Line 
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3#
4# === This file is part of Calamares - <https://github.com/calamares> ===
5#
6#   Copyright 2014-2015, Philip Müller <philm@manjaro.org>
7#   Copyright 2015-2017, Teo Mrnjavac <teo@kde.org>
8#   Copyright 2017, Alf Gaida <agaida@siduction.org>
9#   Copyright 2017, Adriaan de Groot <groot@kde.org>
10#   Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
11#
12#   Calamares is free software: you can redistribute it and/or modify
13#   it under the terms of the GNU General Public License as published by
14#   the Free Software Foundation, either version 3 of the License, or
15#   (at your option) any later version.
16#
17#   Calamares is distributed in the hope that it will be useful,
18#   but WITHOUT ANY WARRANTY; without even the implied warranty of
19#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20#   GNU General Public License for more details.
21#
22#   You should have received a copy of the GNU General Public License
23#   along with Calamares. If not, see <http://www.gnu.org/licenses/>.
24
25import libcalamares
26import os
27
28def ubiquity_fixes(root_mount_point):
29    '''
30        Create link to resolv.conf
31    '''
32    target_resolv_conf = os.path.join(root_mount_point,'etc','resolv.conf')
33    real_path_resolvconf = '/run/systemd/resolve/stub-resolv.conf'
34   
35    if os.path.exists(target_resolv_conf):
36        os.remove(target_resolv_conf)
37    os.symlink(real_path_resolvconf,target_resolv_conf)
38
39    return None
40
41def run():
42    """
43    Create ubiquity modifications
44    :return:
45    """
46    root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
47    return ubiquity_fixes(root_mount_point)
Note: See TracBrowser for help on using the repository browser.