summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-03-21 21:30:47 +0100
committerDirk von Suchodoletz2006-03-21 21:30:47 +0100
commit2e328710ccf770caa967625d034ce1ebb4e65452 (patch)
tree677711078e3ea232799ccf885603a9e1f0b06562 /initrd/initrd-stuff
parentFix: dhclientuser für Ubuntu (diff)
downloadcore-2e328710ccf770caa967625d034ce1ebb4e65452.tar.gz
core-2e328710ccf770caa967625d034ce1ebb4e65452.tar.xz
core-2e328710ccf770caa967625d034ce1ebb4e65452.zip
extended passwd function, some cleanups ...
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@110 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff')
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg35
-rwxr-xr-xinitrd/initrd-stuff/bin/servconfig6
-rw-r--r--initrd/initrd-stuff/etc/functions22
3 files changed, 27 insertions, 36 deletions
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
index 835124a0..b0c75dfd 100755
--- a/initrd/initrd-stuff/bin/hwautocfg
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -4,7 +4,7 @@
# script for linux diskless clients, using hwconfig from
# knoppix as base tool
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-03-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006
# Blabla
# Blub
#
@@ -276,6 +276,15 @@ fi
# USB core is needed for presence of /proc/bus/usb
modprobe ${MODPRV} usbcore &
+# "drivers" (pseudo, placeholder strings, ...) to exclude from loading
+DRIVERLIST=" disabled unknown ignore pcspkr synaptics keybdev"
+# driver blacklist (real modules which fail to load)
+DRIVERLIST=${DRIVERLIST}" hw_random ichxrom kanotix genericwheelusb "
+# hack for pseudo modules (not to load)
+for i in $DRIVERLIST ; do
+ echo -e "alias\t$i\tusbcore" >> /etc/modprobe.conf
+done
+
# load kernel module for ps2 mice
[ -f /lib/modules/${KERNEL}/kernel/drivers/input/mouse/psmouse.ko ] && \
modprobe ${MODPRV} psmouse
@@ -288,20 +297,7 @@ modprobe ${MODPRV} usbcore &
( hwsetup -v > /tmp/hwsetup.info && echo "hwsetup" > /tmp/hwrun1 ) &
# ACPI configuration - at least not needed with SuSE 9.3/10.0
-#if [ -d /proc/acpi ]; then
-# if ! strinstr "noacpi" ${KCMDLINE} || \
-# ! strinstr "acpi=off" ${KCMDLINE} ; then
-# found=""
-# for acpi in /lib/modules/$KERNEL/kernel/drivers/acpi/*; do
-# acpi=`basename acpi`
-# case "$acpi" in *_acpi)
-# egrep -qi "${basename%%_acpi}" /proc/acpi/dsdt 2>/dev/null || continue ;;
-# esac
-# modprobe $basename >/dev/null 2>&1 && echo -n " ${YELLOW}$basename${GREEN}" && found="yes"
-# done
-# fi
-#fi
-
+# needed for other distros?
# AGP configuration (agpgart and chipset specific driver)
modprobe ${MODPRV} agpgart || \
@@ -312,14 +308,7 @@ waitfor /tmp/hwrun1 50000 || \
error " Expected information from hwsetup to appear in \
/tmp/hwsetup.info.\n Unable to configure parts of the systems hardware. \
Please check that\n hwsetup is properly installed and executable."
-# "drivers" (pseudo, placeholder strings, ...) to exclude from loading
-DRIVERLIST=" disabled unknown ignore pcspkr synaptics keybdev"
-# driver blacklist (real modules which fail to load)
-DRIVERLIST=${DRIVERLIST}" hw_random ichxrom kanotix genericwheelusb "
-# hack for pseudo modules (not to load)
-for i in $DRIVERLIST ; do
- echo -e "alias\t$i\tusbcore" >> /etc/modprobe.conf
-done
+
# load ide drivers first, takes a while to initialize
for DRIVER in cmd64x hpt366 piix slc90e66 cs5520 it821x rz1000 \
triflex aec62xx cs5530 ns87415 sc1200 trm290 alim15x3 \
diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig
index 6f4f44ae..fce4d8c9 100755
--- a/initrd/initrd-stuff/bin/servconfig
+++ b/initrd/initrd-stuff/bin/servconfig
@@ -4,7 +4,7 @@
# for linux diskless clients (executed within initial
# ramdisk)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-03-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006
# Blabla
# Blub
#
@@ -70,9 +70,9 @@ localization $country
#######################################################################
# setup passwd and shadow for local system users like root, bin, daemon
-# ...
+# and nobody ... all other users should be added externally or with the
+# corresponding services
basepasswd
-extpasswd
#######################################################################
# dns and ip configuration
diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions
index 825eff17..ea7243b4 100644
--- a/initrd/initrd-stuff/etc/functions
+++ b/initrd/initrd-stuff/etc/functions
@@ -2,8 +2,8 @@
# linux diskless clients (included by init, hwautocfg,
# servconfig, ... within initial ramdisk)
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 07-03-2006
-# Blabla
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006
+# Felix Endres, 21-03-2006
# Blub
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
@@ -365,15 +365,17 @@ echo "not implemented" > /tmp/ldap-done
# base passwd/shadow, the standard user present in every system. All
# other system users should be generated within the service function
basepasswd () {
-# strip every line with userid between 500 and 99999 from the passwd-file
-# FIXME: "nobody" will be deleted too
-cat /mnt/etc/passwd | sed '/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[1-9][0-9]\{3,4\}:/d;/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[5-9][0-9]\{2\}:/d' > /mnt/etc/newpasswd
-mv /mnt/etc/newpasswd /mnt/etc/passwd
-
-
-#echo -e "root:x:0:0:System Administrator:/root:/bin/bash" \
-# > /mnt/etc/passwd
+# strip every line with userid between 500 and 99999 from the passwd
+# file
+sed '/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[1-9][0-9]\{3,4\}:/d;/^+:*/d;/^+$/d;
+ /^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[5-9][0-9]\{2\}:/d' /mnt/etc/passwd \
+ > /tmp/newpasswd
+# and add user nobody again (is there a more elegant way?)
+sed -n -e '/nobody/p' /mnt/etc/passwd >> /tmp/newpasswd
+cp /tmp/newpasswd /mnt/etc/passwd
+# create the shadow from passwd file
echo -e "root:"$root_pw":12958:0:10000::::" > /mnt/etc/shadow
+sed 's/:.*/:!:13078:0:99999:7:::/' /tmp/newpasswd >> /mnt/etc/shadow
}
#######################################################################