diff options
author | Dirk von Suchodoletz | 2007-04-28 19:20:16 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-04-28 19:20:16 +0200 |
commit | 27323a9c9a2ed48df30efd37f65a55caac1db5d4 (patch) | |
tree | 664def21a95e0f049a9f69d801d532a6e0e09353 /initramfs | |
parent | Proper error message if no eth0 appeared ... (diff) | |
download | core-27323a9c9a2ed48df30efd37f65a55caac1db5d4.tar.gz core-27323a9c9a2ed48df30efd37f65a55caac1db5d4.tar.xz core-27323a9c9a2ed48df30efd37f65a55caac1db5d4.zip |
Code cleanups, simplifications ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@942 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r-- | initramfs/distro-specs/suse/functions-default | 30 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 5 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 38 | ||||
-rwxr-xr-x | initramfs/mkdxsinitrd | 17 |
4 files changed, 34 insertions, 56 deletions
diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default index b7e1a1c0..af56cbd9 100644 --- a/initramfs/distro-specs/suse/functions-default +++ b/initramfs/distro-specs/suse/functions-default @@ -94,14 +94,12 @@ hwclock &>/dev/null && hwclock -w;} ) &" \ fi fi } - # function for atd config_atd () { if [ "x$start_atd" = "xyes" ]; then rllinker "atd" "14" "04" fi } - # function for configuration of cron services config_cron () { if [ "x$start_cron" = "xyes" ] ; then @@ -118,7 +116,6 @@ if [ "x$start_cron" = "xyes" ] ; then fi fi } - # syslog service (different syslogs might be present) config_syslog () { if [ "x$start_syslog" != "xno" ] ; then @@ -131,7 +128,6 @@ if [ "x$start_syslog" != "xno" ] ; then fi fi } - # secure shell service config_sshd () { if [ "x$start_sshd" = "xyes" ] ; then @@ -144,7 +140,6 @@ if [ "x$start_sshd" = "xyes" ] ; then fi fi } - # snmp agent for remote monitoring config_snmp () { if [ "x$start_snmp" = "xyes" ] ; then @@ -156,7 +151,6 @@ if [ "x$start_snmp" = "xyes" ] ; then # write service monitor depending on services started fi } - # configure print server (lpd or cups) config_printer () { if [ "x${start_printdaemon}" != "x" ] && \ @@ -185,7 +179,6 @@ if [ "x$lpr_servers" != "x" ] && [ ! -e /rootfs/etc/cups/client.conf ] ; then #\t$date\n#\nServerName\t$lpr_servers" > /mnt/etc/cups/client.conf fi } - # configure samba service config_samba () { if [ "$start_samba" != "no" ]; then @@ -222,7 +215,6 @@ if [ "$start_samba" != "no" ]; then -i /mnt/etc/lisarc fi } - # configure X display manager (/etc/${D_SYSCONFDIR}/displaymanager) config_dm_entry () { local dm="$1" @@ -246,12 +238,10 @@ else rm /etc/${D_INITBOOTD}/S02xdm) &\n" >>/mnt/etc/${D_INITDIR}/boot.slx fi } - # configure X display manager (runlevel links and kind of manager) config_xdm () { config_dm_entry yes } - # configure gdm as display manager config_gdm () { config_dm_entry yes @@ -374,17 +364,13 @@ flexible=true\nhandled=true" >>/mnt/etc/opt/gnome/gdm/gdm.conf fi fi } - # configure kdm as display manager config_kdm () { # first define directories for kdm kdmrcdir=/etc/opt/kde3/share/config/kdm xdmdir=/etc/X11/xdm - testmkd /mnt/${kdmrcdir} - config_dm_entry yes - # write configuration file # use general config in /etc/functions config_kdm_template @@ -400,7 +386,6 @@ else : # no bluetooth components installed fi } - # set up keytable (function run in hwautocfg) # kbd runlevel link is set via config_distro to avoid clashes between # servconfig and hwautocfg settings @@ -410,7 +395,6 @@ sed -e "s,KEYTABLE=.*,KEYTABLE=\"${KEYTABLE}\"," \ echo -e "\tloadkeys ${KEYTABLE} >${LOGFILE} 2>&1\n" \ >>/mnt/etc/${D_INITDIR}/boot.slx } - # consolefont and language (function run in hwautocfg) consolefont () { echo -e "\tsetfont ${CONSOLE_FONT} >${LOGFILE} 2>&1\n" \ @@ -418,7 +402,6 @@ echo -e "\tsetfont ${CONSOLE_FONT} >${LOGFILE} 2>&1\n" \ sed -e "s,RC_LANG=.*,RC_LANG=\"${LANG}\" # added in initrd," \ -i /mnt/etc/${D_SYSCONFDIR}/language } - # acpi and powersave daemons, required e.g. to shutdown the machine via # power button, no need for early start config_acpi () { @@ -427,7 +410,6 @@ rllinker powersaved "23" "11" # dbus is required to run acpid and powersaved start_dreshal="yes" } - # configure dbus (inter application communication for kde and gnome), hal # (hardware abstraction layer - used e.g. by powersaved) and resmgr # (resource manager - the user gets permissions to devices when loggin on) @@ -470,8 +452,7 @@ if [ "x$start_dreshal" = "xyes" ]; then fi fi } - -# configure automounter +# configure automounter (fixme: config version for NFSv4 might be required) config_automount () { if [ -e /mnt/etc/${D_SYSCONFDIR}/autofs ] ; then testmkd /var/lock/subsys @@ -487,17 +468,15 @@ fi config_nscd () { if [ -e /mnt/etc/${D_INITDIR}/nscd ] ; then testmkd /mnt/var/run/nscd - rllinker "nscd" "02" "16" + rllinker "nscd" "16" "16" else error "$df_errnsc" nonfatal fi } - # start portmapper (needed at least for nfs and nis services) config_portmap () { rllinker "portmap" "02" "20" } - # start NIS config_nis () { if [ -f /mnt/etc/${D_INITDIR}/ypbind ] ; then @@ -508,7 +487,6 @@ else error "$df_erryp" nonfatal fi } - # start vmware config_vmware () { if [ -f /mnt/etc/${D_SYSCONFDIR}/vmware ] ; then @@ -523,12 +501,11 @@ if [ -f /mnt/etc/${D_SYSCONFDIR}/vmware ] ; then sed -e "s,TARGETS =,TARGETS = vmware-prep," \ /mnt/etc/${D_INITDIR}/.depend.start >> /etc/.depend.start echo "vmware-prep: " >> /etc/.depend.start - cp /etc/.depend.start /mnt/etc/${D_INITDIR}/.depend.start + mv /etc/.depend.start /mnt/etc/${D_INITDIR}/.depend.start else error "df_errvmw" nonfatal fi } - # initialize runlevel skript to be executed during system startup # (before most of the normal boot init scripts) # this script should operate like a normal runlevel script @@ -551,7 +528,6 @@ rerun\n# the mkdxsinitrd script to get them applied\n\ ;; esac } - # Xorg variable settings. Lots of stuff changes for newer Xorg servers displayvars () { synapticsdrv="/usr/X11R6/lib/modules/input/synaptics_drv.o" diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 829cfd5f..e3b848b1 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -9,7 +9,7 @@ # # General information about OpenSLX can be found at http://openslx.org # -# common functions file for the configuration of linux diskless clients +# Common functions file for the configuration of linux diskless clients # (included by init, hwautocfg, servconfig, ... within OpenSLX initialramfs) ############################################################################# @@ -34,7 +34,6 @@ udev_hotplug () { : } - ############################################################################# # generate events with the sysfs trigger trigger_device_events () { @@ -518,11 +517,11 @@ sed '/^[a-zA-Z0-9]*:[a-zA-Z0-9]*:[1-9][0-9]\{3,4\}:/d;/^+:*/d;/^+$/d; > /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:::/;/^root.*/d' /tmp/newpasswd \ >> /mnt/etc/shadow +mv /tmp/newpasswd /mnt/etc/passwd chmod 0640 /mnt/etc/shadow } diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index f437f133..eaa89173 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -54,7 +54,6 @@ mknod /dev/zero c 1 5 mknod /dev/urandom c 1 9 mknod /dev/kmsg c 1 11 mknod /dev/console c 5 1 -mknod /dev/ctl b 241 255 mknod /dev/bootsplash p mkdir -p ${devdir}/pts @@ -235,9 +234,8 @@ done # or halt of the machine if SLX init does not succeed (e.g. missing kernel # module for the network adaptor) if [ ${DEBUGLEVEL} -lt 3 -o ${DEBUGLEVEL} = 8 ] ; then - [ -x /bin/busybox ] && shtype=a cat<<EOF > /bin/watchdog -#!/bin/${shtype}sh +#!/bin/ash echo \$$ > /tmp/watchdogpid [ ! -f /proc/version ] && mount -n -t proc proc /proc . /etc/functions @@ -408,7 +406,7 @@ if [ -n "${nbdmod}" ] ; then fi echo "Using Copy-on-Write block device for rw access" mount -n -t tmpfs -o size=${cowsize} ramfs ${rwdir} - mkdir /dev/cow && cp -a /tmp/ctl /dev/cow + mkdir /dev/cow && mknod /dev/cow/ctl b 241 255 usleep 200 ln -s /dev/cowloop0 /dev/cow/0 cowdev -a /dev/nbd0 ${rwdir}/nbd.cow @@ -620,9 +618,8 @@ echo -e "rootfs / rootfs rw 0 0\ninitramdevs /dev tmpfs rw\ # copy library cache if generated if [ -z "${noldsc}" ] ; then if waitfor /tmp/ldcfg 50000 ; then - test -s /mnt/tmp/ld.so.cache && { - cp /mnt/tmp/ld.so.cache /mnt/etc/ld.so.cache - rm /mnt/tmp/ld.so.cache; } + test -s /mnt/tmp/ld.so.cache && \ + mv /mnt/tmp/ld.so.cache /mnt/etc/ld.so.cache else error "$init_errldcfg" fi @@ -635,45 +632,42 @@ waitfor /tmp/hwcfg 30000 || error "$init_errhw" >> /mnt/etc/udev/rules.d/04-scanner.rules # wait for completion of Xorg configuration and finalize it waitfor /tmp/xready 20000 || error "$init_errxorg" nonfatal -cp /etc/xorg.conf /mnt/${D_XF86CONFFILE} +mv /etc/xorg.conf /mnt/${D_XF86CONFFILE} # wait a while for services setup to complete waitfor /tmp/svcfg 20000 || error "$init_errsw" # IP configuration is complete and should not be updated automatically -killall -9 dhcpcd dhclient pump udhcpc 2>/dev/null +killall -9 dhcpcd dhclient udhcpc 2>/dev/null # copy machine configuration file into stage4 filesystem -cp /etc/machine-setup /mnt/etc +mv /etc/machine-setup /mnt/etc -#If uniondirs is not set yet, maybe the unions were given via machine-setup +# if uniondirs is not set yet, maybe the unions were given via machine-setup if [ -z "$uniondirs" ]; then if [ "$union_type" == "AUFS" ]; then - #Does it contain "://"? + # does it contain "://"? if [ "$aufs" != "${aufs#*://}" ]; then - uniondirs=$aufs + uniondirs="$aufs" fi elif [ "$union_type" == "UnionFS" ]; then - #Does it contain "://"? + # does it contain "://"? if [ "$unionfs" != "${unionfs#*://}" ]; then - uniondirs=$unionfs + uniondirs="$unionfs" fi fi fi -# If locations are given that should be unioned with the fs root, do it +# if locations are given that should be unioned with the fs root, do it if [ -n "$uniondirs" ]; then - include_in_fsroot_union $union_type $uniondirs + include_in_fsroot_union "$union_type" "$uniondirs" fi # post init for some distro specific (fixme!! more elegant solution) postinit [ -s /initramfs/postinit.local ] && \ - cp /initramfs/postinit.local /bin/postinit.local + mv /initramfs/postinit.local /bin/postinit.local [ -x /bin/postinit.local ] && { [ $DEBUGLEVEL -gt 0 ] && \ echo "Running postinit.local - if boot stops here, check the script!" /bin/postinit.local; } - - - # start a debug shell in higher debug levels [ $DEBUGLEVEL -gt 2 -a $DEBUGLEVEL != 8 ] && /bin/sh @@ -707,7 +701,7 @@ killall -9 udevd hwautocfg servconfig 2>/mnt/dev/null [ -f /tmp/watchdogpid ] && kill $(cat /tmp/watchdogpid) 2>/mnt/dev/null umount -n /proc # unset old environment variables -unset debug date initrd ip dnbdroot nbdroot nfsroot rootfs ticks vci vga +unset client debug date initrd ip dnbdroot nbdroot nfsroot rootfs ticks vci vga unset BOOT_IMAGE KCMDLINE KERNEL MODPRV NWMODULES OLDPWD UDEVD_EVENT_TIMEOUT \ SLXVERSION UDEVD_EXPECTED_SEQNUM PATH # new style of pivoting (switch_root or run-init in klibc) diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index a44222fa..5f1ae434 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -416,10 +416,13 @@ case "${DISTRO}" in cp ${ROOTDIR}/lib/libnss_compat.so.2 ${INSTDIR}/lib ;; Dapper*|dapper*) - DISTRO_VER=6.06 + DISTRO_VER=6.06 ;; - Edgy*|edgy*) - DISTRO_VER=6.10 + Edgy*|edgy*) + DISTRO_VER=6.10 + ;; + Feisty*|feisty*) + DISTRO_VER=7.04 ;; esac ;; @@ -429,12 +432,15 @@ case "${DISTRO}" in 2005*) DISTRO_VER=2005.1 ;; - 2006*|*) + 2006*) DISTRO_VER=2006.1 mkdir -p ${INSTDIR}/lib/udev cp -r ${ROOTDIR}/lib/udev/* ${INSTDIR}/lib/udev/ cp ${ROOTDIR}/etc/group ${INSTDIR}/etc/ ;; + 2007*|*) + DISTRO_VER=2007.1 + ;; esac ;; SuSE*|suse*|Suse*|SuSe*|SUSE*|*) @@ -452,6 +458,9 @@ case "${DISTRO}" in 10.2) DISTRO_VER=10.2 ;; + 10.3) + DISTRO_VER=10.3 + ;; esac ;; esac |