From 32e8ef9f9794a1a9747673523b7c9e74bba1295c Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sat, 14 Jul 2007 13:46:44 +0000 Subject: Removed late_dm option (too confusing and too little effect), small fix for Ubuntu functions-default, added "binfinder" function. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1242 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/distro-specs/debian/functions-default | 27 +++++++++++-------------- initramfs/distro-specs/gentoo/functions-default | 7 +------ initramfs/distro-specs/suse/functions-default | 17 ++++------------ initramfs/distro-specs/ubuntu/functions-default | 4 ++-- initramfs/initrd-stuff/etc/functions | 18 +++++++++++++++++ installer/default_files/machine-setup.default | 8 ++------ 6 files changed, 39 insertions(+), 42 deletions(-) diff --git a/initramfs/distro-specs/debian/functions-default b/initramfs/distro-specs/debian/functions-default index e5454861..4af35da2 100644 --- a/initramfs/distro-specs/debian/functions-default +++ b/initramfs/distro-specs/debian/functions-default @@ -193,28 +193,25 @@ sed -e "s,LANG=.*,LANG=\"${LANG}\" # set within initramfs," \ # configure gdm as display manager config_gdm () { ln -sf ../${D_INITDIR}/gdm /mnt/etc/rc3.d/K20gdm -if [ "x$late_dm" = "xyes" ] ; then - ln -sf ../${D_INITDIR}/gdm /mnt/etc/rc3.d/S01gdm -else - echo -e "\t/etc/${D_INITDIR}/gdm start >${LOGFILE} 2>&1\n\ - \t( sleep 120; ln -sf /etc/${D_INITDIR}/gdm /etc/rc3.d/S01gdm \ - >${LOGFILE} 2>&1) &\n" >>/mnt/etc/${D_INITDIR}/boot.slx +ln -sf ../${D_INITDIR}/gdm /mnt/etc/rc3.d/S01gdm +# check for gdm user in passwd file and add it if not present +if ! grep "gdm:" /etc/passwd >/dev/null 2>&1; then + echo "gdm:x:113:">>/mnt/etc/group + echo "gdm:x:106:113:Gnome Display Manager:/var/lib/gdm:/bin/false" \ + >>/mnt/etc/passwd fi - # check for gdm user in passwd and group files - # fixme!! -# echo "gdm:x:113:">>/mnt/etc/group -# echo "gdm:x:106:113:Gnome Display Manager:/var/lib/gdm:/bin/false" \ -# >>/mnt/etc/passwd +# fixme: any directory with certain permissions needed? +# testmkd /mnt/var/lib/gdm/.fontconfig +# echo -e "\tchown gdm:gdm /var/lib/gdm/.fontconfig\n\t\chown root:gdm \ +#/var/lib/gdm" >> /mnt/etc/${D_INITDIR}/boot.slx } # configure kdm as display manager config_kdm () { # first define directories for kdm -kdmrcdir=/etc/kde3/kdm -xdmdir=/etc/kde3/kdm - +local kdmrcdir=/etc/kde3/kdm +local xdmdir=/etc/kde3/kdm testmkd /mnt/${kdmrcdir} - ln -sf ../${D_INITDIR}/kdm /mnt/etc/rc3.d/K20kdm ln -sf ../${D_INITDIR}/kdm /mnt/etc/rc3.d/S20kdm diff --git a/initramfs/distro-specs/gentoo/functions-default b/initramfs/distro-specs/gentoo/functions-default index 6e1d45e1..edbcf0c1 100644 --- a/initramfs/distro-specs/gentoo/functions-default +++ b/initramfs/distro-specs/gentoo/functions-default @@ -239,12 +239,7 @@ config_dm_entry () { local displmng=$1 if [ -f /mnt/etc/${D_INITDIR}/xdm ] ; then config_rc_entry "DISPLAYMANAGER" "${displmng}" - if [ "x$late_dm" = "xyes" ] ; then - rllinker xdm - else - D_INITSCRIPTS="${D_INITSCRIPTS} ${displmng}" - rllinker xdm "${lastinit}" - fi + rllinker xdm else error "" nonfatal fi diff --git a/initramfs/distro-specs/suse/functions-default b/initramfs/distro-specs/suse/functions-default index 41dfa5a4..6ae7b376 100644 --- a/initramfs/distro-specs/suse/functions-default +++ b/initramfs/distro-specs/suse/functions-default @@ -229,19 +229,10 @@ local dm="$1" sed -e "s,DISPLAYMANAGER=.*,DISPLAYMANAGER=\"$start_xdmcp\"," \ -e "s,.*_XSERVER.*,DISPLAYMANAGER_STARTS_XSERVER=\"$dm\"," \ -i /mnt/etc/${D_SYSCONFDIR}/displaymanager -# start the display manager as early as possible, but avoid that it is -# started twice during bootup ... late_dm can postpone the start of -# displaymanager and X if problems with keyboard, console occur ... -# might be connected to running startup scripts in parallel, see above ... -if [ "x$late_dm" = "xno" ] ; then - ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITBOOTD}/S12boot.xdm - echo -e "\t(sleep 60; ln -sf ../xdm /etc/${D_INITDIR}/rc5.d/S01xdm; \ - rm /etc/${D_INITBOOTD}/S12boot.xdm) &\n" >>/mnt/etc/${D_INITDIR}/boot.slx -else - ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITDIR}/rc5.d/S01xdm - ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITDIR}/rc5.d/K18xdm - sed -e "s,xdm: .*,xdm:," -i /mnt/etc/${D_INITDIR}/.depend.start -fi +# start the display manager as early as possible in runlevel 5 +ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITDIR}/rc5.d/S01xdm +ln -sf /etc/${D_INITDIR}/xdm /mnt/etc/${D_INITDIR}/rc5.d/K18xdm +sed -e "s,xdm: .*,xdm:," -i /mnt/etc/${D_INITDIR}/.depend.start } # configure X display manager (runlevel links and kind of manager) config_xdm () { diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index 5f4a1edf..f02d8778 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -207,8 +207,8 @@ if ! grep "gdm:" /etc/passwd >/dev/null 2>&1; then >>/mnt/etc/passwd fi testmkd /mnt/var/lib/gdm/.fontconfig -echo -e "\tchown gdm:gdm /var/lib/gdm/.fontconfig\n\t\chown root:gdm \ -/var/lib/gdm" >> /mnt/etc/${D_INITDIR}/boot.slx +echo -e "\tchown gdm:gdm /var/lib/gdm/.fontconfig\n\tchown root:gdm \ +/var/lib/gdm\n" >>/mnt/etc/${D_INITDIR}/boot.slx # fixme: check if a gdm.conf was provided via ConfTGZ # [ -f /rootfs/etc/gdm/gdm.conf ??? ] || \ echo -e "# /etc/gdm/gdm.conf - file generated by $0\n\ diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 543b1887..1690b03b 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -195,6 +195,24 @@ else fi } ############################################################################# +# replacement for which command to find executables inside stage4 rootfs +binfinder() +{ +local program="$1" +local s4path +local notfound=1 +for s4path in bin sbin usr/bin usr/sbin usr/local/bin \ + usr/local/sbin usr/bin/X11; do + if [ -f "/mnt/$s4path/$program" ] && \ + [ -x "/mnt/$s4path/$program" ]; then + printf '%s\n' "/$s4path/$program" + notfound=0 + break + fi +done +return $notfound +} +############################################################################# # disk formatter and mounter. some proper error message output should be # added diskfm () { diff --git a/installer/default_files/machine-setup.default b/installer/default_files/machine-setup.default index 5f8f0225..ea8f00ee 100644 --- a/installer/default_files/machine-setup.default +++ b/installer/default_files/machine-setup.default @@ -1,4 +1,5 @@ -# machine-setup +# machine-setup - this file is obsolete! Present for reference on +# variable configuration only ... # #### default file, please modify, rename it to machine-setup and copy it #### to a proper location, like /var/opt/openslx/config/default/initramfs @@ -111,11 +112,6 @@ start_xdmcp="kdm" # for kdm/gdm - enable shutdown option on login screen "user/root/none" dm_allow_shutdown="user" -# try to start g/k/xdm with X as fast as possible late_dm="no" -# if there are problems with key, console etc. set late_dm="yes" - adds -# few seconds to graphical login delay (default setting) -#late_dm="no" - # should Xorg/XFree server be started or some special windowmanager be run # in kiosk mode e.g. start_x="kde" start_x="yes" -- cgit v1.2.3-55-g7522