Changeset 839 in MondoRescue


Ignore:
Timestamp:
Sep 26, 2006, 9:47:32 AM (18 years ago)
Author:
Bruno Cornec
Message:

merge -r814:838 $SVN_M/branches/stable

Location:
trunk
Files:
6 deleted
22 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/mindi-kernel/VERSION

    r561 r839  
    1 trunk
     12.6
  • trunk/mindi/ChangeLog

    r764 r839  
    22
    33MINDI CHANGES
     4
     51.2.0 (2006-09-25)
     6- busybox is now a separate package and binaries are not provided anymore in mindi (Bruno Cornec)
    47
    581.0.9 (2006-08-05)
  • trunk/mindi/README.busybox

    r137 r839  
    11Mindi uses the busybox (http://busybox.net) project to create the boot environement used during restore.
    22
    3 If you want to modify the busybox support, you have to:
    4 
    5 1/ Get busybox sources and extract them
    6 2/ Copy as a base the .config file from the mindi directory under the name .config in this source directory.
    7    3 files are proposed:
    8    .config-busybox-i386.net : Configure busybox for Network support (NFS, PXE)
    9    .config-busybox-i386     : Configure busybox for Normal support (CDs, DVD, Tapes)
    10    .config-busybox-ia64     : Configure busybox for Normal and Network support on ia64/Itanium
    11 3/ Reconfigure busybox (make menuconfig)
    12 4/ Rebuild the new busybox (make busybox)
    13 5/ copy the new busybox binary from that directory to rootfs/bin under the mindi source tree
    14    3 files are proposed:
    15    busybox-i386.net : busybox with Network support (NFS, PXE)
    16    busybox-i386     : busybox with Normal support (CDs, DVD, Tapes)
    17    busybox-ia64     : busybox with Normal and Network support on ia64/Itanium
    18 6/ Relaunch mindi or mondoarchive if you use it.
     3The best manner to use it is to also install our mindi-busybox package/tar file with your mindi installation.
     4If you rather want to install your distribution busybox, you'll have to check it supports all the required function our is providing, that it's place under /usr/lib/mindi/rootfs/bin/busybox and that ll required links are created.
  • trunk/mindi/distributions/rpm/mindi.spec

    r729 r839  
    1111Source:     SSS
    1212BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    13 Requires:   bzip2 >= 0.9, mkisofs, ncurses, binutils, gawk, dosfstools DDD
     13ExcludeArch: ppc
     14Requires:   bzip2 >= 0.9, mkisofs, ncurses, binutils, gawk, dosfstools, busybox DDD
    1415OBS
    1516# Not on all systems
  • trunk/mindi/install.sh

    r649 r839  
    3636ARCH=`/bin/arch`
    3737echo $ARCH | grep -x "i[0-9]86" &> /dev/null && ARCH=i386 && locallib=$local/lib
    38 # For the moment, we don't build specific x86_64 busybox binaries
    39 echo $ARCH | grep -x "x86_64" &> /dev/null && ARCH=i386 && locallib=$local/lib64
     38echo $ARCH | grep -x "x86_64" &> /dev/null && locallib=$local/lib64
    4039echo $ARCH | grep -x "ia64" &> /dev/null && locallib=$local/lib
    4140export ARCH
     
    6867install -m 644 ChangeLog COPYING README README.busybox README.ia64 README.pxe TODO INSTALL svn.log $DOCDIR
    6968
    70 # Managing busybox
    71 if [ -f $locallib/mindi/rootfs/bin/busybox-$ARCH ]; then
    72         echo "Installing busybox ..."
    73         install -s -m 755 $locallib/mindi/rootfs/bin/busybox-$ARCH $locallib/mindi/rootfs/bin/busybox
    74 else
     69if [ ! -f $locallib/mindi/rootfs/bin/busybox ]; then
    7570        echo "WARNING: no busybox found, mindi will not work on this arch ($ARCH)"
    7671fi
    77 if [ "$ARCH" = "i386" ] ; then
    78     if [ -f $locallib/mindi/rootfs/bin/busybox-$ARCH.net ]; then
    79         echo "Installing busybox.net ..."
    80         install -s -m 755 $locallib/mindi/rootfs/bin/busybox-$ARCH.net $locallib/mindi/rootfs/bin/busybox.net
    81     else
    82         echo "WARNING: no busybox.net found, mindi will not work on this arch ($ARCH) with network"
    83     fi
    84 fi
    85 # Remove left busybox
    86 rm -f $locallib/mindi/rootfs/bin/busybox-*
    8772
    8873# Managing parted2fdisk
  • trunk/mindi/mindi

    r808 r839  
    28712871        # For PXE boot
    28722872        list_of_groovy_mods="$list_of_groovy_mods $NET_MODS"
    2873         # Here we need the net busybox
    2874         mv $mountpoint/bin/busybox.net $mountpoint/bin/busybox
    2875     else
    2876         rm -f $mountpoint/bin/busybox.net
    28772873    fi
    28782874    [ -e "$floppy_modules_path" ] || LogIt "path $floppy_modules_path does not exist.\n If you're not using a modular kernel then you're NUTS.\n"
  • trunk/mondo/distributions/rpm/mondo.spec

    r786 r839  
    22# $Id$
    33#
    4 
    5 %define addreq  mindi >= 1.0.9, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, DDD
    64
    75Summary:    A program which a Linux user can utilize to create a rescue/restore CD/tape
     
    1816Source:     SSS
    1917BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
    20 BuildRequires:  newt-devel >= 0.50, gcc
     18BuildRequires:  newt-devel >= 0.50
     19ExcludeArch:    ppc
    2120OBS
     21Requires:   mindi >= 1.0.9, bzip2 >= 0.9, afio, mkisofs, binutils, newt >= 0.50, DDD
    2222%ifarch ia64
    23 Requires:   %{addreq}, elilo, parted
     23Requires:   elilo, parted
    2424%else
    25 Requires:   %{addreq}, syslinux >= 1.52
     25Requires:   syslinux >= 1.52
    2626%endif
    2727
     
    5858
    5959%build
    60 %configure --program-prefix=%{?_program_prefix}
    61 %{__make} VERSION=%{version}
     60%configure
     61make %{?_smp_mflags} VERSION=%{version}
    6262
    6363%install
    6464%{__rm} -rf $RPM_BUILD_ROOT
    65 %makeinstall
     65make DESTDIR=$RPM_BUILD_ROOT install
    6666
    6767%clean
  • trunk/mondo/src/common/Makefile.am

    r826 r839  
    88
    99libmondo_a_SOURCES  = libmondo-archive.c libmondo-devices.c libmondo-fifo.c \
    10                     libmondo-filelist.c libmondo-files.c libmondo-fork.c \
    11                     libmondo-mountlist.c libmondo-raid.c libmondo-msg.c \
    12                     libmondo-stream.c libmondo-string.c libmondo-tools.c \
    13                     libmondo-verify.c newt-specific.c \
    14                     libmondo-archive.h libmondo-devices.h \
    15                     libmondo-filelist.h libmondo-files.h libmondo-fork.h \
    16                     libmondo-mountlist.h libmondo-raid.h \
    17                     libmondo-stream.h libmondo-string.h libmondo-tools.h \
    18                     libmondo-verify.h libmondo-fifo.h \
    19                     libmondo-archive-EXT.h my-stuff.h mondostructures.h \
    20                     libmondo-devices-EXT.h libmondo-fifo-EXT.h \
    21                     libmondo-files-EXT.h libmondo-fork-EXT.h \
    22                     libmondo-filelist-EXT.h \
    23                     libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
    24                     libmondo-string-EXT.h libmondo-tools-EXT.h \
    25                     libmondo-verify-EXT.h  libmondo-stream-EXT.h \
    26                     newt-specific.h
     10                    libmondo-msg.c \
     11                       libmondo-filelist.c libmondo-files.c libmondo-fork.c \
     12                       libmondo-mountlist.c libmondo-raid.c \
     13                       libmondo-stream.c libmondo-string.c libmondo-tools.c \
     14                       libmondo-verify.c newt-specific.c \
     15                       libmondo-archive.h libmondo-devices.h \
     16                       libmondo-filelist.h libmondo-files.h libmondo-fork.h \
     17                       libmondo-gui.h libmondo-mountlist.h libmondo-raid.h \
     18                       libmondo-stream.h libmondo-string.h libmondo-tools.h \
     19                       libmondo-verify.h libmondo-fifo.h \
     20                       libmondo-archive-EXT.h my-stuff.h mondostructures.h \
     21                       libmondo-devices-EXT.h libmondo-fifo-EXT.h \
     22                       libmondo-files-EXT.h libmondo-fork-EXT.h \
     23                       libmondo-gui-EXT.h libmondo-filelist-EXT.h \
     24                       libmondo-mountlist-EXT.h libmondo-raid-EXT.h  \
     25                       libmondo-string-EXT.h libmondo-tools-EXT.h \
     26                       libmondo-verify-EXT.h  libmondo-stream-EXT.h \
     27                       newt-specific.h
  • trunk/mondo/src/common/libmondo-devices.c

    r835 r839  
    20262026    asprintf(&exclude_these_devices,
    20272027           call_program_and_get_last_line_of_output
    2028            ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|afs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
     2028           ("tr -s '\t' ' ' < /etc/fstab | grep -E '( (coda|ncpfs|nfs|smbfs|cifs|mvfs) )' | cut -d' ' -f1 | tr -s '\n' ' ' | awk '{print $0;}'"));
    20292029           */
    20302030}
  • trunk/mondo/src/common/libmondo-filelist.c

    r795 r839  
    1717#include "newt-specific-EXT.h"
    1818#include "libmondo-tools-EXT.h"
    19 
     19#include "mr_string.h"
    2020
    2121#include <time.h>
     
    13181318                      char *skeleton_filelist)
    13191319{
     1320    const char delims[] = " ";
    13201321    DIR *dip = NULL;
    13211322    struct dirent *dit = NULL;
     1323
    13221324    struct stat statbuf;
    13231325    char *new = NULL;
     
    13291331    static char *name_of_evalcall_form = NULL;
    13301332    int i = 0;
     1333    char *strtmp = NULL;
     1334    char *token = NULL;
     1335    char *find_excludes = NULL;
     1336    int lastpos = 0;
    13311337    static int depth = 0;
    13321338    char *p = NULL;
     
    13471353    if (!depth) {
    13481354        malloc_string(find_skeleton_marker);
     1355        asprintf(&find_excludes, " ");
     1356        while((token = mr_strtok (sth, delims, &lastpos))) {
     1357          asprintf(&strtmp,"%s", find_excludes);
     1358          paranoid_free(find_excludes);
     1359          asprintf(&find_excludes,"%s -path %s -prune -o", strtmp, token);
     1360          paranoid_free(strtmp);
     1361          paranoid_free(token);
     1362        }
    13491363#if linux
    13501364        // 2.6 has /sys as a proc-type thing -- must be excluded
    1351         asprintf(&tmp,
    1352                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",
    1353                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1365        asprintf(&strtmp,
     1366             "find %s -maxdepth %d -fstype mvfs -prune -o -path /dev/shm -prune -o %s -type d -print > %s 2> /dev/null",
     1367             dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
    13541368#else
    13551369        // On BSD, for example, /sys is the kernel sources -- don't exclude
    1356         asprintf(&tmp,
    1357                 "find %s -maxdepth %d -fstype mvfs -prune -o -fstype afs -prune -o -path /proc -prune -o -type d -a -print > %s 2> /dev/null",
    1358                  dir, MAX_SKEL_DEPTH, skeleton_filelist);
     1370        asprintf(&strtmp,
     1371             "find %s -maxdepth %d -fstype mvfs -prune -o -path /proc -prune -o %s -type d -print > %s 2> /dev/null",
     1372                dir, MAX_SKEL_DEPTH, find_excludes, g_skeleton_filelist);
     1373>>>>>>> .merge-right.r838
    13591374#endif
    1360         system(tmp);
     1375        paranoid_free(find_excludes);
     1376        log_msg(5, "find command = %s", strtmp);
     1377        system(strtmp);
     1378        paranoid_free(strtmp);
    13611379        paranoid_free(tmp);
    13621380
  • trunk/mondo/src/common/libmondo-files.c

    r808 r839  
    772772
    773773    asprintf(&command, "du -sk %s", mountpt);
     774    errno = 0;
    774775    fin = popen(command, "r");
    775     paranoid_free(command);
    776 
    777     (void) getline(&tmp, &n, fin);
    778     paranoid_pclose(fin);
    779     p = strchr(tmp, '\t');
    780     if (p) {
    781         *p = '\0';
    782     }
    783     for (p = tmp, llres = 0; *p != '\0'; p++) {
    784         llres *= 10;
    785         llres += (int) (*p - '0');
    786     }
     776    if (errno) {
     777      log_it("popen() FAILED: command=%s, mountpt=%s, fin=%d, errno=%d, strerror=%s", command, mountpt, fin, errno, strerror(errno));
     778      llres = 0;
     779    } else {
     780        (void) getline(&tmp, &n, fin);
     781        paranoid_pclose(fin);
     782        p = strchr(tmp, '\t');
     783        if (p) {
     784            *p = '\0';
     785        }
     786        for (p = tmp, llres = 0; *p != '\0'; p++) {
     787            llres *= 10;
     788            llres += (int) (*p - '0');
     789        }
     790    }
     791
     792    paranoid_free(command);
    787793    paranoid_free(tmp);
    788794    return (llres);
  • trunk/mondo/src/common/libmondo-raid.c

    r783 r839  
    1616#include "libmondo-string-EXT.h"
    1717#include "libmondo-raid.h"
     18#include "mr_string.h"
    1819
    1920#ifdef __FreeBSD__
  • trunk/mondo/src/mondorestore/mondo-restore.c

    r815 r839  
    749749            paranoid_free(tmp);
    750750            retval = interactive_mode(bkpinfo, mountlist, raidlist);
    751             finish(retval);
     751            goto after_the_nuke;
    752752        } else {
    753753            paranoid_free(tmp);
     
    853853    }
    854854    retval += res;
    855     call_me_after_the_nuke(retval);
    856     return(retval);
     855
     856  after_the_nuke:
     857    if (retval) {
     858        log_to_screen("Errors occurred during the nuke phase.");
     859    } else if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "RESTORE"))    // Bruno's thing
     860    {
     861        log_to_screen
     862            ("PC was restored successfully. Thank you for using Mondo Rescue.");
     863        log_to_screen
     864            ("Please visit our website at http://www.mondorescue.org for more information.");
     865    } else {
     866        strcpy(tmp,"Mondo has restored your system.\n\nPlease wait for the command prompt. Then remove the backup media and reboot.\n\nPlease visit our website at http://www.mondorescue.org for more information.");
     867        if (strstr(call_program_and_get_last_line_of_output("cat /proc/cmdline"), "restore") == NULL) {
     868            popup_and_OK(tmp);
     869        }
     870        log_to_screen
     871          ("Mondo has restored your system. Please wait for the command prompt.");
     872        log_to_screen
     873            ("Then remove the backup media and reboot.");
     874        log_to_screen
     875            ("Please visit our website at http://www.mondorescue.org for more information.");
     876    }
     877    g_I_have_just_nuked = TRUE;
     878/*
     879  if (!boot_loader_installed && !does_file_exist(DO_MBR_PLEASE))
     880    {
     881      log_to_screen("PLEASE RUN 'mondorestore --mbr' NOW TO INITIALIZE YOUR BOOT SECTOR");
     882      write_one_liner_data_file(DO_MBR_PLEASE, "mondorestore --mbr");
     883    }
     884*/
     885    return (retval);
     886>>>>>>> .merge-right.r838
    857887}
    858888/**************************************************************************
     
    26542684    struct s_node *filelist = NULL;
    26552685    char *a = NULL, *b = NULL;
     2686    bool run_postnuke = FALSE;
    26562687
    26572688  /**************************************************************************
     
    30673098
    30683099// g_I_have_just_nuked is set true by nuke_mode() just before it returns
    3069     if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
    3070         if (!system("which post-nuke > /dev/null 2> /dev/null")) {
    3071             log_msg(1, "post-nuke found; running...");
    3072             if (mount_all_devices(mountlist, TRUE)) {
    3073                 log_to_screen
    3074                     (_
    3075                      ("Unable to re-mount partitions for post-nuke stuff"));
    3076             } else {
    3077                 log_msg(1, "Re-mounted partitions for post-nuke stuff");
    3078                 asprintf(&tmp, "post-nuke %s %d", bkpinfo->restore_path,
    3079                         retval);
    3080                 if (!g_text_mode) {
    3081                     newtSuspend();
    3082                 }
    3083                 log_msg(2, "Calling '%s'", tmp);
    3084                 if ((res = system(tmp))) {
    3085                     log_OS_error(tmp);
    3086                 }
    3087                 paranoid_free(tmp);
    3088                 if (!g_text_mode) {
    3089                     newtResume();
    3090                 }
    3091 //              newtCls();
    3092                 log_msg(1, "post-nuke returned w/ res=%d", res);
    3093             }
    3094             unmount_all_devices(mountlist);
    3095             log_msg(1, "I've finished post-nuking.");
    3096         }
    3097     }
     3100    if (!system("which post-nuke > /dev/null 2> /dev/null")) {
     3101      log_msg(1, "post-nuke found; find out whether we should run it...");
     3102      if (g_I_have_just_nuked || does_file_exist("/POST-NUKE-ANYWAY")) {
     3103        run_postnuke = TRUE;
     3104        log_msg(1, "Yes, will run post-nuke because in nuke mode or file /POST-NUKE-ANYWAY exists.");
     3105      } else if (ask_me_yes_or_no("post-nuke script found. Do you want to run it?")) {
     3106        run_postnuke = TRUE;
     3107        log_msg(1, "Yes, will run post-nuke because user interactively asked for it.");
     3108      } else {
     3109        run_postnuke = FALSE;
     3110        log_msg(1, "No, will not run post-nuke.");
     3111      }
     3112    } else {
     3113      log_msg(1, "No post-nuke found.");
     3114    }
     3115    if (run_postnuke) {
     3116      log_to_screen("Running post-nuke...");
     3117      if (mount_all_devices(mountlist, TRUE)) {
     3118        log_to_screen
     3119          ("Unable to re-mount partitions for post-nuke stuff");
     3120      } else {
     3121        log_msg(1, "Re-mounted partitions for post-nuke stuff");
     3122        sprintf(tmp, "post-nuke %s %d", bkpinfo->restore_path,
     3123            retval);
     3124        log_msg(2, "Calling '%s'", tmp);
     3125        if ((res = run_program_and_log_output(tmp, 0))) {
     3126          log_OS_error(tmp);
     3127        }
     3128        log_msg(1, "post-nuke returned w/ res=%d", res);
     3129      }
     3130      unmount_all_devices(mountlist);
     3131      log_to_screen("I've finished post-nuking.");
     3132    }
     3133
    30983134/* 
    30993135  log_to_screen("If you are REALLY in a hurry, hit Ctrl-Alt-Del now.");
  • trunk/mondo/src/restore-scripts/mondo/stabgrub-me

    r588 r839  
    3434    old_fstab=/mnt/RESTORING/etc/fstab
    3535    old_grubconf=/mnt/RESTORING/etc/grub.conf
     36        # For some distros, e.g. Debian, /etc/grub.conf is a symbolic link
     37    # which we need to resolve and prepend with /mnt/RESTORING because
     38    # we run this outside the chroot.
     39    if [ -L "$old_grubconf" ] ; then
     40        old_grubconf=/mnt/RESTORING`readlink "$old_grubconf"`
     41    fi 
    3642    return 0
    3743    elif [ -f "/mnt/cdrom/archives/CUCKOO" ] ; then
  • trunk/tools/DISTROS

    r764 r839  
    22mandrake_10.2
    33mandriva_2006.0
     4mandriva_2007.0
    45redhat_7.3
    56redhat_9
  • trunk/tools/build2pkg

    r782 r839  
    3232   
    3333if [ "$1" = "" ]; then
    34     c="mondo-doc mindi mondo"
     34    c="mondo-doc mindi mindi-busybox mondo"
    3535else
    3636    if [ "$1" = "all" ]; then
    37         c="mindi-kernel mondo-doc mindi mondo"
     37        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    3939        c=$1
  • trunk/tools/file2ftp

    r764 r839  
    3232   
    3333if [ "$1" = "" ]; then
    34     c="mondo-doc mindi mondo"
     34    c="mondo-doc mindi mindi-busybox mondo"
    3535else
    3636    if [ "$1" = "all" ]; then
    37         c="mindi-kernel mondo-doc mindi mondo"
     37        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    3939        c=$1
  • trunk/tools/mknewtag

    r782 r839  
    3737    exit -1
    3838else
    39     for p in mindi mondo; do
     39    for p in mindi mondo mindi-busybox mindi-kernel; do
    4040        v=`cat $TOOLHOME/../$p/VERSION`
    4141        grep -q "${v}" $TOOLHOME/../$p/ChangeLog
  • trunk/tools/mknewversion

    r764 r839  
    5050    cd ${VER}
    5151    echo "$TAG" > tools/TAG
    52     for p in mindi mondo mondo-doc mindi-kernel; do
     52    for p in mindi mondo mondo-doc mindi-kernel mindi-busybox; do
    5353        v=${VER}
    5454        if [ $p == "mindi" ]; then
  • trunk/tools/pkg2ftp

    r782 r839  
    3232   
    3333if [ "$1" = "" ]; then
    34     c="mondo-doc mindi mondo"
     34    c="mondo-doc mindi mindi-busybox mondo"
    3535else
    3636    if [ "$1" = "all" ]; then
    37         c="mindi-kernel mondo-doc mindi mondo"
     37        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3838    else
    3939        c=$1
  • trunk/tools/pkg2mdv

    r794 r839  
    3131   
    3232if [ "$1" = "" ]; then
    33     c="mondo-doc mindi mondo"
     33    c="mondo-doc mindi mindi-busybox mondo"
    3434else
    3535    if [ "$1" = "all" ]; then
    36         c="mindi-kernel mondo-doc mindi mondo"
     36        c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    3737    else
    3838        c=$1
  • trunk/tools/svn2build

    r782 r839  
    2323
    2424if [ "$1" = "" ]; then
    25         c="mondo-doc mindi mondo"
     25        c="mondo-doc mindi mindi-busybox mondo"
    2626else
    2727    if [ "$1" = "all" ]; then
    28             c="mindi-kernel mondo-doc mindi mondo"
     28            c="mindi-kernel mondo-doc mindi mindi-busybox mondo"
    2929    else
    3030        c=$1
     
    116116    fi
    117117
    118     if [ _"`echo $p | grep -v kernel | grep mindi`" != _"" ]; then
     118    if [ _"`echo $p | grep -vE 'kernel|busybox' | grep mindi`" != _"" ]; then
    119119        v1=`cat ${SVNBRANCH}/mondo-doc/VERSION`
    120120        if [ ! -d mondo-doc-$v1 ]; then
Note: See TracChangeset for help on using the changeset viewer.