lorax/share/runtime-postinstall.tmpl

128 lines
4.5 KiB
Cheetah
Raw Normal View History

2011-05-26 17:05:33 +00:00
<%page args="root, arch, configdir"/>
<%
KEYMAP_OVERRIDE = "usr/share/anaconda/keymaps-override-%s" % arch.basearch
SCREENFONT = "usr/share/anaconda/screenfont-%s.gz" % arch.basearch
PYTHONDIR = glob(root+"/usr/lib*/python?.?")[0]
stubs = ("list-harddrives", "loadkeys", "mknod", "raidstart", "raidstop")
%>
<%def name="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
</%def>
## 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
## create_depmod_conf()
append etc/depmod.d/dd.conf "search updates built-in"
## misc_tree_modifications()
2011-05-13 16:24:05 +00:00
%if conf.systemd:
symlink "/sbin/init" init
remove etc/systemd/system/default.target
symlink "/lib/systemd/system/anaconda.target" etc/systemd/system/default.target
install ${configdir}/network etc/sysconfig
%else:
copy usr/${libdir}/anaconda/shutdown sbin/shutdown
copy usr/${libdir}/anaconda/init sbin/init
symlink init sbin/halt
symlink init sbin/poweroff
symlink init sbin/reboot
remove sbin/runlevel sbin/shutdown sbin/telinit
%endif
append etc/resolv.conf ""
append bin/login "#!/bin/bash"
append bin/login "exec -l /bin/bash"
## 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
${generate_ssh_keys()}
%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
## no compress_modules (runtime's already compressed)
## run_depmod()
%for kernel in kernels:
runcmd depmod -a -F ${root}/boot/System.map-${kernel.version} -b ${root} ${kernel.version}
remove modules/${kernel.version}/*.map
remove modules/${kernel.version}/build
remove modules/${kernel.version}/source
## TODO FIXME: need anaconda magical module-info
%endfor