diff options
author | Dirk von Suchodoletz | 2006-03-08 00:53:39 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-03-08 00:53:39 +0100 |
commit | 6b35840508287cc979202dc10e9ba41fe9f162b3 (patch) | |
tree | 14e46ca38b99bd1f5a2fc9955a2ff5046e26270b | |
parent | started to add alternative configuration via file (tftp get from (diff) | |
download | core-6b35840508287cc979202dc10e9ba41fe9f162b3.tar.gz core-6b35840508287cc979202dc10e9ba41fe9f162b3.tar.xz core-6b35840508287cc979202dc10e9ba41fe9f162b3.zip |
generate passwd/shadow from initrd ...
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@94 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r-- | initrd/distro-specs/debian/functions-3.1 | 16 | ||||
-rw-r--r-- | initrd/distro-specs/suse/functions-9.3 | 21 | ||||
-rw-r--r-- | initrd/distro-specs/ubuntu/functions-5.10 | 6 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 5 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 9 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/machine-setup | 4 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 2 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 3 |
8 files changed, 56 insertions, 10 deletions
diff --git a/initrd/distro-specs/debian/functions-3.1 b/initrd/distro-specs/debian/functions-3.1 index f0446010..cb92ffa2 100644 --- a/initrd/distro-specs/debian/functions-3.1 +++ b/initrd/distro-specs/debian/functions-3.1 @@ -2,13 +2,13 @@ # linux diskless clients (executed within initial # ramdisk after genconfig) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-03-2006 # Blabla # Blub # # Copyright: (c) 2006 - RZ Universitaet Freiburg # -# Version: 0.2.1a +# Version: 0.2.1b # distro specific stuff to initialize preinit () { @@ -30,6 +30,17 @@ for i in rc3.d/K$stop$script rc5.d/K$stop$script \ done } +# extended system users +extpasswd () { +echo -e "daemon:x:1:1:daemon:/usr/sbin:/bin/sh\nbin:x:2:2:bin:/bin:\n\ +/bin/sh\nsys:x:3:3:sys:/dev:/bin/sh\nman:x:6:12:man:/var/cache/man:/bin/sh\n\ +sshd:x:100:65534::/var/run/sshd:/bin/false\nnobody:x:65534:65534:nobody:\n\ +/nonexistent:/bin/sh" >> /mnt/etc/passwd +echo -e "daemon:*:13021:0:99999:7:::\nbin:*:13021:0:99999:7:::\n\ +sys:*:13021:0:99999:7:::\nman:*:13021:0:99999:7:::sshd:!:13021:0:99999:7:::\n\ +nobody:*:13021:0:99999:7:::" >> /mnt/etc/shadow +} + # group of functions for the normal runlevels - first parameter is start # second stop # function for ntp configuration @@ -186,6 +197,7 @@ config_xdm () { # configure gdm as display manager config_gdm () { + # gdm user >> passwd echo >/dev/null } diff --git a/initrd/distro-specs/suse/functions-9.3 b/initrd/distro-specs/suse/functions-9.3 index 8de50678..cd1e527f 100644 --- a/initrd/distro-specs/suse/functions-9.3 +++ b/initrd/distro-specs/suse/functions-9.3 @@ -14,7 +14,7 @@ # distro specific stuff to initialize preinit () { -# do nothing yet +# do nothing here (might be needed for other versions) : } postinit () { @@ -22,8 +22,6 @@ postinit () { udevstart } - - # udev/hotplug - auto device discovery service udev_hotplug () { local result=0 @@ -48,6 +46,19 @@ 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 @@ -55,9 +66,11 @@ config_ntp () { local start="07" local stop="14" if [ -f /mnt/etc/init.d/ntp ] ; then - strinfile "ntp:" /mnt/etc/passwd || \ + 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# entry added by $0: $date" \ diff --git a/initrd/distro-specs/ubuntu/functions-5.10 b/initrd/distro-specs/ubuntu/functions-5.10 index 85dd0f3f..59024122 100644 --- a/initrd/distro-specs/ubuntu/functions-5.10 +++ b/initrd/distro-specs/ubuntu/functions-5.10 @@ -65,6 +65,12 @@ for i in rc3.d/K$stop$script rc5.d/K$stop$script \ done } +# extended system users +extpasswd () { +echo -e "" >> /mnt/etc/passwd +echo -e "" >> /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/servconfig b/initrd/initrd-stuff/bin/servconfig index 7f7b419d..13d9ed3c 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -63,7 +63,10 @@ fi localization $country ####################################################################### -# setup passwd and shadow for local system users +# setup passwd and shadow for local system users like root, bin, daemon +# ... +basepasswd +extpasswd ####################################################################### # dns and ip configuration diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index e80fdc67..90ded7fd 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -362,6 +362,15 @@ 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 () { +echo -e "root:x:0:0:System Administrator:/root:/bin/bash" \ + > /mnt/etc/passwd +echo -e "root:"$root_pw":12958:0:10000::::" > /mnt/etc/shadow +} + +####################################################################### # localization simply derived from $language variable set in # machine-setup or other sources - mostly taken from knoppix localization () { diff --git a/initrd/initrd-stuff/etc/machine-setup b/initrd/initrd-stuff/etc/machine-setup index d9205997..35dc5a9c 100644 --- a/initrd/initrd-stuff/etc/machine-setup +++ b/initrd/initrd-stuff/etc/machine-setup @@ -6,7 +6,7 @@ # New settings are simply appended, so that they might # overwrite previously defined variables # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 30-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-03-2006 # Blabla # Blub # @@ -14,6 +14,8 @@ # # format variable="value" # +# password of system administrator (root) as crypt -> 'dxs-root' +root_pw='$2a$10$MoEYhIPZGCtR62R8UvBl3emNn2qMOuQpLQpfmNnhya4bGLhyF0pbu' ## name service configuration defaults # diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 4927081d..b917189e 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -413,7 +413,7 @@ d_mkbootld close # should be killed if started within init killall -9 dhcpcd dhclient pump 2>/dev/null -bash +#bash # post init for some distro specific postinit diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index b238567a..a76e6c86 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -3,7 +3,7 @@ # Description: universal (distro independent) generator for initial # ramdisks for linux diskless clients # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 06-03-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 08-03-2006 # Nico Dietrich # Blub # @@ -356,6 +356,7 @@ mkdir -p ${INSTDIR}/var/{lib,run} # tftp client binary for configuration via file - get machine-setup per # tftp from dhcp (or specified other) server +## irgendwann mal nur konditional ... for tftp in atftp tftp ; do binfinder $tftp && break done |