Changeset 236


Ignore:
Timestamp:
Dec 19, 2005, 7:31:56 PM (14 years ago)
Author:
bcornec
Message:

merge -r229:235 $SVN_M/branches/2.05

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/mindi/Makefile.parted2fdisk

    r30 r236  
    1818
    1919install: $(PRG)
    20     cp -a $(PRG) $(DEST)$(SUB)/$(PRG)-$(ARCH)
     20    cp -a $(PRG) $(DEST)/$(SUB)/$(PRG)-$(ARCH)
  • trunk/mindi/README.pxe

    r219 r236  
    99mondo
    1010        kernel vmlinuz-mondo
    11         initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] ...
     11        initrd initrd-mondo load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=36864 rw root=/dev/ram iso_mode acpi=off apm=off devfs=nomount exec-shield=0 pxe [prefix="machine"] [ipconf=(ipadr:netmask:broadcast:gateway|dhcp)] [ping=#] ...
    1212
    1313The initrd and kernel file come rom the first bootable media
     
    2525Without prefix keyword, the name of the images used during archiving with the -p option will be used (they may differ). If -p wasn't used then the name mondorescue-1.iso, ... will be used.
    2626
    27 During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media.
     27During boot mondorestore will start your NFS configuration and mount mondo's content from the network rather than from a physical media. You may alter the IP configuration stored from the original machine by passing the ipconf option describing respectively the IP address, netmask, broadcast and default gateway you want to setup for the machine, separated by ':'. Or alternatively, you may specify the dhcp keyword so that a DhCP request is made to get those information. On some configurations, you may also want to increase the number of ping queries made before the NFS mount, which is of 3 by default, using the ping option and give the number you want.
    2828
    2929Please report any problem around that tool to bcornec@users.berlios.de
    3030
     312005-12-18 new ipconf and ping option
    31322005-12-14 detailed explanations on where to find initrd and kernel
  • trunk/mindi/install.sh

    r219 r236  
    77
    88if [ "_$PREFIX" != "_" ]; then
    9     local=$PREFIX/usr
     9    local=$PREFIX
    1010    if [ -f /usr/local/sbin/mindi ]; then
    1111        echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove it !"
    1212    fi
    13     conf=$PREFIX/etc/mindi
     13    conf=$CONFDIR/mindi
    1414    echo $PATH | grep /usr/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add /usr/sbin to your PATH."
    1515else
     
    2020    conf=$local/etc/mindi
    2121    echo $PATH | grep $local/sbin > /dev/null || echo "Warning - your PATH environmental variable is BROKEN. Please add $local/sbin to your PATH."
    22 
    2322fi
    2423
     
    3130
    3231echo "Creating target directories ..."
    33 mkdir -p $local/lib/mindi
    34 mkdir -p $local/share/man/man8
    35 mkdir -p $local/sbin
    36 mkdir -p $conf
     32install -g root -o root -m 755 -d $conf $local/lib/mindi $local/share/man/man8 $local/sbin $local/doc/mindi
    3733
    3834echo "Copying files ..."
    39 cp deplist.txt $conf
    40 cp -af rootfs aux-tools isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg parted2fdisk.pl syslinux.cfg syslinux-H.cfg dev.tgz Mindi $local/lib/mindi
     35install -g root -o root -m 644 isolinux.cfg msg-txt sys-disk.raw.gz isolinux-H.cfg syslinux.cfg syslinux-H.cfg dev.tgz $local/lib/mindi
     36install -g root -o root -m 644 deplist.txt $conf
     37
     38cp -af rootfs aux-tools Mindi $local/lib/mindi
    4139chmod 755 $local/lib/mindi/rootfs/bin/*
    4240chmod 755 $local/lib/mindi/rootfs/sbin/*
    4341chmod 755 $local/lib/mindi/aux-tools/sbin/*
     42chown -R root:root $local/lib/mindi
    4443
    45 cp -af analyze-my-lvm parted2fdisk.pl $local/sbin
    4644if [ "$RPMBUILDMINDI" = "true" ]; then
    4745    sed -e "s~^MINDI_PREFIX=XXX~MINDI_PREFIX=/usr~" -e "s~^MINDI_CONF=YYY~MINDI_CONF=/etc/mindi~" mindi > $local/sbin/mindi
     
    5048fi
    5149chmod 755 $local/sbin/mindi
    52 chmod 755 $local/sbin/analyze-my-lvm
    53 chmod 755 $local/sbin/parted2fdisk.pl
     50chown root:root $local/sbin/mindi
     51install -g root -o root -m 755 analyze-my-lvm parted2fdisk.pl $local/sbin
    5452
    55 cp -a mindi.8 $local/share/man/man8
    56 cp -a CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/share/lib/mindi
    57 
    58 echo "Extracting symlinks ..."
    59 ( cd $local/lib/mindi/rootfs && tar -xzf symlinks.tgz )
     53install -g root -o root -m 644 mindi.8 $local/share/man/man8
     54install -g root -o root -m 644 CHANGES COPYING README README.busybox README.ia64 README.pxe TODO INSTALL $local/doc/mindi
    6055
    6156ARCH=`/bin/arch`
    6257echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386
     58# For the moment, we don't build specific x86_64 busybox binaries
     59echo $ARCH | grep -x "x86_64" &> /dev/null && ARCH=i386
    6360export ARCH
    6461
     62# Managing busybox
    6563if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH ]; then
    6664        echo "Installing busybox ..."
    67         mv $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
     65        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH $local/lib/mindi/rootfs/bin/busybox
    6866else
    6967        echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
    7068fi
    71 
    7269if [ "$ARCH" = "i386" ] ; then
    73     # FHS requires fdisk under /sbin
    74     (cd $local/sbin && ln -s /sbin/fdisk parted2fdisk)
    7570    if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
    7671        echo "Installing busybox.net ..."
    77         mv $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
     72        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/bin/busybox-$ARCH.net $local/lib/mindi/rootfs/bin/busybox.net
    7873    else
    7974        echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
    8075    fi
    8176fi
     77# Remove left busybox
     78rm -f $local/lib/mindi/rootfs/bin/busybox-*
    8279
     80# Managing parted2fdisk
    8381if [ "$ARCH" = "ia64" ] ; then
    84     (cd $local/sbin && ln -s parted2fdisk.pl parted2fdisk)
     82    (cd $local/sbin && ln -sf parted2fdisk.pl parted2fdisk)
    8583    make -f Makefile.parted2fdisk DEST=$local/lib/mindi install
    8684    if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then
    8785        echo "Installing parted2fdisk ..."
    88         mv $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
     86        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/lib/mindi/rootfs/sbin/parted2fdisk
     87        install -s -g root -o root -m 755 $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH $local/sbin/parted2fdisk
    8988    else
    9089        echo "WARNING: no parted2fdisk found, mindi will not work on this arch ($ARCH)"
    9190    fi
    9291else
     92    # FHS requires fdisk under /sbin
     93    (cd $local/sbin && ln -sf /sbin/fdisk parted2fdisk)
    9394    echo "Symlinking fdisk to parted2fdisk"
    9495    ( cd $local/lib/mindi/rootfs/sbin && ln -sf fdisk parted2fdisk)
    9596fi
     97# Remove left parted2fdisk
     98rm -f $local/lib/mindi/rootfs/sbin/parted2fdisk-*
    9699
    97100exit 0
  • trunk/mindi/mindi

    r226 r236  
    222222    mappath=$1
    223223    KBDEPTH=$(($KBDEPTH+1))
    224     [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 1170, approx.)"
     224    [ "$KBDEPTH" -gt "128" ] && Die "Edit $MINDI_SBIN/mindi and disable FindAndAddUserKeyboardMappingFile (line 2160, approx.)"
    225225    if [ -e "$bigdir/$mappath" ] ; then
    226226    echo "$mappath already added" >> $LOGFILE
     
    422422    while [ "$diskno" -le "$noof_disks" ] ; do
    423423    echo -en "#$diskno..."
    424     cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 250] Cannot copy $tardir/$diskno.tar.gz to $outdir"
     424    cp -f $tardir/$diskno.tar.gz $outdir || LogIt "[line 424] Cannot copy $tardir/$diskno.tar.gz to $outdir"
    425425        CreateOneDataDiskImage $tardir/$diskno.tar.gz $outdir/mindi-data-$diskno.img $diskno $noof_disks
    426426        diskno=$(($diskno+1))
     
    16721672    if [ "`DidMondoCallMe`" ] ; then
    16731673        if [ "$CDRECOVERY" != "yes" ] ; then
    1674                 if [ -e "$MONDO_TMP/start-nfs" ] ; then
    1675                     echo -en "Press <enter> to continue.\n"
    1676         elif [ ! "$MONDO_TMP" ] ; then
    1677             echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
    1678                 else
    1679                     echo -en "$BOOT_MEDIA_MESSAGE"
    1680                 fi
     1674            if [ -e "$MONDO_TMP/start-nfs" ] ; then
     1675                echo -en "Press <enter> to continue.\n"
     1676            elif [ ! "$MONDO_TMP" ] ; then
     1677                echo -en "FYI, this is _not_ a Mondo Rescue CD.\n"
     1678            else
     1679                echo -en "$BOOT_MEDIA_MESSAGE"
     1680            fi
    16811681        fi
    16821682    fi
     
    32583258if [ "$imagesdir" != "/root/images/mindi" ] ; then
    32593259    for i in `find $imagesdir -maxdepth 1 -name "*.iso" -o -name "*.img"` ; do
    3260     cp -f $i /root/images/mindi || LogIt "[line 1613] Cannot copy $i to /root/images/mindi"
     3260    cp -f $i /root/images/mindi || LogIt "[line 3260] Cannot copy $i to /root/images/mindi"
    32613261    done
    32623262fi
  • trunk/mindi/mindi.spec

    r219 r236  
    2828Group:          Archiving/Backup
    2929Autoreqprov: no
     30%endif
     31
     32%if %is_suse
     33%define src     %{name}-%{version}.tgz
     34Group:          Archiving/Backup
    3035%endif
    3136
     
    6368
    6469%{__rm} -rf $RPM_BUILD_ROOT
    65 MINDIDIR=$RPM_BUILD_ROOT%{_libdir}/mindi
    66 export PREFIX=${RPM_BUILD_ROOT}
     70export PREFIX=${RPM_BUILD_ROOT}%{_exec_prefix}
     71export CONFDIR=${RPM_BUILD_ROOT}%{_sysconfdir}
    6772export RPMBUILDMINDI="true"
    6873
    6974./install.sh
    70 
    71 %{__rm} -f $MINDIDIR/rootfs/bin/busybox-ia64 $MINDIDIR/rootfs/sbin/parted2fdisk-ia64 $MINDIDIR/rootfs/bin/busybox-i386 $MINDIDIR/rootfs/bin/busybox-i386.net
    7275
    7376%clean
     
    8689%{_mandir}
    8790%{_libdir}/mindi
    88 #%attr(755,root,root) %{_libdir}/mindi/aux-tools/sbin/*
    89 #%attr(755,root,root) %{_libdir}/mindi/rootfs/bin/*
    90 #%attr(755,root,root) %{_libdir}/mindi/rootfs/sbin/*
    9191%attr(755,root,root) %{_sbindir}/*
    9292
  • trunk/mindi/rootfs/sbin/init

    r230 r236  
    649649        # Simulate a local CD
    650650        echo "/mnt/cdrom" > /tmp/CDROM-LIVES-HERE
     651        CD_MOUNTED_OK=yes
    651652    else
    652653            HandleCDROMorFloppies
     
    654655fi
    655656res=$?
    656 echo "Please wait."
    657 insert-all-my-modules > /dev/null &
    658 sleep 7
     657echo "Inserting modules ..."
     658insert-all-my-modules > $LOGFILE 2> $LOGFILE
     659echo "Installing additional tools ..."
    659660install-additional-tools
    660661SwapTheMountExecs
    661662ConfigureLoggingDaemons
    662 echo "Please wait."
    663 insert-all-my-modules &
    664 sleep 7
     663echo "Inserting modules again ..."
     664insert-all-my-modules > $LOGFILE 2> $LOGFILE
    665665if [ -e "/tmp/USE-DEVFS" ] ; then
    666666    umount /mnt/cdrom 2> /dev/null
     
    669669    RunDevfsd
    670670fi
     671echo "Starting potential Raid/LVMs ..."
    671672PauseForRaids
    672673StartRaids
  • trunk/mindi/rootfs/sbin/post-init

    r30 r236  
    11#!/bin/sh
    22#
     3# $Id$
    34#
    4 # 07/14/04
    5 # - if interactive then not expert :)
    6 #
    7 # 06/12/04
    8 # - tell user to call mondorestore --mbr after nuking
    9 #
    10 # 08/02/03
    11 # - don't call multifunc cd, even if it is one
    12 #
    13 # 05/30/03
    14 # - added hooks for multi-function CD
    15 #
    16 # 05/04/03
    17 # - better handling of mondorestore softlinks
    18 # - no more 'mondo-restore' --- it's 'mondorestore'
    19 #
    20 # 03/26/03
    21 # - report if mount-me, unmount-me, mondorestore missing
    22 # - call mondorestore instead of mondo-restore
    23 #
    24 # 07/15/02
    25 # - copy mountlist.txt to logfile at start
    26 #
    27 # 07/11/02
    28 # - exit w/o calling mondorestore, if non-mondo CD/floppy
    29 #
    30 # 06/28/02
    31 # - RESTORE == nuke_mode
    32 #
    33 # 06/24/02
    34 # - disabled isonuke
    35 #
    36 # 06/13/02
    37 # - added isonuke
    38 #
    39 # 02/03/02
    40 # - softlink mondo-restore -> mondorestore if mondorestore exists but m-r not
    41 #
    42 # 12/10/01
    43 # - removed the 'clear' from the start of the script
    44 #
    45 # 12/09/01
    46 # - broke up spaghetti code; made lots of subroutines
    47 # - moved some subroutines to /sbin/init, where they belong
    485#------------------------------------------------------------
    496
     
    10562nuke=`cat /proc/cmdline | grep "nuke"`
    10663if [ "$nuke" = "" ] ; then
    107     nuke=`cat /proc/cmdline | grep "RESTORE "`
     64    nuke=`cat /proc/cmdline | grep -i "RESTORE "`
    10865fi
    10966expert=`cat /proc/cmdline | grep "expert"`
     
    148105done
    149106
    150 #if [ "$iso" ] && [ "$nuke" ] ; then
    151 #    LogIt "------------------ISONUKE MODE-----------------" 1
    152 #    mondorestore --isonuke
    153 #el
    154 #if [ "$iso" ] ; then
    155 #    LogIt "--------------------ISO MODE-------------------" 1
    156 #    mondorestore --iso
    157 #el
    158107if [ "$compare" ] ; then
    159108    LogIt "------------------COMPARE MODE-----------------" 1
  • trunk/mondo/mondo.spec

    r219 r236  
    3030%endif
    3131
     32%if %is_suse
     33%define src     %{name}-%{version}.tgz
     34Group:          Archiving/Backup
     35%endif
    3236
    3337Summary:    A program which a Linux user can utilize to create a rescue/restore CD/tape
  • trunk/mondo/mondo/common/libmondo-devices.c

    r197 r236  
    17141714            paranoid_free(command);
    17151715
    1716             asprintf(&tmp, "mount %s -t nfs %s", bkpinfo->nfs_mount,
     1716            asprintf(&tmp, "mount -t nfs -o nolock %s %s", bkpinfo->nfs_mount,
    17171717                    bkpinfo->isodir);
    17181718            run_program_and_log_output(tmp, 5);
  • trunk/mondo/mondo/common/libmondo-files.c

    r226 r236  
    11081108        fatal_error("Cannot store NFS config");
    11091109    }
     1110    fprintf(fout, "#!/bin/sh\n");
     1111    fprintf(fout, "# number of ping\n");
     1112    fprintf(fout, "ipcount=3\n");
     1113    fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");
     1114    fprintf(fout, "    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`\n");
     1115    fprintf(fout, "done\n");
    11101116    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
    1111     fprintf(fout, "ifconfig %s %s netmask %s broadcast %s   # config client\n", nfs_dev,
    1112             nfs_client_ipaddr, nfs_client_netmask, nfs_client_broadcast);
    1113     fprintf(fout, "route add default gw %s  # default route\n", nfs_client_defgw);
    1114     fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr);
     1117    fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr);
     1118    fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask);
     1119    fprintf(fout, "ipbroadcast=%s\n", nfs_client_broadcast);
     1120    fprintf(fout, "ipgateway=%s\n", nfs_client_defgw);
     1121    fprintf(fout, "ipconf=\n");
     1122    fprintf(fout, "for i in `cat /proc/cmdline` ; do\n");
     1123    fprintf(fout, "    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n");
     1124    fprintf(fout, "done\n");
     1125    fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n");
     1126    fprintf(fout, "    udhcpc -i %s\n", nfs_dev);
     1127    fprintf(fout, "else\n");
     1128    fprintf(fout, "    if [ \"$ipconf\" != \"\" ]; then\n");
     1129    fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f1`\n");
     1130    fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f2`\n");
     1131    fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f3`\n");
     1132    fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f4`\n");
     1133    fprintf(fout, "    fi\n");
     1134    fprintf(fout, "    ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev);
     1135    fprintf(fout, "    route add default gw $ipgateway\n");
     1136    fprintf(fout, "fi\n");
     1137    fprintf(fout, "ping -c $ipcount %s  # ping server\n", nfs_server_ipaddr);
    11151138    fprintf(fout, "mount -t nfs -o nolock %s /tmp/isodir\n",
    11161139            bkpinfo->nfs_mount);
    1117     fprintf(fout, "exit 0\n");
    11181140    paranoid_fclose(fout);
    11191141    chmod(outfile, 0777);
  • trunk/tools/rpm-env

    r98 r236  
    5252    fi
    5353elif [ -e /etc/SuSE-release ]; then
    54     export ddir="suse"
    55     export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'`
     54    grep -q Enterprise /etc/SuSE-release
     55    if [ $? -eq 0 ]; then
     56        export ddir="sles"
     57        export dver=`cat /etc/SuSE-release | head -1 | awk '{print $5}'`
     58    else
     59        export ddir="suse"
     60        export dver=`cat /etc/SuSE-release | head -1 | awk '{print $3}'`
     61    fi
    5662else
    5763    export dver=""
Note: See TracChangeset for help on using the changeset viewer.