diff options
author | Dirk von Suchodoletz | 2006-03-21 21:30:47 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-03-21 21:30:47 +0100 |
commit | 2e328710ccf770caa967625d034ce1ebb4e65452 (patch) | |
tree | 677711078e3ea232799ccf885603a9e1f0b06562 /initrd | |
parent | Fix: dhclientuser für Ubuntu (diff) | |
download | core-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')
-rw-r--r-- | initrd/distro-specs/suse/functions-9.3 | 15 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 35 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 6 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 22 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 5 |
5 files changed, 31 insertions, 52 deletions
diff --git a/initrd/distro-specs/suse/functions-9.3 b/initrd/distro-specs/suse/functions-9.3 index ce5af64c..274d126a 100644 --- a/initrd/distro-specs/suse/functions-9.3 +++ b/initrd/distro-specs/suse/functions-9.3 @@ -4,7 +4,7 @@ # functions file). This file is the main base for the # following SuSE distributions # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-02-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 21-03-2006 # Blabla # Blub # @@ -46,19 +46,6 @@ for i in rc3.d/K$stop$script rc5.d/K$stop$script \ done } -# extended system users -extpasswd () { -echo -e "bin:x:1:1:bin:/bin:/bin/bash\ndaemon:x:2:2:Daemon:/sbin:\ -/bin/bash\nman:x:13:62:Manual pages viewer:/var/cache/man:/bin/bash\n\ -at:x:25:25:Batch jobs daemon:/var/spool/atjobs:/bin/bash\n\ -sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false\n\ -nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash" \ - >> /mnt/etc/passwd -echo -e "bin:*:8902:0:10000::::\ndaemon:*:8902:0:10000::::\n\ -man:*:8902:0:10000::::\nat:!:13078:0:99999:7:::\n\ -sshd:!:13078:0:99999:7:::\nnobody:*:13078::::::" >> /mnt/etc/shadow -} - # group of functions for the normal runlevels - first parameter is start # second stop # function for ntp configuration 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 } ####################################################################### diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index a09c5097..daeee9ff 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -49,7 +49,6 @@ D_DEFAULTCOUNTRY="<set in ~/distro-config/distro file>" # End of global variable declaration, nothing needed to be changed at # default below that line - usage() { echo Here is how to use mkdxsinitrd @@ -450,7 +449,7 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do mpath=${INSTDIR}/${mod%/*} mkdir -p ${mpath} cp ${ROOTDIR}/$mod ${mpath} - # fixmee!! selection of dependent modules could be handled a little bi + # fixmee!! selection of dependent modules could be handled a little bit # more clever case "$module" in e100|8139too|via-rhine|sis900|epic100|sundance|8139cp|eepro100|pcnet32) @@ -458,6 +457,8 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${DEBUGMODULES}; do ${INSTDIR}/lib/modules/${KERNVER}/kernel/drivers/net &>/dev/null ;; nfs) + # create directory structure for modules needed and copy them + # to the proper place (as expected by modprobe/modules.dep) mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/net/sunrpc/ mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/lockd mkdir -p ${INSTDIR}/lib/modules/${KERNVER}/kernel/fs/nfs_common |