lorax/share/runtime-postinstall.tmpl

148 lines
5.3 KiB
Cheetah
Raw Normal View History

<%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
## TODO: prune this list - a lot of these are deprecated/gone
module =drm =net =scsi
## storage
module edd floppy ide-cd ide-cd_mod iscsi_ibft iscsi_tcp loop mmc-block
module scsi_mod scsi_wait_scan sd_mod sdhci sdhci-pci sg sr_mod st
module ums-alauda ums-cypress ums-datafab ums-freecom ums-jumpshot ums-karma
module ums-onetouch ums-sddr09 ums-sddr55 ums-usbat
## filesystems
module btrfs ext2 ext3 ext4 hfsplus fat jfs msdos reiserfs udf vfat xfs
module cramfs squashfs fuse cifs gfs2 nfs lockd sunrpc
## device controllers
module ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ub
module ohci1394 firewire-ohci firewire-sbp2 fw-ohci fw-sbp2 sbp2
module i82365 pcmcia tcic yenta_socket
## device-mapper & MD RAID
module dm-crypt dm-mirror dm-mod dm-multipath dm-round-robin dm-snapshot dm-zero
module linear raid0 raid1 raid10 raid456 raid5 raid6
## misc (network, i/o, crypto, virt)
module 8021q ipv6 netconsole
module appletouch bcm5974 mousedev pcspkr
module aes_generic arc4 cbc crc32c crypto_blkcipher ecb lrw sha256_generic xts
module virtio_pci
## s390 modules
%if basearch == "s390x":
module dasd_eckd_mod dasd_fba_mod dasd_diag_mod
%endif
## 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)
## TODO: run_depmod()