lorax/share/runtime-postinstall.tmpl

115 lines
4.3 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/"+arch.libdir+"/python?.?")[0]
stubs = ("list-harddrives", "loadkeys", "mknod", "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()
## set up our own init for F15, otherwise use systemd
%if int(product.version) == 15:
2011-05-13 16:24:05 +00:00
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
%else:
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
2011-05-13 16:24:05 +00:00
%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
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-05-26 22:36:30 +00:00
## TODO: cleanup_kernel_modules(), then depmod
## TODO: depmod -a -F ${root}/boot/System.map-${kver} -b ${root} ${kver}
%for moddir in glob("modules/*"):
remove ${moddir}/*.map ${moddir}/build ${moddir}/source
## FIXME: generate magical anaconda 'module-info' files
%endfor