Changeset 1352 in ProjectBuilder


Ignore:
Timestamp:
Oct 30, 2011, 10:36:43 AM (12 years ago)
Author:
Bruno Cornec
Message:

r4384@localhost: bruno | 2011-10-30 01:28:14 +0200

  • Change pb_ve_launch interface (remove useless second parameter)
  • Force call to pb_ve_launch with pbforce to always create the chroot in pbmkbm
Location:
devel
Files:
4 edited

Legend:

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

    r1350 r1352  
    364364#
    365365mkbmpath default = /var/cache/pbmkbm
    366 vetype pbmkpb = chroot
     366vetype pbmkbm = chroot
     367verpmtype pbmkbm = rpmbootstrap
     368vedebtype pbmkbm = debbootstrap
    367369
    368370# pb install dependencies per distro
  • devel/pb-modules/lib/ProjectBuilder/VE.pm

    r1350 r1352  
    6262
    6363my $v = shift || undef;
    64 my $create = shift || 0;        # By default do not create a VM/VE/RM
    6564my $pbforce = shift || 0;       # By default do not rebuild VE
    6665my $pbsnap = shift || 0;        # By default do not snap VE
     
    7372my $vetype = $ptr->{$ENV{'PBPROJ'}};
    7473
    75 # We can probably only get those params now we have the distro context
    76 my ($rbsb4pi,$rbspi,$vesnap,$oscodename,$osmindep,$verebuild,$rbsmirrorsrv) = pb_conf_get_if("rbsb4pi","rbspi","vesnap","oscodename","osmindep","verebuild","rbsmirrorsrv");
    77 
    78 # We need to avoid umask propagation to the VE
    79 umask 0022;
    80 
    81 # If we are already root (from pbmkbm e.g.) don't use sudo, just call the command
    82 my $sudocmd="";
    83 $sudocmd ="sudo " if ($EFFECTIVE_USER_ID != 0);
    84 
    85 my $arch = pb_get_arch();
    86 
    8774if (($vetype eq "chroot") || ($vetype eq "schroot")) {
     75
     76    # We need to avoid umask propagation to the VE
     77    umask 0022;
     78
     79    # We can probably only get those params now we have the distro context
     80    my ($rbsb4pi,$rbspi,$vesnap,$oscodename,$osmindep,$verebuild,$rbsmirrorsrv) = pb_conf_get_if("rbsb4pi","rbspi","vesnap","oscodename","osmindep","verebuild","rbsmirrorsrv");
     81
    8882    # Architecture consistency
     83    my $arch = pb_get_arch();
    8984    if ($arch ne $pbos->{'arch'}) {
    9085        die "Unable to launch a VE of architecture $pbos->{'arch'} on a $arch platform" if (($pbos->{'arch'} eq "x86_64") && ($arch =~ /i?86/));
    9186    }
    9287
    93     my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
    94     if (($create != 0) || ((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 1)) {
    95     my ($rbsopt1) = pb_conf_get_if("rbsopt");
     88    # If we are already root (from pbmkbm e.g.) don't use sudo, just call the command
     89    my $sudocmd="";
     90    $sudocmd ="sudo " if ($EFFECTIVE_USER_ID != 0);
     91
     92    if (((defined $verebuild) && ($verebuild->{$ENV{'PBPROJ'}} =~ /true/i)) || ($pbforce == 1)) {
     93        my ($verpmtype,$vedebtype) = pb_conf_get("verpmtype","vedebtype");
     94        my ($rbsopt1) = pb_conf_get_if("rbsopt");
    9695
    9796        # We have to rebuild the chroot
  • devel/pb/bin/pb

    r1350 r1352  
    22082208        return($vmexist,$vmpid);
    22092209    } elsif ($vtype eq "ve") {
    2210         pb_ve_launch($v,$create,$pbforce,$pbsnap);
     2210        pb_ve_launch($v,$pbforce,$pbsnap);
    22112211    } else {
    22122212        # RM here
  • devel/pbmkbm/bin/pbmkbm

    r1350 r1352  
    296296if ($opts{'b'} eq "ve") {
    297297    # Use existing tools to create a good VE !
    298     pb_ve_launch($ENV{'PBV'});
     298    pb_ve_launch($ENV{'PBV'},1);
    299299} elsif ($opts{'b'} eq "native") {
    300300    # Use native tools to create a good VE !
     
    302302    die "Unknown method $opts{'b'} used to create the media content";
    303303}
     304
     305# Once the environment is made, add what is needed for this boot media to it.
    304306}
    305307
     
    310312# Get the package list to download, store them in a cache directory
    311313#
    312 my ($mkbmcachedir) = pb_conf_get_if("mkbmcachedir");
    313 my ($pkgs) = pb_distro_get_param($pbos,pb_conf_get("mkbmmindep"));
     314#my ($mkbmcachedir) = pb_conf_get_if("mkbmcachedir");
     315#my ($pkgs) = pb_distro_get_param($pbos,pb_conf_get("mkbmmindep"));
    314316
    315317#
    316318# /proc needed
    317319#
    318 pb_system("mount -o bind /proc $targetdir/proc","Mounting /proc");
     320#pb_system("mount -o bind /proc $targetdir/proc","Mounting /proc");
    319321
    320322# Installed additional packages we were asked to
    321 if (defined $opts{'a'}) {
    322     $opts{'a'} =~ s/,/ /g;
    323     pb_system("chroot $targetdir /bin/bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}");
    324 }
     323#if (defined $opts{'a'}) {
     324#$opts{'a'} =~ s/,/ /g;
     325#pb_system("chroot $targetdir /bin/bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}");
     326#}
    325327
    326328#
    327329# Clean up
    328330#
    329 pb_log(1,"Cleaning up\n");
    330 pb_system("umount $targetdir/proc","Unmounting /proc");
     331#pb_log(1,"Cleaning up\n");
     332#pb_system("umount $targetdir/proc","Unmounting /proc");
    331333
    332334# Executes post-install step if asked for
    333 if ($opts{'s'}) {
    334     pb_system("$opts{'s'} $targetdir","Executing the post-install script: $opts{'s'} $targetdir");
    335 }
     335#if ($opts{'s'}) {
     336#pb_system("$opts{'s'} $targetdir","Executing the post-install script: $opts{'s'} $targetdir");
     337#}
Note: See TracChangeset for help on using the changeset viewer.