summaryrefslogtreecommitdiffstats
path: root/initrd/distro-specs/gentoo/functions-default
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-09-18 13:58:18 +0200
committerDirk von Suchodoletz2006-09-18 13:58:18 +0200
commitebe256e4b71415fdc3e0cf37782222c02742ac63 (patch)
tree3530e9d43a8769925f73eb364f2822f7d45f0554 /initrd/distro-specs/gentoo/functions-default
parentUpdated scripts for new path scheme (''opt'' prefix, see (diff)
downloadcore-ebe256e4b71415fdc3e0cf37782222c02742ac63.tar.gz
core-ebe256e4b71415fdc3e0cf37782222c02742ac63.tar.xz
core-ebe256e4b71415fdc3e0cf37782222c02742ac63.zip
Hopefully completed #78 task, moved directory name (initramfs to
distinguish from ancient but not longer used Initial Ramdisk concept) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@380 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/distro-specs/gentoo/functions-default')
-rw-r--r--initrd/distro-specs/gentoo/functions-default277
1 files changed, 0 insertions, 277 deletions
diff --git a/initrd/distro-specs/gentoo/functions-default b/initrd/distro-specs/gentoo/functions-default
deleted file mode 100644
index f3b3d633..00000000
--- a/initrd/distro-specs/gentoo/functions-default
+++ /dev/null
@@ -1,277 +0,0 @@
-# Description: configuration script for Gentoo V2005.1 to configure
-# linux diskless clients (executed within initial ramdisk
-# after genconfig)
-#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-07-2006
-#
-# Copyright: (c) 2006 - RZ Universitaet Freiburg
-#
-# Version: 0.0.2c
-
-# empty functions are defined at the beginning of /etc/functions
-
-# distro specific general function called from servconfig script
-config_distro () {
-echo -e "dxs version 4.0a\ninitramfs generation date $date" \
- >> /mnt/etc/gentoo-release
-echo -e "# changes made to this file by $0 (initrd from $date)" \
- > /etc/rc.conf
-# keytable is set by hwautocfg script (added just for convenience here)
-config_rc_entry "KEYMAP" "${KEYTABLE}"
-}
-
-# udev service - not verified!
-udev_hotplug () {
-echo "Starting udev"
-ln -s /bin/udevd /bin/udevstart && udevstart &
-if [ -x /bin/udevd ] ; then
- export UDEVD_EXPECTED_SEQNUM=$(cat /sys/kernel/hotplug_seqnum)
- export UDEVD_EVENT_TIMEOUT=1
- echo "" > /proc/sys/kernel/hotplug
- udevd &
-else error "$df_errudev" nonfatal
-fi
-}
-
-# linking runlevel scripts
-rllinker () {
-local script="$1"
-local need="$2"
-# empty runlevel links - decision on running certain services is
-# passed via configuration
-ln -s /etc/${D_INITDIR}/$1 /mnt/etc/runlevels/default/$1
-echo $1 >> /mnt/etc/runlevels/default/.critical
-# hack to remove unneeded dependency stuff
-#if [ "$script" != "vmware-prep" ] ; then
-# sed "/depend/,/}/d" /mnt/etc/${D_INITDIR}/$1 > /etc/rls
-# cp /etc/rls /mnt/etc/${D_INITDIR}/$1
-#fi
-}
-
-# setup initial boot scripts (rather strange concept I did not get
-# completely)
-initial_boot () {
-rm /mnt/etc/runlevels/*/.critical 2>/dev/null
-for i in ${D_INITSCRIPTS}; do
- ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/$i
- echo $i >> /mnt/etc/${D_INITBOOTD}/.critical
- echo $i >> /mnt/etc/runlevels/default/.critical
-done
-}
-
-# initialize boot.ld - skript to be executed during early system startup
-# (before most of the normal boot init scripts)
-# this script should operate like a normal runlevel script
-# initialize boot.ld - skript to be executed during early system startup
-# (before most of the normal boot init scripts)
-# this script should operate like a normal runlevel script (fixme!!)
-d_mkrlscript () {
-local switch="$1"
-local name="$2"
-local info="$3"
-case "$switch" in
- init)
- echo -e "#!/sbin/runskript\n# skeleton of /etc/${D_INITDIR}/$name \
-generated by $0\ndepend() {\n\t:\n}" >/mnt/etc/${D_INITDIR}/$name
- echo -e "\n\nstart() {\n\tebegin \"$info\"" \
- >>/mnt/etc/${D_INITDIR}/$name
- chmod u+x /mnt/etc/${D_INITDIR}/$name
- ;;
- close)
- echo -e "\n}\n\nstop() {\n\t:\n}\n# vim:ts=4" \
- >>/mnt/etc/${D_INITDIR}/$name
- ;;
-esac
-}
-
-# group of functions for the normal runlevels
-# function for ntp configuration (unchecked)
-config_ntp () {
-if [ -e /mnt/etc/${D_INITDIR}/ntp ] ; then
- if ! strinfile "ntp:" /mnt/etc/passwd ; then
- echo -e "ntp:x:74:65534:NTP daemon:/var/lib/ntp:/bin/false" \
- >>/mnt/etc/passwd
- echo -e "ntp:!:13099:0:99999:7:::" >>/mnt/etc/shadow
- fi
- testmkd /mnt/var/lib/ntp/var/run/ntp &>/dev/null
- if [ "x$start_ntp" = "xinitial" ] ; then
- echo -e "\t# entries added by $0 (InitRamFS from $date)\n\
-\t( ntpdate -s -b $ntp_servers >${LOGFILE} 2>&1 && {\n\t which \
-hwclock &>/dev/null && hwclock -w;} ) &" \
- >>/mnt/etc/${D_INITDIR}/boot.ld
- elif [ "x$start_ntp" = "xyes" ] ; then
- rllinker "ntp"
- fi
-fi
-}
-
-# function for atd (unchecked)
-config_atd () {
-if [ "x$start_atd" = "xyes" ]; then
- rllinker "atd"
-fi
-}
-
-# cron service
-config_cron () {
-if [ "x$start_cron" = "xyes" ] ; then
- if [ -f /mnt/etc/${D_INITDIR}/cron ] ; then
- :
- else
- error "$df_errcron" nonfatal
- fi
-fi
-}
-
-# syslog service
-config_syslog () {
-if [ "x$start_syslog" = "xyes" ] ; then
- if [ -f /mnt/etc/${D_INITDIR}/syslog-ng ] ; then
- rllinker syslog-ng
- else
- error "$df_errsysl" nonfatal
- fi
-fi
-}
-
-# secure shell service
-config_sshd () {
-if [ "x$start_sshd" = "xyes" ] ; then
- if [ -f /mnt/etc/${D_INITDIR}/sshd ] ; then
- rllinker "sshd"
- else
- error "$df_errsshd" nonfatal
- fi
-fi
-}
-
-# snmp agent for remote monitoring (unchecked)
-config_snmp () {
-if [ "x$start_snmp" = "xyes" ] ; then
- if [ -f /mnt/etc/${D_INITDIR}/snmpd ] ; then
- rllinker "snmpd"
- testmkd /mnt/var/lib/net-snmp >/dev/null 2>&1
- fi
- # fixme!!
- # write service monitor depending on services started
- fi
-}
-
-# configure X display manager (runlevel links and kind of manager)
-config_xdm () {
-if [ -f /mnt/etc/${D_INITDIR}/xdm ] ; then
- sed -e "s,DISPLAYMANAGER=.*,DISPLAYMANAGER=\"xdm\"," -i /mnt/etc/rc.conf
- ln -s /etc/${D_INITDIR}/xdm /mnt/etc/runlevels/boot/xdm
- ln -s /etc/${D_INITDIR}/xdm /mnt/etc/runlevels/default/xdm
- echo "xdm" >> /mnt/etc/runlevels/boot/.critical
-fi
-}
-
-# change entries in rc.conf (most for convenience only)
-config_rc_entry () {
-local var=$1
-local value=$2
-sed -e "s,$var=.*,$var=\"$value\"," -i /mnt/etc/rc.conf
-}
-
-# configure gdm
-config_gdm () {
-config_rc_entry "DISPLAYMANAGER" "gdm"
-# fixme!! check for needed directories and permissions
-#testmkd /mnt/var/lib/gdm
-#testmkd /mnt/var/log/gdm
-#strinfile "gdm:" /mnt/etc/passwd || echo "gdm:x:50:15:Gnome Display Manager \
-#Daemon:/var/lib/gdm:/bin/false" >>/mnt/etc/passwd
-# hack - gdm should be user 50 and shadow group 15
-#chown 50:15 /mnt/var/lib/gdm /mnt/var/log/gdm
-#chmod 0750 /mnt/var/lib/gdm /mnt/var/log/gdm
-#rllinker "gdm" ??
-}
-
-# configure kdm as display manager
-config_kdm () {
-config_rc_entry "DISPLAYMANAGER" "kdm"
-}
-
-# configure bluetooth services
-config_bt () {
-rllinker "bluetooth"
-}
-
-# set consolefont
-consolefont () {
-echo -e "\tsetfont ${CONSOLE_FONT} >${LOGFILE} 2>&1\n" \
- >>/mnt/etc/${D_INITDIR}/boot.ld
-config_rc_entry "CONSOLEFONT" "${CONSOLE_FONT}"
-}
-
-# acpi and powersave
-config_acpi () {
-rllinker acpid
-# remove dependencies (runs unneeded services ...)
-sed "/depend/,/}/d" -i /mnt/etc/${D_INITDIR}/acpid
-}
-
-# configure automounter
-config_automount () {
-if [ -f /mnt/etc/${D_INITDIR}/autofs ] ; then
- rllinker autofs
- if [ -n "${automnt_src}" ] ; then
- # local directory and home directory server from machine-setup
- [ -z "${automnt_dir}" ] && automnt_dir="/home"
- strinstr "/" "${automnt_dir}" && error "$df_erratpld" nonfatal
- automnt_dir=${automnt_dir#/}
- echo -e "/home\t/etc/auto.${automnt_dir}\n" >> /mnt/etc/auto.master
- echo -e "# /etc/auto.${automnt_dir} created by $0:\n" \
- > /mnt/etc/auto.${automnt_dir}
- echo -e "*\t-rsize=32768,wsize=32768,rw\t${automnt_src}/&" \
- >> /mnt/etc/auto.${automnt_dir}
- config_portmap
- fi
-else
- error "$df_erramnt" nonfatal
-fi
-}
-
-# start name service caching daemon (recommended in combination with
-# ldap source as user admin base)
-config_nscd () {
-if [ -f /mnt/etc/${D_INITDIR}/nscd ] ; then
- #testmkd /mnt/var/run/nscd
- rllinker "nscd"
-fi
-}
-
-# start portmapper (needed at least for nfs and nis services - unchecked)
-config_portmap () {
-rllinker "portmap"
-}
-
-# start NIS (fixmee: does the start script is really named ypbind?)
-config_nis () {
-rllinker "ypbind"
-}
-
-# start vmware and vmware preparation services
-config_vmware () {
-rllinker "vmware-prep"
-rllinker "vmware"
-# during vmware sessions linux should not handle usb events/devices
-testmkd /mnt/var/X11R6/bin
-echo '#!/bin/sh'>> /mnt/etc/udev/rules.d/01-udev-vm.rules
-echo -e "# Script for blocking linux from handling usb \
-devices\n# during vmware sessions. If you like to remove certain modules \
-add them\n# to the list below - Dirk von Suchodoletz, <dirk@goe.net>\n\
-STATE=1\nps aux|grep -i vmware|grep -v \"grep\" &>/dev/null && { STATE=0; \
-/sbin/rmmod usb-storage &>/tmp/null; }\n\
-[ x\$ACTION = xremove ] && { [ \$STATE = 0 ] && /sbin/rmmod usb-storage \
-&>/dev/null; }\nexit \$STATE" > /mnt/var/X11R6/bin/vm-udev
-chmod u+x /mnt/var/X11R6/bin/vm-udev
-echo -e "# special entry to block linux from reacting to usb events during \
-running\n# vmware sessions, generated by $0 during initramfs\n# Dirk von \
-Suchodoletz, <dirk@goe.net>\nSUBSYSTEM==\"usb\", ACTION==\"add\", \
-PROGRAM=\"/var/X11R6/bin/vm-udev\", OPTIONS=\"ignore_device\"\n\
-SUBSYSTEM==\"usb\", ACTION==\"remove\", PROGRAM=\"/var/X11R6/bin/vm-udev\"" \
- >> /mnt/etc/udev/rules.d/01-udev-vm.rules
-}
-