Changeset 3795 in MondoRescue


Ignore:
Timestamp:
Feb 15, 2024, 3:55:18 PM (2 months ago)
Author:
Bruno Cornec
Message:

Untag v3.3.0 never really published in the past - will start from here

Location:
branches
Files:
1 added
28 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/deplist.d/minimal.conf

    r3366 r3795  
    120120/etc/conf.modules
    121121/etc/modules.conf.local
     122/etc/depmod.d/hpvsa.conf
    122123# Debian 7
    123124/bin/kmod
  • branches/3.0/mindi/mindi

    r3360 r3795  
    3939TMPDIR=/tmp
    4040
    41 EXTRA_SPACE=120000      # increase if you run out of ramdisk space
    42 BOOT_SIZE=65600         # size of the boot disk
     41EXTRA_SPACE=140000      # increase if you run out of ramdisk space
     42BOOT_SIZE=75600         # size of the boot disk
    4343
    4444PROMPT_MAKE_CD_IMAGE="yes"
     
    221221    trap SIGHUP SIGTERM SIGTRAP SIGINT
    222222    [ "$MINDI_CACHE" != "" ] && rm -f $MINDI_CACHE/mindi*img $MINDI_CACHE/*gz $MINDI_CACHE/mindi.iso
    223     [ "$minidir_root" != "" ] && rm -Rf $minidir_root/*
    224223    Die "User abort."
    225224}
     
    655654        if [ -e "$MINDI_TMP/post-nuke.tgz" ] ; then
    656655            LogAll "\nINFO: Incorporating post-nuke tarball"
    657             old_pwd=`pwd`
    658             cd "$bigdir"
    659             tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log || LogAll "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log
    660             cd "$old_pwd"
     656            (cd "$bigdir" ; tar -zxf $MINDI_TMP/post-nuke.tgz 2>> $MINDI_TMP/$$.log ) || LogAll "ERROR: when untarring post-nuke tarball" $MINDI_TMP/$$.log
    661657        fi
    662658        if cp -f $MINDI_TMP/mondo*restore $bigdir/usr/bin 2>> $LOGFILE ; then
     
    14981494
    14991495OfferToMakeBootableISO() {
    1500     local i old_pwd
     1496    local i
    15011497    if [ -z "$ISO_CMD" ]; then
    15021498        LogAll "ERROR: Neither mkisofs nor genisoimage found, unable to make CD image"
     
    15531549        cp $ISOLINUX $MINDI_TMP/iso/isolinux.bin 2>> $LOGFILE || Die "Cannot copy isolinux.bin ($ISOLINUX) to $MINDI_TMP/iso - did you run out of disk space?"
    15541550    fi
    1555     old_pwd=`pwd`
    1556     cd "$MINDI_TMP/iso"
    15571551    if [ "$ARCH" != "ia64" ] ; then
    15581552        if [ _"$MONDO_SHARE" != _"" ]; then
     
    15661560            cp -f $MONDO_SHARE/autorun $MINDI_TMP/iso 2>> $LOGFILE
    15671561        fi
    1568         $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log
    1569     else
    1570         $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c images/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log
     1562        (cd $MINDI_TMP/iso ; $ISO_CMD -U $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . > /dev/null 2> $MINDI_TMP/mkisofs.log)
     1563    else
     1564        (cd $MINDI_TMP/iso ; $ISO_CMD $ISO_OPT -V Mindi_Image -o $MINDI_CACHE/mindi.iso -b images/mindi-bootroot.$BOOT_SIZE.img -c images/boot.cat -no-emul-boot . > /dev/null 2> $MINDI_TMP/mkisofs.log)
    15711565    fi
    15721566    if [ "$?" -ne "0" ] ; then
     
    15791573    fi
    15801574    rm -f $MINDI_TMP/mkisofs.log
    1581     cd "$old_pwd"
    15821575}
    15831576
     
    26012594            Die "ERROR: Unable to copy $f to the target dir. Check your installation or McAfee presence"
    26022595        else
    2603             cp -Rdf $f . 2>&1 >> $LOGFILE
     2596            if [ -d $f ]; then
     2597                # Allow to suport target dirs being a symlink
     2598                td=`basename $f`
     2599                if [ ! -e $td ]; then
     2600                    mkdir -p $td
     2601                fi
     2602                cp -Rdf $f/* $td 2>&1 >> $LOGFILE
     2603            else
     2604                cp -df $f . 2>&1 >> $LOGFILE
     2605            fi
    26042606        fi
    26052607    done
     
    26372639    if [ $? -eq 0 ]; then
    26382640        # We want to use the real mount and all the supported variants (nfs, cifs, ...)
    2639         rm -f bin/mount
     2641        rm -f $mountpoint/bin/mount
    26402642    fi
    26412643
     
    26862688        tar cf - -C / /etc/udev 2>> $MINDI_TMP/$$.log | tar xf -  || LogIt "ERROR: Problem in /etc/udev analysis" $MINDI_TMP/$$.log
    26872689        # This avoids NIC remapping if on another machine at restore time on Debian/Ubuntu at least
    2688         rm -f ./etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules
     2690        rm -f $mountpoint/etc/udev/rules.d/[z]*[0-9][0-9][-_]persistent-net.rules
    26892691        # Do not do it if it's a link (Ubuntu 64 bits #503)
    26902692        if [ -e "/lib64/udev" ] && [ ! -h "/lib64" ] && [ ! -h "/lib64/udev" ]; then
  • branches/3.3/MondoRescue/lib/MondoRescue/File.pm

    r3742 r3795  
    156156        if (defined $link) {
    157157            $link = mr_file_normalize($link,"$curdir/$dir");
    158             # It's a real symlink so handle it
    159             $files->{$f}->{"$curdir/$dir"} = 1;
     158            # It's a real symlink on a file so handle it
     159            $files->{$f}->{"$curdir/$dir"} = 1 if ((not -d $link) && (not -d "/$link"));
    160160            if (substr($link,0,1) eq "/") {
    161161                $curdir = $link;
     
    170170                foreach my $k (keys %$h) {
    171171                    foreach my $l (keys %$k) {
    172                         # Use $f as key as we affects all the files
     172                        # Use $f as key as we affect all the files
    173173                        # found in recursion to the current managed file
    174174                        $files->{$f}->{$l} = 1;
  • branches/3.3/MondoRescue/t/01-read-all-link.t

    r3772 r3795  
    77# Create the structure for the tests
    88my $bd = tempdir(
    9     CLEANUP => 1
     9    #CLEANUP => 1
    1010    );
    1111
     
    2323copy "/usr/bin/perl","usr/bin" || die "$!";
    2424chmod 0755,"usr/bin/perl";
    25 my $libc;
    2625foreach my $f (<"/lib/libc.so.[0-9]*">) {
    2726    copy "$f","usr/lib" || die "$!";
    28     $libc = $f;
    2927}
    3028
     
    5755    );
    5856
    59 my $more = 1;
    60 
    61 eval
    62 {
    63         require Test::More;
    64         Test::More->import();
    65         no_plan();
     57eval {
     58    require Test;
     59    Test->import();
    6660};
    67 # Test::More not found so simpler test
    6861if ($@) {
    69     $more = 0;
    70     eval {
    71         require Test;
    72         Test->import();
    73     };
    74     if ($@) {
    75         require Test::Simple;
    76         Test::Simple->import();
    77     }
     62        require Test::Simple;
     63    Test::Simple->import();
    7864}
    7965plan(tests => 12);
     
    9783sub myis {
    9884
    99 if ($more eq 1) {
    100     return(is(@_));
    101 } else {
    102     my $p1 = shift;
    103     my $p2 = shift;
    104     my $p3 = shift;
    105     print "# test $p3\n";
    106     return(ok($p1,$p2));
     85my $p1 = shift;
     86my $p2 = shift;
     87my $p3 = shift;
     88print "# test $p3\n";
     89return(ok($p1,$p2));
    10790}
    108 }
    109 
  • branches/3.3/ansible/inventory

    r3747 r3795  
    4747#victoria2.home.musique-ancienne.org
    4848
     49[gitea]
     50www.mondorescue.org
     51
    4952[system]
    5053www.mondorescue.org
  • branches/3.3/ansible/roles/docker/tasks/main.yml

    r3674 r3795  
    22
    33- name: Check mandatory packages installed
    4   urpmi: name={{ item.pkg }} state=installed update_cache=yes no-recommends=yes
     4  urpmi: name={{ item.pkg }} state=installed update_cache=yes no_recommends=yes
    55  with_items:
    66    - { pkg: docker }
  • branches/3.3/ansible/roles/git/tasks/main.yml

    r3656 r3795  
    22
    33- name: Check that git is installed
    4   urpmi: name=git state=installed no-recommends=yes
     4  urpmi: name=git state=installed no_recommends=yes
    55  tags: git
    66
  • branches/3.3/ansible/roles/httpd/tasks/main.yml

    r3792 r3795  
    22
    33- name: Check that Apache is installed
    4   urpmi: name=apache state=installed no-recommends=yes
     4  urpmi: name=apache state=installed no_recommends=yes
    55
    66- name: Check that Apache mod_proxy is installed
    7   urpmi: name=apache-mod_proxy state=installed no-recommends=yes
     7  urpmi: name=apache-mod_proxy state=installed no_recommends=yes
    88
    99- name: Configure Apache log directories
  • branches/3.3/ansible/roles/mageia-docker/tasks/main.yml

    r3672 r3795  
    22
    33- name: Check mageia-docker mandatory packages installed
    4   urpmi: name={{ item.pkg }} state=installed update_cache=yes no-recommends=yes
     4  urpmi: name={{ item.pkg }} state=installed update_cache=yes no_recommends=yes
    55  with_items:
    66    - { pkg: git }
  • branches/3.3/ansible/roles/ntp/tasks/main.yml

    r3674 r3795  
    22
    33- name: Check that ntp is installed
    4   urpmi: name=ntp state=installed no-recommends=yes
     4  urpmi: name=ntp state=installed no_recommends=yes
    55  tags: ntp
    66
  • branches/3.3/ansible/roles/ntp/templates/ntp.conf.j2

    r3747 r3795  
    2828#
    2929driftfile /var/lib/ntp/drift
    30 multicastclient 224.0.1.1       # listen on default 224.0.1.1
     30# Incorrect starting with mga9
     31#multicastclient    224.0.1.1       # listen on default 224.0.1.1
    3132broadcastdelay  0.008
    3233
     
    5152# the administrative functions.
    5253restrict 127.0.0.1
    53 restrict ::1
     54#restrict ::1
  • branches/3.3/ansible/roles/pb/tasks/main.yml

    r3670 r3795  
    22
    33- name: Check pb mandatory packages installed
    4   urpmi: name={{ item.pkg }} state=installed update_cache=yes no-recommends=yes
     4  urpmi: name={{ item.pkg }} state=installed update_cache=yes no_recommends=yes
    55  with_items:
    66    - { pkg: createrepo }
    7     - { pkg: apt }
     7      # pending Mageia 9 resolution
     8      #- { pkg: apt }
    89    - { pkg: apt-mga }
    910    - { pkg: dpkg }
  • branches/3.3/ansible/roles/resolvconf/tasks/main.yml

    r3655 r3795  
    22
    33- name: Check that resolvconf is installed
    4   urpmi: name=resolvconf state=installed no-recommends=yes
     4  urpmi: name=resolvconf state=installed no_recommends=yes
    55  tags: resolvconf
    66
  • branches/3.3/ansible/roles/rsync/tasks/main.yml

    r3667 r3795  
    22
    33- name: Check that rsync is installed
    4   urpmi: name=rsync state=installed no-recommends=yes
     4  urpmi: name=rsync state=installed no_recommends=yes
    55  tags: rsync
    66
  • branches/3.3/ansible/roles/shorewall/tasks/main.yml

    r3694 r3795  
    11---
    22- name: Install shorewall
    3   urpmi: name=shorewall state=installed no-recommends=yes
     3  urpmi: name=shorewall state=installed no_recommends=yes
    44
    55# Generate configuration
  • branches/3.3/ansible/roles/shorewall/templates/shorewall.conf.j2

    r3758 r3795  
    1313
    1414###############################################################################
    15 #                V E R B O S I T Y
     15#                            V E R B O S I T Y
    1616###############################################################################
    1717
     
    1919
    2020###############################################################################
    21 #                   P A G E R
     21#                               P A G E R
    2222###############################################################################
    2323
     
    2525
    2626###############################################################################
    27 #                F I R E W A L L
     27#                            F I R E W A L L
    2828###############################################################################
    2929
     
    3131
    3232###############################################################################
    33 #                  L O G G I N G
     33#                              L O G G I N G
    3434###############################################################################
    3535#
     
    5252LOGFILE=/var/log/messages
    5353
    54 LOGFORMAT="Shorewall %s %s"
     54LOGFORMAT="Shorewall:%s:%s:"
    5555
    5656LOGTAGONLY=No
     
    7575
    7676###############################################################################
    77 #   L O C A T I O N   O F   F I L E S   A N D   D I R E C T O R I E S
     77#       L O C A T I O N   O F   F I L E S   A N D   D I R E C T O R I E S
    7878###############################################################################
    7979
     
    109109
    110110###############################################################################
    111 #       D E F A U L T   A C T I O N S / M A C R O S
     111#               D E F A U L T   A C T I O N S / M A C R O S
    112112###############################################################################
    113113
     
    120120
    121121###############################################################################
    122 #            R S H / R C P  C O M M A N D S
     122#                        R S H / R C P  C O M M A N D S
    123123###############################################################################
    124124
     
    127127
    128128###############################################################################
    129 #           F I R E W A L L   O P T I O N S
     129#                       F I R E W A L L   O P T I O N S
    130130###############################################################################
    131131
     
    274274
    275275###############################################################################
    276 #           P A C K E T   D I S P O S I T I O N
     276#                       P A C K E T   D I S P O S I T I O N
    277277###############################################################################
    278278
     
    296296
    297297################################################################################
    298 #           P A C K E T  M A R K  L A Y O U T
     298#                       P A C K E T  M A R K  L A Y O U T
    299299################################################################################
    300300
  • branches/3.3/ansible/roles/smtp/defaults/main.yml

    r3655 r3795  
    11---
    22smtp_role: client
     3admin_email: bruno@victoria.frmug.org
     4include_vars: opendkim_vars.yml
  • branches/3.3/ansible/roles/smtp/tasks/main.yml

    r3674 r3795  
    22
    33- name: Check that postfix is installed
    4   urpmi: name=postfix state=installed no-recommends=yes
     4  urpmi: name=postfix state=installed no_recommends=yes
    55  tags: smtp
    66
  • branches/3.3/ansible/roles/svn/tasks/main.yml

    r3773 r3795  
    22
    33- name: Check that subversion is installed
    4   urpmi: name=subversion-server state=installed no-recommends=yes
     4  urpmi: name=subversion-server state=installed no_recommends=yes
    55  tags: subversion
    66
  • branches/3.3/ansible/roles/sympa/tasks/main.yml

    r3696 r3795  
    22
    33- name: Check that mandatory packages are installed
    4   urpmi: name={{ item }} state=installed no-recommends=yes
     4  urpmi: name={{ item }} state=installed no_recommends=yes
    55  with_items:
    66    - mariadb
  • branches/3.3/ansible/roles/system/tasks/main.yml

    r3674 r3795  
    1818
    1919- name: Check that sshd is installed
    20   urpmi: name=openssh-server state=installed update_cache=yes no-recommends=yes
     20  urpmi: name=openssh-server state=installed update_cache=yes no_recommends=yes
    2121  tags: system
    2222
     
    6161
    6262- name: Check that sshutout is installed
    63   urpmi: name=sshutout state=installed update_cache=yes no-recommends=yes
     63  urpmi: name=sshutout state=installed update_cache=yes no_recommends=yes
    6464  tags: system
    6565
  • branches/3.3/ansible/roles/trac/tasks/main.yml

    r3752 r3795  
    22
    33- name: Check that docutils is installed
    4   urpmi: name=python-docutils state=installed no-recommends=yes
     4  urpmi: name=python-docutils state=installed no_recommends=yes
    55  tags: trac
    66
    77- name: Check that pip is installed
    8   urpmi: name=python-pip state=installed no-recommends=yes
     8  urpmi: name=python-pip state=installed no_recommends=yes
    99  tags: trac
    1010
    1111- name: Install trac with fcgi
    12   urpmi: name=trac-fcgi state=installed no-recommends=yes
     12  urpmi: name=trac-fcgi state=installed no_recommends=yes
    1313  tags: trac
    1414
     
    1818  # Do it only at upgrade of trac:
    1919- name: Install trac plugins
    20   command: pip install --no-deps --upgrade -t /usr/lib/python2.7/site-packages/ {{ item }}
     20  command: pip install --no-deps --upgrade -t /usr/lib/python3.10/site-packages/ {{ item }}
    2121  with_items:
    22   - TracAccountManager
     22    #- TracAccountManager # Installed from trunk
    2323  - TracTags
    2424  - TracRobotsTxt
  • branches/3.3/ansible/roles/urpmi/files/addmedia

    r3793 r3795  
    11#!/bin/bash
    22urpmi.removemedia -a
    3 urpmi.addmedia --distrib mga http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/8/x86_64
     3urpmi.addmedia --distrib mga http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/9/x86_64
  • branches/3.3/ansible/roles/urpmi/tasks/main.yml

    r3667 r3795  
    1111
    1212- name: Check mandatory packages installed
    13   urpmi: name={{ item.pkg }} state=installed update_cache=yes no-recommends=yes
     13  urpmi: name={{ item.pkg }} state=installed update_cache=yes no_recommends=yes
    1414  with_items:
    1515    - { pkg: bind-utils }
  • branches/3.3/ansible/roles/vsftpd/tasks/main.yml

    r3674 r3795  
    22
    33- name: Check that vsftpd is installed
    4   urpmi: name=vsftpd state=installed no-recommends=yes
     4  urpmi: name=vsftpd state=installed no_recommends=yes
    55  tags: vsftpd
    66
  • branches/3.3/ansible/site.yml

    r3749 r3795  
    55- import_playbook: ntp.yml
    66- import_playbook: smtp.yml
    7 - import_playbook: trac.yml
     7  #- import_playbook: trac.yml
    88- import_playbook: vsftpd.yml
    99- import_playbook: svn.yml
  • branches/3.3/mindi/mindi

    r3785 r3795  
    302302    local outdir incoming counter d found tdir templog
    303303    outdir=$1
     304    noof_lines=$2
     305    counter=$3
    304306    templog=$MINDI_TMP/$$.log
    305307    mkdir -p $outdir
    306308    incoming=`ReadLine`
    307     counter=$3
    308309    > $templog
    309310
    310311    while [ "$incoming" != "" ] ; do
    311         if [ "$3" = "1" ]; then
     312        LogFile "DEBUG: Handling $incoming"
     313        if [ "$noof_lines" != "0" ]; then
    312314            counter=$(($counter+1))
    313             LogProgress $counter $2
     315            LogProgress $counter $noof_lines
    314316        fi
    315317        # Non absolute file names should not arrive till here => skipped
    316318        if [ `echo "$incoming" | cut -c1` != '/' ]; then
    317             LogFile "WARNING: Unable to handle non-full pathname $incoming"
     319            LogAll "WARNING: Unable to handle $incoming"
    318320            incoming=`ReadLine`
    319321            continue
    320322        fi
     323        if [ -e "$incoming" ]; then
     324            LogFile "DEBUG: Adding $incoming"
     325            listfile="$listfile $incoming"
     326        fi
     327        incoming=`ReadLine`
     328    done
     329
     330    LogAll "Creating mindi tar file"
     331    tar cf - -C / $listfile 2> $templog | (cd "$outdir" ; tar xf -) # || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog
     332}
     333
     334bidon() {
     335
    321336        # no parent directory of incoming should be a link, copy is not possible in that case
    322337        d=`dirname "$incoming"`
    323338        found="false"
    324339        while [ $d != "/" -a $found = "false" ]; do
    325             [ -h "$d" ] && found="true"
     340            if [ -h "$d" ]; then
     341                found="true"
     342                LogFile "WARNING: skipping $d as link"
     343                incoming=`ReadLine`
     344                continue
     345            fi
    326346            d=`dirname "$d"`
    327347        done
     348
    328349        if [ -d "$incoming" -a ! -h "$incoming" ]; then
    329             find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0
     350            LogFile "DEBUG: Finding in $incoming"
     351            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 0 0
    330352        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    331353            if [ ! -h "$incoming" ]; then
     354                LogFile "DEBUG: Tarring $incoming"
    332355                tar cf - -C / $incoming 2> $templog | (cd "$outdir" ; tar xf -) || Die "Cannot copy $incoming to $outdir - did you run out of disk space?" $templog
    333356            else
     357                LogFile "DEBUG: Copying $incoming"
    334358                tdir=`dirname "$incoming"`
    335359                if [ ! -e "$outdir/$tdir" ]; then
     
    340364            # Only uncompress modules if not using udevd
    341365            if [ "`echo "$incoming" | grep "lib/modules/.*\..*o\.gz"`" != "" ] && [ "`ps auxww | grep -v grep | grep -qw udevd`" != "" ]; then
    342                 gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming"
     366                    gunzip -f $outdir/$incoming || LogAll "WARNING: Cannot gunzip $outdir/$incoming"
    343367            fi
    344368            [ -x "$outdir" ] && StripExecutable $outdir
    345369        fi
    346370        incoming=`ReadLine`
    347     done
    348371}
    349372
     
    356379    done
    357380    echo $r
    358 }
    359 
    360 
    361 DropOptimizedLibraries() {
    362     local outdir filelist list_of_optimized_libraries optimized_lib_name vanilla_lib_name reason msg resolved res
    363     filelist=$1
    364     outdir=$2
    365 
    366     list_of_optimized_libraries=`grep "lib/i[5-7]86/" $filelist`
    367     if [ "$list_of_optimized_libraries" = "" ] ; then
    368         return 0
    369     fi
    370     echo -en "Dropping i686-optimized libraries if appropriate"
    371     for optimized_lib_name in $list_of_optimized_libraries ; do
    372         echo -en "."
    373         reason=""
    374         vanilla_lib_name=`echo "$optimized_lib_name" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    375         echo "$vanilla_lib_name" >> $filelist
    376         LogFile "INFO: Adding $vanilla_lib_name to filelist"
    377         mkdir -p $outdir$optimized_lib_name > /dev/null 2> /dev/null
    378         rmdir $outdir$optimized_lib_name > /dev/null 2> /dev/null
    379 
    380         # This may return multiple files
    381         for resolved in `mr-read-all-link $vanilla_lib_name`; do
    382             LogFile "INFO: Adding as deps $resolved to filelist"
    383             vanilla_resolved_name=`echo "$resolved" | sed -e 's/i[5-7]86//' -e 's/cmov//' -e 's/nosegneg//' | tr -s '/' '/'`
    384             if [ "$vanilla_resolved_name" != "$resolved" ]; then
    385                 mkdir -p $outdir$resolved> /dev/null 2> /dev/null
    386                 rmdir $outdir$resolved > /dev/null 2> /dev/null
    387                 ln -sf $vanilla_resolved_name $outdir$resolved
    388                 LogFile "INFO: Excluding deps $resolved"
    389                 grep -Fvx "$resolved" "$filelist" > $filelist.tmp
    390                 LogFile "INFO: Replacing it with $vanilla_resolved_name"
    391                 echo "$vanilla_resolved_name" >> $filelist.tmp
    392                 mv -f $filelist.tmp $filelist
    393             fi
    394         done
    395     done
    396     $AWK '{ print $1; }' $filelist | sort -u > $filelist.tmp
    397     mv -f $filelist.tmp $filelist
    398     echo -e "$DONE"
    399381}
    400382
     
    23502332
    23512333PrepareBigDir() {
    2352     local needlist diskdir res i j k lines lfiles includefile ti
     2334    local needlist diskdir res i j k lines lfiles includefile ti templog
    23532335
    23542336    rm -f $MINDI_CACHE/mindi.iso
    2355     needlist=$MINDI_TMP/what-we-need.txt
    2356     mkdir -p $bigdir/usr/bin
    2357     mkdir -p $bigdir/usr/sbin
    2358     includefile=$MINDI_TMP/$$.includefile.txt
    2359 
    2360     lfiles=`ls $DEPLIST_DIR/* | grep -v /minimal`
     2337    mkdir -p $targetdir
     2338    templog=$MINDI_TMP/$$.log
     2339    needlist=$MINDI_TMP/kernel-modules.conf
     2340    mkdir -p $bigdir/usr/bin $bigdir/usr/sbin $bigdir/tmp
     2341    # Generated file
     2342    includefile=$MINDI_TMP/include-modules.conf
     2343
     2344    lfiles=`ls $DEPLIST_DIR/* | grep -Ev '/minimal|/udev|/drbd'`
    23612345    if [ -e "$DEPLIST_FILE" ]; then
    23622346        lfiles="$DEPLIST_FILE $lfiles"
    23632347    fi
    2364     lines=`grep -vx " *#.*" $lfiles | grep -vx "" | wc -l`
    23652348    ParseModprobeForIncludes $includefile
    2366     lines=$(($lines+`cat $includefile | wc -l`))
    2367     cat $lfiles $includefile | GenerateGiantDependencyList $needlist $lines
    2368     res=$?
     2349    ListKernelModulePaths > $needlist
     2350    for f in $lfiles $includefile $needlist; do
     2351        CopyFromConf $f $targetdir
     2352    done
    23692353    rm -f $includefile
    2370     ListKernelModulePaths >> $needlist
    2371     if [ "$res" -ne "0" ] ; then
    2372         Die "You have $res files present in dependency list\nbut absent from filesystem."
    2373     fi
    2374     mkdir -p $bigdir/tmp
     2354
    23752355    if [ _"$MONDO_SHARE" != _"" ]; then
    23762356        # TODO: no reason to have the cfg file stored twice
     
    23832363
    23842364    [ -d "/mnt/.boot.d" ] && echo "GENTOO" > $bigdir/tmp/DUMBASS-GENTOO
    2385     DropOptimizedLibraries $needlist $bigdir
    2386     echo -en "INFO: Assembling dependency files"
    2387 
    2388     CopyDependenciesToDirectory < $needlist $bigdir `wc -l $needlist` 1
    2389     rm -f $needlist
    2390     echo -e "$DONE"
    23912365
    23922366    # also copy io.sys and msdos.sys, if we can find them
     
    24192393    done
    24202394    if [ -e "$MONDO_SHARE/restore-scripts" ]; then
     2395        mkdir -p $bigdir/usr/bin $bigdir/etc
    24212396        cp -Rdf $MONDO_SHARE/restore-scripts/mondo/* $bigdir/usr/bin 2>> $LOGFILE
    24222397        [ $? -ne 0 ] && [ _"$MONDO_SHARE" != _"" ] && Die "Cannot find/install $MONDO_SHARE/restore-scripts"
     
    24732448    PrepareBootDir
    24742449
     2450    LogFile "---------------------------"
     2451    LogFile "Content of initial bigdir:"
     2452    LogFile "---------------------------- "
     2453    (cd "$bigdir" ; ls -Rla ) >> $LOGFILE
     2454    LogFile "---------------------------"
    24752455}
    24762456
     
    27142694    conf=$1
    27152695    mp=$2
    2716     echo -en "INFO: Gathering dependencies of $conf.conf..."
    2717     LogFile "INFO: Gathering dependencies of $conf.conf..."
    2718     lis2=`grep -Ev '^#' $DEPLIST_DIR/$conf.conf | sort -u`
     2696    if [ ! -e $conf ]; then
     2697        # Invoked with a conf file short name fixing...
     2698        conf="$DEPLIST_DIR/$1.conf"
     2699    fi
     2700    if [ ! -e $conf ]; then
     2701        LogAll "Unable to find conf file $conf please report upstream"
     2702        return
     2703    fi
     2704    bconf=`basename $conf .conf`
     2705    echo -en "INFO: Gathering dependencies of $bconf..."
     2706    LogFile "INFO: Gathering dependencies of $conf..."
     2707    lis2=`grep -Ev '^#' $conf | sort -u`
    27192708    noof_lines=`echo $lis2 | wc -w`
    27202709    progress=0
     2710    LogFile "DEBUG: targetdir: `ls -l $mp/`"
     2711    LogFile "DEBUG: lis2=$lis2"
    27212712    # Get only the files which exist in that list
    27222713    # and potentially their symlink structure
    27232714    # put apart directories for later handling
     2715    touch $MINDI_TMP/$bconf.lis $MINDI_TMP/$bconf.lis2
    27242716    for f in $lis2; do
    27252717        if [ -d $f ]; then
    27262718            for g in `find $f`; do
    2727                 echo $g >> $MINDI_TMP/$conf.lis
    2728                 LocateDeps $g  >> $MINDI_TMP/$conf.lis2
     2719                echo $g >> $MINDI_TMP/$bconf.lis
     2720                LocateDeps $g  >> $MINDI_TMP/$bconf.lis2
    27292721            done
    27302722            lis3="$lis3 $f"
    27312723        else
    27322724            if [ -r $f ]; then
    2733                 echo $f >> $MINDI_TMP/$conf.lis
    2734                 LocateDeps $f >> $MINDI_TMP/$conf.lis2
     2725                echo $f >> $MINDI_TMP/$bconf.lis
     2726                LocateDeps $f >> $MINDI_TMP/$bconf.lis2
    27352727            fi
    27362728        fi
     
    27382730        LogProgress $progress $noof_lines
    27392731    done
    2740     echo -e "$DONE"
    2741     LogAll "INFO: Processing all dependencies links for $conf.conf..."
     2732    LogFile "DEBUG: lis3=$lis3"
     2733    #LogAll "INFO: Processing all dependencies links for $conf..."
    27422734    # And their deps except dirs
    2743     lines=`sort -u $MINDI_TMP/$conf.lis $MINDI_TMP/$conf.lis2`
    2744     rm -f $MINDI_TMP/$conf.lis2
     2735    lines=`sort -u $MINDI_TMP/$bconf.lis $MINDI_TMP/$bconf.lis2`
     2736    rm -f $MINDI_TMP/$bconf.lis2
    27452737    finallist=""
    27462738    # Remove directories from the list, as cp will create them anyway
     
    27482740    # recent bash says that -d is true for a link to a dir !
    27492741    for f in $lines; do
     2742        LogFile "DEBUG: f=$f"
    27502743        if [ -e "$f" -a ! -d "$f" ] || [ -h "$f" ]; then
     2744            LogFile "DEBUG: Test OK"
    27512745            # Do not overwrite files already in destination (avoid using option -n of cp not portable)
    27522746            if [ ! -e "$mp/$f" ]; then
    27532747                finallist="$finallist $f"
     2748                LogFile "DEBUG: Creating $mp/$f"
     2749            else
     2750                LogFile "DEBUG: Target exist `ls -al $mp/$f`"
    27542751            fi
    27552752        fi
    27562753    done
     2754    LogFile "DEBUG: finallist=$finallist"
    27572755    # But adds the directory useful in $lis3
    27582756    fnllist=`echo $finallist $lis3 | tr ' ' '\n' | sort -u | tr '\n' ' '`
    2759     LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/"
    2760     cp -a --parents $fnllist -t $mp/ 2> $templog  || LogAll "WARNING: Problem in $conf analysis" $templog
    2761     rm -f $MINDI_TMP/$conf.lis
     2757    echo -e "$DONE"
     2758    if [ _"$fnllist" != _"" ] && [ _"$fnllist" != _" " ]; then
     2759        LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist -t $mp/"
     2760        cp -a --parents $fnllist -t $mp/ 2>$templog  || LogAll "WARNING: Problem in $conf analysis" $templog
     2761    fi
     2762    rm -f $MINDI_TMP/$bconf.lis
    27622763}
    27632764
     
    27722773    > $templog
    27732774
    2774     mkdir -p $targetdir
    27752775    # Check whether /lib64 or /lib or /sbin or /bin is a link and if so explicitly create one in rootfs (Fedora 17 crazyness)
    27762776    for d in bin sbin lib lib64; do
     
    27782778            thelink=`readlink /$d`
    27792779            mkdir -p $targetdir/$thelink || LogAll "ERROR: Unable to create $thelink in $targetdir"
    2780             mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink 2> /dev/null
     2780            mv $targetdir/$d/* $targetdir/$d/.??* $targetdir/$thelink
    27812781            if [ -d "$targetdir/$d" -a ! -h "$targetdir/$d" ]; then
    27822782                rmdir $targetdir/$d
     
    30303030
    30313031    mkdir -p $targetdir/proc
     3032    cp -a $MY_FSTAB $targetdir/tmp
    30323033    LogFile "---------------------------"
    30333034    LogFile "Content of initial targetdir:"
  • branches/3.3/mondo/src/common/libmondo-archive.c

    r3777 r3795  
    631631        if (strcmp(bootldr_ver,"") == 0) {
    632632            mr_free(bootldr_ver);
    633             bootldr_ver = call_program_and_get_last_line_of_output("grub2-install --version");
     633            bootldr_ver = call_program_and_get_last_line_of_output("grub2-install --version 2> /dev/null");
    634634        }
    635635    } else if (bkpinfo->boot_loader == 'E') {
Note: See TracChangeset for help on using the changeset viewer.