From f4bc5fc188ee5dd09e15512dc5508df145ef25bd Mon Sep 17 00:00:00 2001 From: Nico Dietrich Date: Tue, 7 Mar 2006 15:05:04 +0000 Subject: further installer progress git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@91 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/default_files/dhcpd.conf | 2 +- .../default_files/tftpboot/pxelinux.cfg/default | 8 ++++- installer/distro-specs/config-ubuntu | 3 ++ installer/distro-specs/exclude-suse-10.1 | 2 ++ installer/distro-specs/exclude-ubuntu | 6 ++++ installer/ld4-inst | 37 ++++++++++++++++++---- 6 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 installer/distro-specs/config-ubuntu (limited to 'installer') diff --git a/installer/default_files/dhcpd.conf b/installer/default_files/dhcpd.conf index 210a9c8d..284d701c 100644 --- a/installer/default_files/dhcpd.conf +++ b/installer/default_files/dhcpd.conf @@ -109,7 +109,7 @@ ddns-update-style none; ##### ##### ################################################################### -subnet @@@netname@@@ @@@netmask@@@ { +subnet @@@netname@@@ netmask @@@netmask@@@ { option broadcast-address @@@broadcast@@@; option routers @@@server@@@; } diff --git a/installer/default_files/tftpboot/pxelinux.cfg/default b/installer/default_files/tftpboot/pxelinux.cfg/default index b1ac0d33..597c98c0 100644 --- a/installer/default_files/tftpboot/pxelinux.cfg/default +++ b/installer/default_files/tftpboot/pxelinux.cfg/default @@ -28,6 +28,13 @@ LABEL APPEND @@@server@@@::@@@tftpbootdir@@@/pxelinux.cfg/default ##### +LABEL dxsdefault + MENU DEFAULT + MENU LABEL 1. @@@client_distro@@@-@@@client_distro_ver@@@ Diskless + KERNEL @@@server@@@::@@@tftpbootdir@@@/vmlinuz + APPEND nfsroot=@@@server@@@:@@@rootdir@@@ vga=0x317 splash=silent initrd=@@@server@@@::@@@tftpbootdir@@@/initrd apic dhcp noldsc vci=DXS + ipappend 1 + LABEL kr1 MENU LABEL 1. 10.0 NFS @@ -66,7 +73,6 @@ LABEL kr5a ipappend 1 LABEL kr6 - MENU DEFAULT MENU LABEL 1. 10.1 DNBD-EXT2 KERNEL @@@server@@@::@@@tftpbootdir@@@/suse101nfs APPEND dnbdroot=224.0.0.6:5001,ext2 vga=0x317 splash=silent initrd=@@@server@@@::@@@tftpbootdir@@@/initrd-101nfs apic dhcp noldsc vci=DXS debug=0 elevator=noop diff --git a/installer/distro-specs/config-ubuntu b/installer/distro-specs/config-ubuntu new file mode 100644 index 00000000..a616b13d --- /dev/null +++ b/installer/distro-specs/config-ubuntu @@ -0,0 +1,3 @@ +dhcpd_conf="/etc/dhcp3/dhcpd.conf" +atftpd_conf="/etc/default/atftpd" +exports_conf="/etc/exports" diff --git a/installer/distro-specs/exclude-suse-10.1 b/installer/distro-specs/exclude-suse-10.1 index c293d897..385243fd 100644 --- a/installer/distro-specs/exclude-suse-10.1 +++ b/installer/distro-specs/exclude-suse-10.1 @@ -1,5 +1,6 @@ + /bin + /boot ++ /dev + /etc + /home + /lib @@ -22,6 +23,7 @@ - /lib/klibc/events/* - /boot/initrd* - /boot/grub +- /dev/* - /tmp/* - /root/* - /home/* diff --git a/installer/distro-specs/exclude-ubuntu b/installer/distro-specs/exclude-ubuntu index 36d0b1d9..ffbd904b 100644 --- a/installer/distro-specs/exclude-ubuntu +++ b/installer/distro-specs/exclude-ubuntu @@ -1,5 +1,6 @@ + /bin + /boot ++ /dev + /etc + /home + /lib @@ -7,8 +8,10 @@ + /media + /mnt + /opt ++ /proc + /root + /sbin ++ /sys + /tmp + /usr + /var @@ -19,6 +22,9 @@ - /lib/klibc/events/* - /boot/initrd* - /boot/grub +- /dev/* +- /proc/* +- /sys/* - /tmp/* - /root/* - /home/* diff --git a/installer/ld4-inst b/installer/ld4-inst index 39eab665..3ba6dbb4 100755 --- a/installer/ld4-inst +++ b/installer/ld4-inst @@ -112,6 +112,8 @@ configure() { fi . .config + # TODO: assure that values get entered only once in .config + # TODO: bash doesnt allow concatenation of more than 2 logical expressions if ! [ -z $netmask -a -z $broadcast -a -z $netname -a -z $server ] ; then ipcfg=( `ifconfig eth0 | grep "inet addr" | sed -e "s,[a-zA-Z]*:,,g"` ) @@ -137,7 +139,7 @@ configure() { # if still no distro name set, try to find it using significant files if [ -z "${server_distro}" ] ; then - if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then + if [ -e ${rootdir}/etc/SuSE-release ] ; then server_distro=suse server_distro_ver=`grep "VERSION" /etc/SuSE-release | sed "s/.*= //"` elif [ -e /etc/lsb-release ] ; then @@ -160,7 +162,11 @@ configure() { distro_check client_distro client_distro_ver echo "Using ${client_distro} as client distribution" - . config-${server_distro} + if [ -z ${rootdir} ] ; then + ${rootdir}="/nfsroot/"${client_distro}-${client_distro_ver} + fi + + . distro-specs/config-${server_distro} ask "Path for client system: " rootdir $rootdir ask "Path for tftpboot: " tftpbootdir $tftpbootdir @@ -173,6 +179,7 @@ configure() { # evtl. optional? ask "Where automount home directories from? (A.B.C.D:/home-dir)" amt $server":/home" + # more information here!! set useful default ask "Which debug level should be used? " debuglevel $debuglevel # wo ist das referenzsystem? - was ist default ??? @@ -181,33 +188,41 @@ configure() { # hier auch dns-server etc abfragen?? # nfs / nbd / squash-fs? + + + # password for pxeboot-menu (caution: you can easily retrieve it in clear text!!) + pxe_passwd="master" } copy_system() { + echo -e "\n\nSyncing system now\nPlease enter root password of client machine\n" rsync -avDe ssh --delete --exclude-from=distro-specs/exclude-${client_distro} ${rsyncsource} ${rootdir} # generate error message in case rsync didn't work and exit. - + # mksquashfs (background process) } # setting up server site configuration files etc. setup_server () { + echo -e "\n\nSetting up server configuration\n" # dhcp if [ -f ${dhcpd_conf} ] ; then echo "Copying old dhcpd.conf to dhcpd.conf.dxs.bak" mv ${dhcpd_conf} ${dhcpd_conf}.dxs.bak fi cp default_files/dhcpd.conf ${dhcpd_conf} - sed -e "s,@@@server@@@,${server}," -i ${dhcpd_conf} + sed -e "s,@@@server@@@,${server},g" -e "s,@@@netname@@@,${netname},g" -e "s,@@@netmask@@@,${netmask},g" -e "s,@@@broadcast@@@,${broadcast},g" -i ${dhcpd_conf} + + # TODO: sed -e @@@example1@@@, netname+1 etc. # atftpd if [ -f ${atftpd_conf} ] ; then echo "Copying old atftpd config file to ${atftpd_conf}.dxs.bak" cp ${atftpd_conf} ${atftpd_conf}.dxs.bak fi - ## MISSING COPY - DISTRO SPECIFIC!! + ## TODO: MISSING COPY - DISTRO SPECIFIC!! sed -e "s,/tftpboot,${tftpbootdir}," -i ${atftpd_conf} # nfs @@ -216,15 +231,16 @@ setup_server () { echo "Copying old nfs export file to ${exports_conf}.dxs.bak" mv ${exports_conf} ${exports_conf}.dxs.bak fi - echo "/nfsroot/dxs ${netname}/${netmask}(ro,no_root_squash,async)" >> ${exports_conf} + echo "${rootdir} ${netname}/${netmask}(ro,no_root_squash,async)" >> ${exports_conf} # pxe if [ -e ${tftpbootdir} ] ; then echo "Copying old tftpboot directory to ${tftpbootdir}.dxs.bak" + rm -rf ${tftpbootdir}.dxs.bak >/dev/null mv ${tftpbootdir} ${tftpbootdir}.dxs.bak fi cp -r default_files/tftpboot ${tftpbootdir} - sed -e "s,@@@server@@@,${server},g" -e "s,@@@tftpbootdir@@@,${tftpbootdir},g" -i ${tftpbootdir}/pxelinux.cfg/default + sed -e "s,@@@server@@@,${server},g" -e "s,@@@tftpbootdir@@@,${tftpbootdir},g" -e "s,@@@pxe_passwd@@@,${pxe_passwd},g" -e "s,@@@client_distro@@@,${client_distro},g" -e "s,@@@client_distro_ver@@@,${client_distro_ver},g" -e "s,@@@rootdir@@@,${rootdir},g" -i ${tftpbootdir}/pxelinux.cfg/default # make services start -- do we really want to do this? @@ -232,6 +248,7 @@ setup_server () { create_initrd() { + # FIXME: mkdxsinitrd currently wants to run from own directory ../initrd/mkdxsinitrd -r ${rootdir} # generate links to kernel and initial ramdisk @@ -242,6 +259,11 @@ create_initrd() { } +footer() { + echo -e "\nPlease assure to restart atftpd, nfs-kernel-server and dhcpd!\n" + echo -e "\nInstallation finished.\n" +} + ## ------ MAIN ------ ## @@ -252,3 +274,4 @@ copy_system setup_server create_initrd +footer -- cgit v1.2.3-55-g7522