lorax/share/runtime-postinstall.tmpl

120 lines
4.4 KiB
Cheetah
Raw Normal View History

2011-07-25 23:39:48 +00:00
<%page args="root, basearch, libdir, configdir"/>
<%
KEYMAP_OVERRIDE = "usr/share/anaconda/keymaps-override-%s" % arch.basearch
SCREENFONT = "usr/share/anaconda/screenfont-%s.gz" % arch.basearch
2011-05-27 22:51:55 +00:00
PYTHONDIR = glob("usr/"+arch.libdir+"/python?.?")[0]
stubs = ("list-harddrives", "loadkeys", "raidstart", "raidstop")
%>
## create_keymaps(arch.basearch)
%if arch.basearch not in ("s390", "s390x"):
%if exists(KEYMAP_OVERRIDE):
move ${KEYMAP_OVERRIDE} etc/keymaps.gz
%else:
runcmd ${root}/usr/libexec/anaconda/getkeymaps ${arch.basearch} ${root}/etc/keymaps.gz ${root}
%endif
%endif
## create_screenfont()
moveif usr/share/anaconda/screenfont-${arch.basearch}.gz etc/screenfont.gz
## move_stubs()
move usr/share/anaconda/restart-anaconda usr/bin
move ${PYTHONDIR}/site-packages/pyanaconda/sitecustomize.py ${PYTHONDIR}/site-packages
%for stub in stubs:
moveif usr/share/anaconda/${stub}-stub usr/bin/${stub}
%endfor
## move_repos()
move etc/yum.repos.d etc/anaconda.repos.d
## misc_tree_modifications()
%if int(product.version) > 15:
## Configure systemd to start anaconda
remove etc/systemd/system/default.target
symlink /lib/systemd/system/anaconda.target etc/systemd/system/default.target
append bin/login "#!/bin/bash"
append bin/login "exec -l /bin/bash"
%else:
## Set up loader as init
remove sbin/init
copy usr/${libdir}/anaconda/init sbin/init
symlink init sbin/halt
symlink init sbin/poweroff
symlink init sbin/reboot
remove sbin/runlevel sbin/telinit
## dracut does stuff to /run so these links won't work..
remove var/run
remove var/lock
move run var/run
symlink run/lock var/lock
## Since systemd won't be setting up sockets in /run for us..
mkdir var/run/dbus
%endif
symlink /sbin/init init
install ${configdir}/network etc/sysconfig
append etc/resolv.conf ""
copy usr/share/anaconda/lang-table etc
## get_config_files(configdir)
## gconf stuff
gconfset /apps/metacity/general/button_layout string :
gconfset /apps/metacity/general/action_right_click_titlebar string none
gconfset /apps/metacity/general/num_workspaces int 1
gconfset /apps/metacity/window_keybindings/close string disabled
gconfset /apps/metacity/global_keybindings/run_command_window_screenshot string disabled
gconfset /apps/metacity/global_keybindings/run_command_screenshot string disabled
gconfset /apps/metacity/global_keybindings/switch_to_workspace_up string disabled
gconfset /apps/metacity/global_keybindings/switch_to_workspace_down string disabled
gconfset /apps/metacity/global_keybindings/switch_to_workspace_left string disabled
gconfset /apps/metacity/global_keybindings/switch_to_workspace_right string disabled
gconfset /desktop/gnome/interface/accessibility bool true
gconfset /desktop/gnome/interface/at-spi-corba bool true
## install files from configdir
install ${configdir}/rsyslog.conf etc
install ${configdir}/.bash_history root
install ${configdir}/.profile root
install ${configdir}/libuser.conf etc
%if exists(root+"/etc/selinux/targeted"):
install ${configdir}/selinux.config etc/selinux/config
%endif
## setup_sshd(configdir)
install ${configdir}/sshd_config.anaconda etc/ssh
install ${configdir}/pam.sshd etc/pam.d/sshd
install ${configdir}/pam.sshd etc/pam.d/login
install ${configdir}/pam.sshd etc/pam.d/remote
append etc/passwd "sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin"
append etc/passwd "install:x:0:0:root:/root:/sbin/loader"
append etc/shadow "root::14438:0:99999:7:::"
append etc/shadow "install::14438:0:99999:7:::"
chmod etc/shadow 400
%if arch.basearch in ("s390", "s390x"):
## misc_s390_modifications()
remove sbin/init
move usr/share/anaconda/linuxrc.s390 sbin/init
2011-05-27 15:03:38 +00:00
## generate ssh keys
runcmd ssh-keygen -q -C "" -N "" -t rsa1 -f ${root}/etc/ssh/ssh_host_key
runcmd ssh-keygen -q -C "" -N "" -t rsa -f ${root}/etc/ssh/ssh_host_rsa_key
runcmd ssh-keygen -q -C "" -N "" -t dsa -f ${root}/etc/ssh/ssh_host_dsa_key
chmod etc/ssh/ssh_host*_key 600
chmod etc/ssh/ssh_host*_key.pub 644
%endif
## get_anaconda_portions()
move usr/${libdir}/anaconda/loader sbin
move usr/share/anaconda/loader.tr etc
move usr/libexec/anaconda/auditd sbin
## move_modules()
move lib/modules modules
move lib/firmware firmware
symlink ../modules lib/modules
symlink ../firmware lib/firmware
2011-05-27 15:03:38 +00:00
## create_depmod_conf()
append etc/depmod.d/dd.conf "search updates built-in"
2011-06-30 20:05:43 +00:00
## TODO: we could run prelink here if we wanted?