summaryrefslogtreecommitdiffstats
path: root/initramfs/distro-specs/gentoo
diff options
context:
space:
mode:
authorBastian Wissler2006-12-21 15:42:55 +0100
committerBastian Wissler2006-12-21 15:42:55 +0100
commit4cc81ed03a4842c16dd7230ed046a4acabfa0a81 (patch)
tree3e1583a9c7cf771375b5baf42b995cfe7d3b19c8 /initramfs/distro-specs/gentoo
parentWe no longer have to use the _main suffix for SLX_INST_SOURCE* as we (diff)
downloadcore-4cc81ed03a4842c16dd7230ed046a4acabfa0a81.tar.gz
core-4cc81ed03a4842c16dd7230ed046a4acabfa0a81.tar.xz
core-4cc81ed03a4842c16dd7230ed046a4acabfa0a81.zip
A few files which are propably needed by udevd + version update (gentoo)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@577 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/distro-specs/gentoo')
-rw-r--r--initramfs/distro-specs/gentoo/config-2005.123
-rw-r--r--initramfs/distro-specs/gentoo/files-default/etc/group37
-rw-r--r--initramfs/distro-specs/gentoo/functions-2005.1275
-rw-r--r--initramfs/distro-specs/gentoo/functions-default3
4 files changed, 337 insertions, 1 deletions
diff --git a/initramfs/distro-specs/gentoo/config-2005.1 b/initramfs/distro-specs/gentoo/config-2005.1
new file mode 100644
index 00000000..2bae4d17
--- /dev/null
+++ b/initramfs/distro-specs/gentoo/config-2005.1
@@ -0,0 +1,23 @@
+# Description: distro specific settings for Gentoo 2005.1
+#
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 23-06-2006
+#
+# Copyright: (c) 2005,6 - RZ Universitaet Freiburg
+
+# D_SYSCONFDIR - system wide configuration settings in /etc - sysconfig in
+# SuSE and RedHat, default in Debian and Ubuntu, conf.d in Gentoo
+# D_ETCEXCL - list of files, wildcards to be excluded from /etc when using
+# bind mounts
+# D_DIRINBINDMNT - lists of directories to be created in bind mounted rw
+# part of the client filesystem
+# D_RODIRSINRW - ReadOnly Directories in RW part of filesystem to save on
+# TempFS usage
+# D_DIRINDXS - directories in client filesystem which should be present
+# anyhow
+# D_RCDIRS - runlevel directories relative to /etc
+# D_HWMODTOIGNORE - hardware modules which should not tried to load (because
+# already in kernel, nonexistent, ...)
+# D_BOOTLOCAL - script for user specified stuff which should be started
+# during client bootup, path and file relative to /etc
+
+# nothing changed yet
diff --git a/initramfs/distro-specs/gentoo/files-default/etc/group b/initramfs/distro-specs/gentoo/files-default/etc/group
new file mode 100644
index 00000000..bd56b164
--- /dev/null
+++ b/initramfs/distro-specs/gentoo/files-default/etc/group
@@ -0,0 +1,37 @@
+root::0:root
+bin::1:root,bin,daemon
+daemon::2:root,bin,daemon
+sys::3:root,bin,adm
+adm::4:root,adm,daemon
+tty::5:
+disk::6:root,adm
+lp::7:lp
+mem::8:
+kmem::9:
+wheel::10:root,test
+floppy::11:root
+mail::12:mail
+news::13:news
+uucp::14:uucp
+man::15:man
+console::17:
+audio::18:test
+cdrom::19:
+dialout::20:root
+tape::26:root
+video::27:root
+cdrw::80:
+usb::85:
+users::100:games,test
+nofiles:x:200:
+smmsp:x:209:smmsp
+portage::250:portage
+utmp:x:406:
+nogroup::65533:
+nobody::65534:
+sshd:x:22:
+cron:x:16:
+test:x:1000:
+lpadmin:x:106:
+vmware:x:1001:
+rpc:x:111:
diff --git a/initramfs/distro-specs/gentoo/functions-2005.1 b/initramfs/distro-specs/gentoo/functions-2005.1
new file mode 100644
index 00000000..d3412ca3
--- /dev/null
+++ b/initramfs/distro-specs/gentoo/functions-2005.1
@@ -0,0 +1,275 @@
+# configuration script for Gentoo linux distribution to configure OpenSLX
+# linux diskless clients (executed within initialramfs after genconfig)
+#
+# Dirk von Suchodoletz <dirk@goe.net>, 08-07-2006
+#
+# (c) 2006 - RZ Universitaet Freiburg
+# (c) 2006 - OpenSLX.ORG Project
+
+# 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 () {
+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}/vixie-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)
+# gentoo: netmount???
+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
+}
+
diff --git a/initramfs/distro-specs/gentoo/functions-default b/initramfs/distro-specs/gentoo/functions-default
index 3cbe284a..d3412ca3 100644
--- a/initramfs/distro-specs/gentoo/functions-default
+++ b/initramfs/distro-specs/gentoo/functions-default
@@ -112,7 +112,7 @@ fi
# cron service
config_cron () {
if [ "x$start_cron" = "xyes" ] ; then
- if [ -f /mnt/etc/${D_INITDIR}/cron ] ; then
+ if [ -f /mnt/etc/${D_INITDIR}/vixie-cron ] ; then
:
else
error "$df_errcron" nonfatal
@@ -240,6 +240,7 @@ fi
}
# start portmapper (needed at least for nfs and nis services - unchecked)
+# gentoo: netmount???
config_portmap () {
rllinker "portmap"
}