Пример #1
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')
Пример #2
0
def configure():
    with create_file('/etc/sysctl.conf') as f:
        print("""
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1

vm.dirty_bytes = 33554432
vm.dirty_background_bytes = 33554432

vm.swappiness=0
""", file=f)
Пример #3
0
def configure():
    with create_file('/etc/portage/repos.conf/gentoo.conf') as f:
        print("""
[DEFAULT]
main-repo = gentoo

#[gentoo]
#location = /usr/portage
#sync-type = git
#sync-uri = git://anongit.gentoo.org/repo/gentoo.git
#auto-sync = yes
#sync-depth = 1 

[gentoo]
location = /usr/portage
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes

""", file=f)
Пример #4
0
def configure():
    with create_file("/etc/fstab") as f:
        print(
            """
# /etc/fstab: static file system information.
#
# See the manpage fstab(5) for more information.
#

#<fs>                                              <mountpoint>    <type>   <opts>                                     <dump/pass>

UUID=ccb93eec-a8b4-422b-974c-11edf8151371          /               ext4     noatime                                    0     1
UUID=ccb93eec-a8b4-422b-974c-11edf8151371          /boot           vfat     noatime                                    0     2
UUID=d3253c40-93e7-4f4d-84dc-e4336f37da5a          /disk           ext4     noatime                                    0     0
UUID=9ea5323b-bfc1-4b56-b991-2f60ff79401a          /home           ext4     noatime,defaults                           0     0
/dev/cdrom                                         /mnt/cdrom      auto     noauto,user,ro,utf8                        0     0
tmpfs                                              /tmp            tmpfs    noatime,nodiratime,nodev,nosuid,size=16G   0     0

""",
            file=f,
        )
Пример #5
0
def configure():
    with create_file('/etc/timezone') as f:
        print('Europe/Moscow', file=f)

    run_command('emerge --config sys-libs/timezone-data')
Пример #6
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')
Пример #7
0
def configure():
    #run_command('emerge -1v x11-apps/xdm')
    #run_command('rc-update add xdm default')

    with create_file('/etc/conf.d/xdm') as f:
        print('DISPLAYMANAGER="kdm"', file=f)