Changeset 1597


Ignore:
Timestamp:
May 26, 2012, 2:13:12 AM (8 years ago)
Author:
Bruno Cornec
Message:
  • Adds option pbshowsudo (false by default) to check whether we display the detail of sudo commands (to match security requiremetns) or not (to have a nicer output)
  • Fix a template generation error in Env.pm for deb rules file (line was split)
  • In VE.pm fix modes of the chroot after the snapshot phase detection to avoid error which make the code die
  • In pb create the RPM build dirs before entering in the parallel loop as sometimes 2 identical were created simultaneously, leading to an error leading to a die
  • In pb revert the code added by Eric to check deb content creation as it was failing in my environement (naming issues). Could be added after 0.12.1 is out as an additional check, but anyway as the files are copied after, it's not that important.
  • Use full path of chown in sudo for pb
  • Make the test account a variable in pbtest
  • Start to add test case for a VM in pbtest
  • This patch makes pb build back in a debian 6 VE.
Location:
devel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/etc/pb.conf

    r1594 r1597  
    628628pbusesshagent default = false
    629629
     630# Do you want to see detailed sudo commands or just the summary of them
     631# Useful for security concerns, nice to have it as a parameter
     632pbshowsudo default = false
     633
    630634# How do you want to install pb in your VM/VE (pkg or file)
    631635pbinstalltype default = pkg
  • devel/pb-modules/etc/pb.conf.pod

    r1556 r1597  
    552552 Example: pbrepo mondorescue = ftp://ftp.mondorescue.org
    553553
     554=item B<pbshowsudo>
     555
     556 Nature: Optional
     557 Key: project (as defined in the -p option or PBPROJ environment variable)
     558 Value: false (by default), meaning that sudo commands executed with pb_system won't be shown in details, but that the associated comment will be used. For security cncerns, you may want to turn it to true in order to see what pb does with sudo to be safe. Turned on by debug flag.
     559 Conffile: home
     560 Example: pbshowsudo mondorescue = true
     561
    554562=item B<pbsmtp>
    555563
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1595 r1597  
    157157
    158158# If sudo used, then be more verbose
    159 pb_log(0,"Executing $cmd\n") if (($pbdebug < 1) && ($cmd =~ /^\s*\S*sudo/o));
     159pb_log(0,"Executing $cmd\n") if (($pbdebug < 1) && ($cmd =~ /^\s*\S*sudo/o) && (defined $Global::pb_show_sudo) && ($Global::pb_show_sudo =~ /true/oi));
    160160
    161161system("$cmd $redir");
  • devel/pb-modules/lib/ProjectBuilder/Distribution.pm

    r1596 r1597  
    450450        pb_log(1, "INFO: missing dependency $p\n");
    451451    } elsif ($pbos->{'type'} eq "deb") {
    452         my $res = pb_system("dpkg -L $p","","mayfail");
     452        my $res = pb_system("dpkg -L $p","Looking for $p","mayfail");
    453453        next if ($res eq 0);
    454454        open(CMD,"dpkg -l $p |") or die "Unable to run dpkg -l $p: $!";
  • devel/pb-modules/lib/ProjectBuilder/Env.pm

    r1584 r1597  
    983983    INSTALL_PROGRAM += -s
    984984endif
     985
    985986config.status: configure
    986987    dh_testdir
    987988
    988989    # Configure the package.
    989     CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
    990  --mandir=\$${prefix}/share/man
     990    CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man
    991991
    992992# Build both architecture dependent and independent
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r1596 r1597  
    248248        }
    249249    }
    250    
    251     # Fix modes to allow access to the VE for pb user
    252     my $command = pb_check_req("chmod",0);
    253     pb_system("$sudocmd $command 755 $root/$pbos->{'name'} $root/$pbos->{'name'}/$pbos->{'version'} $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}","Fixing permissions");
    254250
    255251    # Test if an existing snapshot exists and use it if appropriate
     
    265261            pb_system("$sudocmd $cmd1 -rf $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'} ; $sudocmd $cmd2 -p $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'} ; $sudocmd $cmd3 xz  -C $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'} -f $root/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.tar.gz","Extracting snapshot of $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.tar.gz under $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}");
    266262    }
     263   
     264    # Fix modes to allow access to the VE for pb user
     265    my $command = pb_check_req("chmod",0);
     266    pb_system("$sudocmd $command 755 $root/$pbos->{'name'} $root/$pbos->{'name'}/$pbos->{'version'} $root/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}","Fixing permissions");
     267
    267268    # Nothing more to do for VE. No real launch
    268269} else {
  • devel/pb/bin/pb

    r1595 r1597  
    4242
    4343# Global variables
    44 $Global::pb_stop_on_error = 1;
     44$Global::pb_stop_on_error = 1;  # True by default
     45$Global::pb_show_sudo = 0;      # False by default
     46
    4547my %opts;                   # CLI Options
    4648my $action;                 # action to realize
     
    739741# Check for command requirements
    740742#
    741 my ($req,$opt,$pbpara) = pb_conf_get_if("oscmd","oscmdopt","pbparallel");
     743my ($req,$opt,$pbpara,$pbshowsudo) = pb_conf_get_if("oscmd","oscmdopt","pbparallel","pbshowsudo");
    742744pb_check_requirements($req,$opt,$appname);
     745
     746$Global::pb_show_sudo = 1 if ((defined $pbshowsudo) && (defined $pbshowsudo->{$ENV{'PBPROJ'}}) && ($pbshowsudo->{$ENV{'PBPROJ'}} =~ /true/oi));
    743747
    744748#
     
    14321436    pb_mkdir_p($tmpd) if (defined $pbparallel);
    14331437
     1438    # Do it here as this doesn't work in // mode as itdies if it fails
     1439    if ($pbos->{'type'} eq "rpm") {
     1440        foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
     1441                if (! -d "$ENV{'PBBUILDDIR'}/$d") {
     1442                    pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d");
     1443                }
     1444            }
     1445    }
     1446
    14341447    foreach my $pbpkg (@pkgs) {
    14351448        $pm->start and next if (defined $pbparallel);
     
    14471460        pb_log(2,"Working directory: $ENV{'PBBUILDDIR'}\n");
    14481461        if ($pbos->{'type'} eq "rpm") {
    1449             foreach my $d ('RPMS','SRPMS','SPECS','SOURCES','BUILD') {
    1450                 if (! -d "$ENV{'PBBUILDDIR'}/$d") {
    1451                     pb_mkdir_p("$ENV{'PBBUILDDIR'}/$d");
    1452                 }
    1453             }
    1454 
    14551462            # Remove in case a previous link/file was there
    14561463            unlink "$ENV{'PBBUILDDIR'}/SOURCES/".basename($src);
     
    15481555            #pb_extract_build_files($src2,"$pbpkg-$pbver$pbextdir/pbconf/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}/pbsrc/","$ENV{'PBBUILDDIR'}/debian","src");
    15491556
     1557            # This can create problems in // mode as well
    15501558            pb_distro_installdeps("debian/control",$pbos);
    15511559            pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package","verbose");
     1560
    15521561            # Get the name of the generated packages
    15531562            open(LOG,"$ENV{'PBTMP'}/system.$$.log") || die "Unable to open $ENV{'PBTMP'}/system.$$.log";
    1554             my $tmp = "";
    15551563            while (<LOG>) {
    15561564                chomp();
     1565                pb_log(3,"In loop: $_\n");
    15571566                next unless (/^dpkg-deb.*:\s+building\s+package\s+.*\s+in\s+\`\.\.\/(\S+)\'\./o);
    1558                 $tmp = $1;
    1559                 die "Missing file $tmp" if (not -f $tmp);
     1567                my $tmp = $1;
     1568                #doesn't work in my case
     1569                #die "Missing file $tmp" if (not -f "../$tmp");
    15601570                $made = "$made $tmp";
    15611571            }
    15621572            close(LOG);
    1563             open(CTRL,"debian/control") or die "Unable to open debian/control: $!";
    1564             #$made="$made $tmp.dsc $tmp.tar.gz $tmp"."_*.deb $tmp"."_*.changes";
     1573            pb_log(2,"Now made is: $made\n");
     1574
     1575            open(CTRL,"debian/control") || die "Unable to open debian/control: $!";
    15651576            while (<CTRL>) {
     1577                pb_log(3,"In loop: $_\n");
    15661578                next unless (/^Source: (\S+)/o);
    1567                 foreach my $glob (("$1\_*.changes", "$1\_*.dsc", "$1\_*.tar.gz")) {
    1568                     my @file = glob($glob);
    1569                     die "Missing file for $glob" unless @file > 0;
    1570                     die "Too many files for $glob" if @file > 1;
    1571                     die "Missing file $file[0]" if (not -f $file[0]);
    1572                     $made .= " $file[0]";
    1573                 }
     1579                my $tmp = $1;
     1580                $made = "$made $tmp"."_*.dsc $tmp"."_*.tar.gz $tmp"."_*.deb $tmp"."_*.changes";
     1581                #doesn't work in my case
     1582                #foreach my $glob (("$1\_*.changes", "$1\_*.dsc", "$1\_*.tar.gz")) {
     1583                    #my @file = glob($glob);
     1584                    #die "Missing file for $glob" unless (@file > 0);
     1585                    #die "Too many files for $glob" if (@file > 1);
     1586                    #die "Missing file $file[0]" if (not -f $file[0]);
     1587                    #$made .= " $file[0]";
     1588                #}
    15741589            }
    15751590            close(CTRL);
    1576             pb_display_file("$ENV{'PBTMP'}/system.$$.log");
     1591            #pb_display_file("$ENV{'PBTMP'}/system.$$.log");
     1592            pb_log(2,"Finally made is: $made\n");
    15771593
    15781594            chdir ".." || die "Unable to chdir to parent dir";
    1579             pb_rm_rf("$pbpkg-$pbver");
     1595            pb_rm_rf("$pbpkg-$pbver$pbextdir");
    15801596        } elsif ($pbos->{'type'} eq "ebuild") {
    15811597            my @ebuildfile;
     
    23452361        # For VE we need to change the owner manually
    23462362        if ($cmt eq "VEbuild") {
    2347             pb_system("sudo chown $UID $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$","Adapt owner in $tdir to $UID");
     2363            my $command = pb_check_req("chown",0);
     2364            pb_system("sudo $command $UID $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$","Adapt owner in $tdir to $UID");
    23482365        }
    23492366        if (not -f "$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") {
     
    27332750        $i++;
    27342751    }
    2735     print SCRIPT "set -e\n" if $Global::pb_stop_on_error;
     2752    print SCRIPT "set -e\n" if ($Global::pb_stop_on_error);
    27362753    # Activate script verbosity if at least 2 for pbdebug
    27372754    print SCRIPT "set -x\n" if ($i gt 1);
  • devel/pb/t/pbtest

    r1596 r1597  
    1212
    1313# You may have multiple distros here
    14 TESTVEDIST="fedora-16-x86_64 mageia-1-i386 debian-6.0-x86_64 ubuntu-12.04-i386"
     14TESTVEDIST="debian-6-x86_64 ubuntu-12.04-i386 fedora-16-x86_64 opensuse-12.1-x86_64 mageia-2-i386 mandriva-2010.0-i386"
    1515# Only one VM is tested for now.
    1616TESTVMDIST="fedora-16-i386"
    1717TESTVMISO="/users/bruno/iso/Fedora-16-i386-DVD.iso"
    18 PBTEST="/home/pbtest"
     18PBUSER=pbtest
     19PBTEST="/home/$PBUSER"
    1920export PBPROJ=afio
    2021
     
    2728
    2829if [ _"$cmd" == _"/tmp/pbtestcmd" ]; then
    29     echo "INFO (as pbtest): Now running `head -1 $cmd` [$msg]"
     30    echo "INFO (as $PBUSER): Now running `head -1 $cmd` [$msg]"
    3031else
    31     echo "INFO (as pbtest): Now running $cmd [$msg]"
    32 fi
    33 sudo -n -E su - pbtest -c "$cmd"
     32    echo "INFO (as $PBUSER): Now running $cmd [$msg]"
     33fi
     34sudo -n -E su - $PBUSER -c "$cmd"
    3435ret=$?
    3536if [ $ret -ne 0 ] && [ _"$msg" == _"" ]; then
     
    5758
    5859sudocmd "rm -rf $PBTEST/* $PBTEST/.??*"
    59 sudocmd "killall -u pbtest"
    60 sudocmd "userdel pbtest"
    61 #sudocmd "groupdel pbtest" 1
    62 sudocmd "useradd pbtest"
    63 sudocmd "grep -q pbtest /etc/sudoers"
     60sudocmd "killall -u $PBUSER"
     61sudocmd "userdel $PBUSER"
     62#sudocmd "groupdel $PBUSER" 1
     63sudocmd "useradd $PBUSER"
     64sudocmd "grep -q $PBUSER /etc/sudoers"
    6465if [ $? -ne 0 ]; then
    6566    cat > /tmp/sudoers << EOF
    6667Defaults env_keep += "PBPROJ"
    67 # This is for the pbtest account in the VE only
    68 pbtest ALL=NOPASSWD:/usr/sbin/chroot
    69 pbtest ALL=NOPASSWD:/usr/bin/rpmbootstrap
    70 pbtest ALL=NOPASSWD:/usr/sbin/debootstrap
    71 pbtest ALL=NOPASSWD:/bin/chmod
    72 pbtest ALL=NOPASSWD:/bin/cp
    73 pbtest ALL=NOPASSWD:/bin/rm
    74 pbtest ALL=NOPASSWD:/bin/tar
    75 pbtest ALL=NOPASSWD:/bin/mkdir
     68# This is for the $PBUSER account in the VE only
     69$PBUSER ALL=NOPASSWD:/usr/sbin/chroot
     70$PBUSER ALL=NOPASSWD:/usr/bin/rpmbootstrap
     71$PBUSER ALL=NOPASSWD:/usr/sbin/debootstrap
     72$PBUSER ALL=NOPASSWD:/bin/chmod
     73$PBUSER ALL=NOPASSWD:/bin/cp
     74$PBUSER ALL=NOPASSWD:/bin/rm
     75$PBUSER ALL=NOPASSWD:/bin/tar
     76$PBUSER ALL=NOPASSWD:/bin/mkdir
     77$PBUSER ALL=NOPASSWD:/bin/chown
    7678EOF
    7779    sudocmd "cat /etc/sudoers /tmp/sudoers > /tmp/sudoers2"
     
    8183    rm -f /tmp/sudoers /tmp/sudoers2
    8284fi
    83 # Force pbtest account
    84 sudocmd "perl -pi -e 's|^pbtest:.*|pbtest:$2a$08$2Q.tEty4v/fU0RyPeDelk.AjLAtXUXU3DpSs/l/8YrFmau1LJRCqC:15483:0:99999:7:::|' /etc/shadow"
     85# Force $PBUSER account passwd is $PBUSER
     86sudocmd "perl -pi -e 's|^$PBUSER:.*|$PBUSER:$2a$08$2Q.tEty4v/fU0RyPeDelk.AjLAtXUXU3DpSs/l/8YrFmau1LJRCqC:15483:0:99999:7:::|' /etc/shadow"
    8587sudopbtest "echo export PBPROJ=$PBPROJ >> $PBTEST/.bash_profile"
    8688sudopbtest "env | grep PBPROJ"
     
    9193cat > /tmp/authz << EOF
    9294[/]
    93 pbtest = rw
     95$PBUSER = rw
    9496* = r
    9597EOF
     
    9799cat > /tmp/passwd << EOF
    98100[users]
    99 pbtest = pbtest
     101$PBUSER = $PBUSER
    100102EOF
    101103sudocmd "mv /tmp/passwd $PBTEST/svn/conf/passwd"
     
    109111EOF
    110112sudocmd "mv /tmp/svnserve.conf $PBTEST/svn/conf/svnserve.conf"
    111 sudocmd "chown pbtest:pbtest $PBTEST/svn/conf/authz $PBTEST/svn/conf/passwd $PBTEST/svn/conf/svnserve.conf"
     113sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/svn/conf/authz $PBTEST/svn/conf/passwd $PBTEST/svn/conf/svnserve.conf"
    112114sudopbtest "killall svnserve" 1
    113115sudopbtest "svnserve -d -r $PBTEST/svn"
     
    128130pburl mondorescue = svn://svn.mondorescue.org/mondorescue/branches
    129131sshhost pb = localhost
    130 sshlogin pb = pbtest
     132sshlogin pb = $PBUSER
    131133sshdir pb = \$ENV{'HOME'}/ftp
    132134#
     
    155157veopt default =
    156158vesnap default = false
    157 velogin default = pbtest
     159velogin default = $PBUSER
    158160EOF
    159161echo "velist default = `echo $TESTVEDIST | sed 's/ /,/g'`" >> /tmp/.pbrc
    160162sudocmd "mv /tmp/.pbrc $PBTEST/ve/.pbrc"
    161 sudocmd "chown pbtest:pbtest $PBTEST/.pbrc $PBTEST/ve/.pbrc $PBTEST/vm/.pbrc"
     163sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/.pbrc $PBTEST/ve/.pbrc $PBTEST/vm/.pbrc"
    162164
    163165sudopbtest "ssh-keygen -f $PBTEST/.ssh/id_rsa -t rsa -b 768 -v -N ''"
     
    175177EOF
    176178sudocmd "mv /tmp/servers $PBTEST/.subversion/servers"
    177 sudocmd "chown pbtest:pbtest $PBTEST/.subversion/servers"
    178 
    179 VCSOPT='--username pbtest --password pbtest'
     179sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/.subversion/servers"
     180
     181VCSOPT='--username $PBUSER --password $PBUSER'
    180182
    181183sudopbtest "svn import $PBTEST/pb svn://localhost/pb -m 'Initial creation of pb repo' $VCSOPT"
     
    194196pbrepo afio = ftp://ftp.project-builder.org
    195197sshhost afio = localhost
    196 sshlogin afio = pbtest
     198sshlogin afio = $PBUSER
    197199sshdir afio = \$ENV{'HOME'}/ftp
    198200EOF
    199201sudocmd "mv /tmp/afio.pb $PBTEST/pb/afio/pbconf/2.5/afio.pb"
    200 sudocmd "chown pbtest:pbtest $PBTEST/pb/afio/pbconf/2.5/afio.pb"
     202sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/afio.pb"
    201203cat > /tmp/pbtestcmd << EOF
    202204perl -pi -e 's|testver\s+afio\s+=\s+true|testver\ afio\ =\ false|' $PBTEST/pb/afio/pbconf/2.5/afio.pb
     
    214216EOF
    215217sudocmd "mv /tmp/all.pbf $PBTEST/pb/afio/pbconf/2.5/pbfilter/all.pbf"
    216 sudocmd "chown pbtest:pbtest $PBTEST/pb/afio/pbconf/2.5/pbfilter/all.pbf"
     218sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/pbfilter/all.pbf"
    217219
    218220grep -vE 'PBGRP|PBLIC' $PBTEST/pb/afio/pbconf/2.5/pbfilter/rpm.pbf > /tmp/rpm.pbf
     
    223225EOF
    224226sudocmd "mv /tmp/rpm.pbf $PBTEST/pb/afio/pbconf/2.5/pbfilter/rpm.pbf"
    225 sudocmd "chown pbtest:pbtest $PBTEST/pb/afio/pbconf/2.5/pbfilter/rpm.pbf "
     227sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/pbfilter/rpm.pbf "
     228
     229cat >> /tmp/deb.pbf << EOF
     230filter PBGRP = utils
     231filter PBLIC = Afio
     232EOF
     233sudocmd "mv /tmp/deb.pbf $PBTEST/pb/afio/pbconf/2.5/pbfilter/deb.pbf"
     234sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/pbfilter/rpm.pbf "
    226235
    227236# First build
     
    249258EOF
    250259sudocmd "mv /tmp/pbcl $PBTEST/pb/afio/pbconf/2.5/afio/pbcl"
    251 sudocmd "chown pbtest:pbtest $PBTEST/pb/afio/pbconf/2.5/afio/pbcl"
     260sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/afio/pbcl"
    252261sudopbtest "svn add $PBTEST/pb/afio/pbconf/2.5/afio/pbcl"
    253262sudopbtest "svn ci -m 'Adding pbcl for afio' $VCSOPT $PBTEST/pb"
     
    259268# Filtering $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
    260269perl -pi -e 's|,\s*PBDEP||' $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
    261 perl -pi -e 's|Recommends: PBREC||' $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
    262 perl -pi -e 's|Suggests: PBSUG||' $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
     270sed -i '/Recommends: PBREC/d' $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
     271sed -i '/Suggests: PBSUG/d' $PBTEST/pb/afio/pbconf/2.5/afio/deb/control
    263272EOF
    264273chmod 755 /tmp/pbtestcmd
     
    279288EOF
    280289sudocmd "mv /tmp/afio.docs $PBTEST/pb/afio/pbconf/2.5/afio/deb/afio.docs"
    281 sudocmd "chown pbtest:pbtest $PBTEST/pb/afio/pbconf/2.5/afio/deb/afio.docs "
     290sudocmd "chown ${PBUSER}:$PBUSER $PBTEST/pb/afio/pbconf/2.5/afio/deb/afio.docs "
    282291
    283292cat > /tmp/pbtestcmd << EOF
     
    285294perl -pi -e 's|config.status: configure|config.status: Makefile|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
    286295perl -pi -e 's|dh_installchangelogs ChangeLog|dh_installchangelogs debian/changelog|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
    287 perl -pi -e 's|\$(MAKE) install|mkdir -p \$(CURDIR)/debian/\$(PACKAGE_NAME)/usr/bin \$(CURDIR)/debian/\$(PACKAGE_NAME)/usr/share/man/man1|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
    288 perl -pi -e 's|# - copy html manual to temporary location for renaming|install -p -m 755 afio \$(CURDIR)/debian/\$(PACKAGE_NAME)/usr/bin ; install -p -m 644 afio.1 \$(CURDIR)/debian/\$(PACKAGE_NAME)/usr/share/man/man1|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
     296perl -pi -e 's|\\\$(MAKE) install.*|mkdir -p \\\$(CURDIR)/debian/\\\$(PACKAGE_NAME)/usr/bin \\\$(CURDIR)/debian/\\\$(PACKAGE_NAME)/usr/share/man/man1|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
     297perl -pi -e 's|# - copy html manual to temporary location for renaming|install -p -m 755 afio \\\$(CURDIR)/debian/\\\$(PACKAGE_NAME)/usr/bin ; install -p -m 644 afio.1 \\\$(CURDIR)/debian/\\\$(PACKAGE_NAME)/usr/share/man/man1|' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
    289298sed -i -e '/\.\/configure /d' $PBTEST/pb/afio/pbconf/2.5/afio/deb/rules
    290299EOF
     
    312321    vv=`echo $d | cut -d'-' -f2`
    313322    aa=`echo $d | cut -d'-' -f3`
    314     if [ -f $PBTEST/ve/$dd/$vv/$aa/proc/cpuinfo ]; then
     323    if [ -f "$PBTEST/ve/$dd/$vv/$aa/proc/cpuinfo" ]; then
    315324        sudocmd "umount $PBTEST/ve/$dd/$vv/$aa/proc"
    316325    fi
     
    323332sudopbtest "pb clean"
    324333
    325 
    326 
    327 #qemu-kvm \
    328 #-m 1024 \
    329 #-kernel /pub/mageia/distrib/cauldron/i586/isolinux/alt0/vmlinuz \
    330 #-initrd /pub/mageia/distrib/cauldron/i586/isolinux/alt0/all.rdz \
    331 #-append "ramdisk_size=128000 root=/dev/ram3 kickstart=http://192.168.8.55/pub/ks/guerrero/ks.pl automatic=method:http,server:192.168.8.55,directory:/pub/mageia/distrib/cauldron/i586,network:dhcp" \
    332 #-drive file=/users/qemu/mageia-2-i386.qemu,if=virtio,media=disk \
    333 #-redir tcp:2200:10.0.2.15:22
     334# need tobe part of group video for KVM
     335sudocmd "grep -q $PBUSER /etc/group"
     336if [ $? -ne 0 ]; then
     337    sudocmd "perl -pi -e 's|^(video:.*)$|$1,|' /etc/shadow"
     338fi
     339d=mageia-2-i386
     340sudopbtest "qemu-img create -f qcow2 $PBTEST/vm/$d.qemu 72G"
     341sudopbtest "qemu-kvm -m 1024 -kernel /pub/mageia/distrib/2/i586/isolinux/alt0/vmlinuz -initrd /pub/mageia/distrib/2/i586/isolinux/alt0/all.rdz -append "ramdisk_size=128000 root=/dev/ram3 kickstart=http://192.168.8.55/pub/ks/guerrero/ks.pl automatic=method:http,server:192.168.8.55,directory:/pub/mageia/distrib/2/i586,network:dhcp" -drive file=$PBTEST/vm/$d.qemu,if=virtio,media=disk -redir tcp:2200:10.0.2.15:22"
     342sudopbtest "pb -p pb -m $d sbx2setupvm"
     343sudopbtest "pb -p pb -m $d snapvm"
     344sudopbtest "pb -m $d sbx2vm"
     345
    334346
    335347# test also with MOndoRescue
Note: See TracChangeset for help on using the changeset viewer.