diff options
author | Nico Dietrich | 2006-04-04 21:04:01 +0200 |
---|---|---|
committer | Nico Dietrich | 2006-04-04 21:04:01 +0200 |
commit | 2291d42be23c84a59f1d8ccdc22d2deb4692f0b8 (patch) | |
tree | 35705c467a12cc783a3171c2e6ecdf6c659ea321 | |
parent | fix gdm, kdm in debian, ubuntu (diff) | |
download | core-2291d42be23c84a59f1d8ccdc22d2deb4692f0b8.tar.gz core-2291d42be23c84a59f1d8ccdc22d2deb4692f0b8.tar.xz core-2291d42be23c84a59f1d8ccdc22d2deb4692f0b8.zip |
introduce vendor_pre&postinit; inst: only create new config_files when different; portmap in ubuntu
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@153 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r-- | initrd/distro-specs/ubuntu/functions-5.10 | 6 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 3 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 9 | ||||
-rwxr-xr-x | installer/ld4-inst | 46 |
4 files changed, 43 insertions, 21 deletions
diff --git a/initrd/distro-specs/ubuntu/functions-5.10 b/initrd/distro-specs/ubuntu/functions-5.10 index 4aa74e8f..75ade847 100644 --- a/initrd/distro-specs/ubuntu/functions-5.10 +++ b/initrd/distro-specs/ubuntu/functions-5.10 @@ -269,3 +269,9 @@ variable \${automnt_dir} appropriately in\n machine-setup file." nonfatal rllinker "autofs" "18" "04" fi } + +# start portmapper (needed at least for nfs and nis services) +config_portmap () { + rllinker "portmap" "02" "20" +} + diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 02133c30..bea32b4d 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -44,6 +44,8 @@ exec < /dev/console > /dev/console 2>&1 # run pre init script preinit +[ -x /bin/vendor_preinit ] && /bin/vendor_preinit + # start device auto discovery service - distro specific function udev_hotplug # set defaults and create waitfor files @@ -412,6 +414,7 @@ killall -9 dhcpcd dhclient pump 2>/dev/null # post init for some distro specific postinit +[ -x /bin/vendor_postinit ] && /bin/vendor_postinit # start a debug shell in higher debug levels [ $DEBUGLEVEL -gt 2 ] && /bin/sh diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 63903a51..0f56dc8c 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -479,7 +479,7 @@ done chmod 755 ${INSTDIR}/init \ ${INSTDIR}/bin/{servconfig,hwautocfg,screenres,dhcpmkconfig} -# finally add the common client configuration file +# add the common client configuration file if [ -f /etc/dxs/client.cfg/machine-setup.default ] ; then cp /etc/dxs/client.cfg/machine-setup.default \ ${INSTDIR}/etc/machine-setup @@ -492,6 +492,13 @@ else disabled\nroot_pw='"'$1$T7VD/mmQ$aCP1WEaWplEsHe9khv4kK.'"'" > ${INSTDIR}/etc/machine-setup fi +# finally copy vendor-supplied preinit and postinit files +for i in vendor_preinit vendor_postinit ; do + if [ -f /etc/dxs/init.local/"${i}" ] ; then + cp /etc/dxs/init.local/"$i" ${INSTDIR}/bin/"$i" + fi +done + ######################################################################### # End of file copy procedures diff --git a/installer/ld4-inst b/installer/ld4-inst index 039246b1..01736782 100755 --- a/installer/ld4-inst +++ b/installer/ld4-inst @@ -312,7 +312,7 @@ setup_server () { timestamp=`date +%Y%m%d-%H%M` # creating central dxs configuration directory structure if it doesn't exist - for dir in dhcp nfs atftpd pxelinux client.cfg ; do + for dir in dhcp nfs atftpd pxelinux client.cfg init.local ; do [ -d ${dxs_conf}/${dir} ] || mkdir -p ${dxs_conf}/${dir} done @@ -360,35 +360,41 @@ setup_server () { j=$j+1 done - # backing up original files, if files should not be overwritten keep them + # if files should not be overwritten keep them # in place and create files with ".new" extension if [ "$overwrite_configs" = "no" ] ; then extension=".new" keep="yes" fi - for cfile in \ - ${dhcpd_conf} ${atftpd_conf} ${exports_conf} \ - ${tftpbootdir}/${pxedefault_conf} ${client_conf} ; do - if [ -f ${cfile} -a ! -L ${cfile} ] ; then - if [ -z "$keep" ] ; then - echo "Copying old ${cfile} to ${cfile}.original" - mv ${cfile} ${cfile}.original - else - echo "Keeping old ${cfile} and generate ${cfile}.new instead" - fi - elif [ -L ${cfile} ] ; then - [ -z "$keep" ] && unlink ${cfile} - fi - done - - # linking files for cfile in "${dxs_dhcpd_conf} ${dhcpd_conf}" \ "${dxs_atftpd_conf} ${atftpd_conf}" \ "${dxs_pxedefault_conf} ${tftpbootdir}/${pxedefault_conf}" \ - "${dxs_exports_conf} ${exports_conf}" ; do + "${dxs_exports_conf} ${exports_conf}" \ + "${dxs_client_conf} ${client_conf}" ; do set -- $cfile - ln -s ${dxs_conf}/${1}-${timestamp} ${2}${extension} + + # check if file changed + lastfile=`ls -lt ${dxs_conf}/${1}* | awk '{print $8}'| sed -n "2,2p"` + diff ${dxs_conf}/${1}-${timestamp} ${lastfile} >/dev/null + if [ $? -eq 0 ] ; then + echo "Configuration file ${2} didn't change - leaving unchanged" + rm ${dxs_conf}/${1}-${timestamp} + else + # backing up orginial files / create files with .new extension + if [ -f ${2} -a ! -L ${2} ] ; then + if [ -z "$keep" ] ; then + echo "Copying old ${2} to ${2}.original" + mv ${2} ${2}.original + else + echo "Keeping old ${2} and generate ${2}.new instead" + fi + elif [ -L ${2} ] ; then + [ -z "$keep" ] && unlink ${2} + fi + # linking files + ln -sf ${dxs_conf}/${1}-${timestamp} ${2}${extension} + fi done } |