Beispiel #1
0
def configure():
    print('Setting profile:')

    run_command('eselect profile list')

    print('Enter number of profile: ', end='')
    eselect = input()
    run_command('eselect profile set {}'.format(eselect))
Beispiel #2
0
def configure():

    with create_file('/etc/conf.d/hostname') as f:
        print('hostname="zion"', file=f)

    with create_file('/etc/conf.d/net') as f:
        print('config_eth0="dhcp"', file=f)
        print('config_eth1="dhcp"', file=f)
        
    run_command("emerge -v1 net-misc/dhcpcd")

    os.chdir('/etc/init.d')
    os.system('ln -s net.lo net.eth0')
    os.system('rc-update add net.eth0 default')
Beispiel #3
0
def configure():
    with create_file('/etc/timezone') as f:
        print('Europe/Moscow', file=f)

    run_command('emerge --config sys-libs/timezone-data')
Beispiel #4
0
def configure():

    with create_file('/etc/locale.gen') as f:
        print('ru_RU.UTF-8 UTF-8\nen_US.UTF-8 UTF-8', file=f)

    with create_file('/etc/environment') as f:
        print('LANG="en_US.UTF-8"', file=f)

    with create_file('/etc/conf.d/consolefont') as f:
        print('consolefont="LatArCyrHeb-14"', file=f)

    with create_file('/etc/conf.d/keymaps') as f:
        print("""
keymap="us"
windowkeys="yes"
extended_keymaps=""
dumpkeys_charset=""
fix_euro="no"
""", file=f)

    with create_file('/etc/conf.d/hwclock') as f:
        print('clock="local"', file=f)

    run_command('emerge -1v net-misc/ntp')

    with create_file('/etc/ntp.conf') as f:
        print("""
# Common pool for random people
#server pool.ntp.org

server ntp1.stratum2.ru
server ntp2.stratum2.ru
server ntp3.stratum2.ru

server ntp1.stratum1.ru
server ntp2.stratum1.ru
server ntp3.stratum1.ru

# Pools for Gentoo users
server 0.gentoo.pool.ntp.org
server 1.gentoo.pool.ntp.org
server 2.gentoo.pool.ntp.org
server 3.gentoo.pool.ntp.org

driftfile       /var/lib/ntp/ntp.drift

restrict default nomodify nopeer noquery limited kod
restrict 127.0.0.1
restrict [::1]
""", file=f)

    run_command('rc-update add ntpd default')

    with create_file('/etc/profile.d/xdg_cache_home.sh') as f:
        print("""
export XDG_CACHE_HOME="/tmp/${USER}/.cache"
""", file=f)

    with create_file('/etc/env.d/02locale') as f:
        print("""
LANG="en_US.UTF-8"
LC_COLLATE="C"
""", file=f)

    run_command('locale-gen')
    run_command('env-update')
    run_command('source /etc/profile')
    run_command('emerge -1v x11-apps/setxkbmap')
    run_command('setxkbmap -layout "us,ru(winkeys)" -option grp:caps_toggle,grp_led:caps')
Beispiel #5
0
def update_portage():
    run_command('emerge-webrsync')
    run_command('emerge --sync --quiet')
    run_command('emerge eix')
    run_command('eix-sync -q -H')
Beispiel #6
0
def install_packages(requirements_file):
    """ Installs all packages specified in Requirements.txt file """
    run_command('pip install -r {}'.format(requirements_file))