aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnne Nicolas <ennael@mandriva.org>2010-08-12 12:18:03 +0000
committerAnne Nicolas <ennael@mandriva.org>2010-08-12 12:18:03 +0000
commitcfb91415e66387f22ea80954f8b6be86f6f96bd2 (patch)
tree882dd92d11486613def34c43a575509feb2be5e7
parentf72daba53a0449a5889d63b59850c5997a24768b (diff)
downloadbcd-cfb91415e66387f22ea80954f8b6be86f6f96bd2.tar
bcd-cfb91415e66387f22ea80954f8b6be86f6f96bd2.tar.gz
bcd-cfb91415e66387f22ea80954f8b6be86f6f96bd2.tar.bz2
bcd-cfb91415e66387f22ea80954f8b6be86f6f96bd2.tar.xz
bcd-cfb91415e66387f22ea80954f8b6be86f6f96bd2.zip
add files for mes5 bcd
-rw-r--r--BCD/Bcd.pm94
-rw-r--r--BCD/Common.pm111
-rw-r--r--BCD/Genisoimage.pm122
-rw-r--r--BCD/Isolinux.pm101
-rw-r--r--BCD/Media.pm931
-rw-r--r--BCD/Media.pm.good851
-rw-r--r--BCD/Resign.pm56
-rw-r--r--BCD/Stagex.pm76
-rwxr-xr-xbcd.pl9
-rw-r--r--bcd.pod386
-rw-r--r--bcd.xml183
-rwxr-xr-xcompare_idx_32_64_dual.sh12
-rwxr-xr-xcreate_dual.sh76
-rwxr-xr-xcreate_dvd.sh28
-rw-r--r--dual.xml136
-rw-r--r--dual64.xml133
16 files changed, 3305 insertions, 0 deletions
diff --git a/BCD/Bcd.pm b/BCD/Bcd.pm
new file mode 100644
index 0000000..3987c9a
--- /dev/null
+++ b/BCD/Bcd.pm
@@ -0,0 +1,94 @@
+package BCD::Bcd;
+
+use strict;
+use XML::Simple;
+use Data::Dumper;
+use Pod::Usage;
+use MDK::Common;
+
+use BCD::Common qw(:DEFAULT $wd $isoconf $name $arch $version $isodir $builddir $error_color $dir_deps);
+use BCD::Genisoimage;
+use BCD::Isolinux;
+use BCD::Stagex;
+use BCD::Media;
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_bcd);
+our $conf_file;
+my $color = "cyan";
+
+sub print_info() {
+ print Dumper($isoconf);
+}
+
+sub help_bcd {
+ pod2usage('-verbose' => 2, '-input' => "bcd.pod", '-pathlist' => @INC);
+}
+
+sub do_all {
+ my ($option) = @_;
+ clean_all;
+ check_dir;
+ main_isolinux;
+ main_stagex;
+ main_media($option);
+ main_iso($option);
+ show_info();
+}
+
+sub show_info {
+ print "\n";
+ print "ISO dir: $isodir\n";
+ print "build dir: $builddir\n";
+ print "LOG of media: /tmp/$name-$version-$arch\n";
+ print "stored URPMQ result: /var/lib/bcd/$name-$version-$arch\n";
+ print "\n";
+}
+
+sub main_bcd() {
+ my %opts = (
+ '' => \&help_bcd,
+ info => \&print_info,
+ iso => \&main_iso,
+ md5 => \&create_md5,
+ stagex => \&main_stagex,
+ isolinux => \&main_isolinux,
+ media => \&main_media,
+ gendistrib => \&use_gendistrib,
+ clean => \&clean_all,
+ list => \&list_media,
+ mediarepo => \&list_medias_available,
+ checkrepo => \&check_repo_hdlist,
+ rpmcheck => \&rpmcheck_launch,
+ doble => \&solve_doble_issue,
+ resign => \&resign_media,
+ all => \&do_all,
+ );
+
+
+
+ if (! -d $dir_deps) {
+ print_color(" I will create $dir_deps to store all urpmq queries", $error_color);
+ print_color(" Please give full access RW to your current user to this directory", $color);
+ mkdir_p($dir_deps);
+ }
+ print_color("-- If you don't want to use previous urpmq query:\n ++ remove the directory $dir_deps\n ++ or remove the file wich contains the urpmq result for the package to redo an another one (ie: the file $dir_deps/tocopy_plop_todo_Main-drakconf)", $color);
+ $ARGV[0] or help_bcd;
+ -f $ARGV[0] or die "Cant acces to conf file $ARGV[0]\n";
+ if (my $f = $opts{$ARGV[1]}) {
+ if ($ARGV[2]) {
+ my $options;
+ foreach my $arg (2 .. $#ARGV) {
+ $arg and $options = $options . ' ' . $ARGV[$arg];
+ }
+ $f->($options);
+ } else {
+ $f->();
+ }
+ } else {
+ print_color(" ** Dont know what todo ** \n unknow option", $error_color);
+ }
+}
+
+
+1;
diff --git a/BCD/Common.pm b/BCD/Common.pm
new file mode 100644
index 0000000..b23cbd8
--- /dev/null
+++ b/BCD/Common.pm
@@ -0,0 +1,111 @@
+package BCD::Common;
+
+use strict;
+use XML::Simple;
+use MDK::Common;
+use Term::ANSIColor;
+use File::Copy::Recursive qw(dircopy pathrm);
+use File::Glob ':glob';
+
+use BCD::Bcd qw(:DEFAULT);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(create_needed_dir check_dir clean_all print_color);
+# export all needed var
+our @EXPORT_OK = qw($isoconf $wd $name $arch $file $based_on $version $repo $isodir $builddir $distrib_path $error_color $DISTRIB $THEME $tmp_rpmsrate $NB_FORK $dir_deps);
+
+my $LOG="COMMON -";
+my $color = "red";
+
+
+my $conf_file = $ARGV[0];
+our $isoconf = XMLin($conf_file, keyattr => ['']);
+
+our $DISTRIB = $isoconf->{theme}{name};
+our $THEME = $isoconf->{theme}{theme};
+our $name = $isoconf->{nameid};
+our $NB_FORK = $isoconf->{nb_fork};
+our $wd = $isoconf->{workdir}{path};
+our $arch = $isoconf->{arch};
+our $version = $isoconf->{mediainfo}{version};
+our $repo = $isoconf->{repo}{path};
+our $based_on = $isoconf->{based_on};
+
+$ARGV[0] or print_color("You must define wich XML file to use!\n'man bcd' and man 'conf.xml', and read the full documentation in pdf format available in the /usr/share/doc/bcd dir",$color) and exit 1;
+$DISTRIB or print_color("You must define the <theme><name> tag",$color) and exit 1;
+$THEME or print_color("You must define the <theme><theme> tag",$color) and exit 1;
+$name or print_color("You must define the <namedid> tag",$color) and exit 1;
+$wd or print_color("You must define the <workdir><path> tag",$color) and exit 1;
+$arch or print_color("You must define the <arch> tag",$color) and exit 1;
+$NB_FORK or print_color("You must define the <nb_fork> tag",$color) and exit 1;
+$version or print_color("You must define the <mediainfo><version>", $color) and exit 1;
+$repo or print_color("You must define the <repo><path> tag",$color) and exit 1;
+$based_on or print_color("You must define the <based_on> tag",$color) and exit 1;
+
+# password file
+#"/home/plop/.signature.gpg";
+my $pwd_file = $isoconf->{signature};
+#"/home/plop/.rpmrc";
+my $rpmrc = $isoconf->{rpmrc};
+
+# where to store urpmq queries results
+our $dir_deps = "/var/lib/bcd/$name-$version-$arch";
+our $builddir = "$wd/$isoconf->{iso}{genisoimage}{builddir}/$name-$version-$arch/$arch";
+our $isodir = "$wd/$isoconf->{iso}{genisoimage}{isodir}/$name-$version-$arch";
+# distrib path in chroot (mounted loop)
+our $distrib_path = "/tmp/distrib";
+our $tmp_rpmsrate = "/tmp/rpmsrate_$name-$version-$arch";
+our $error_color = "blue on_magenta";
+
+sub print_color {
+ my ($text, $color) = @_;
+ print color $color;
+ print "$text\n";
+ print color 'reset';
+
+}
+
+sub create_needed_dir {
+ my ($dir) = @_;
+ # create needed dir to create the build tree, and to store the ISO
+ if (! -d $dir) {
+ #mkdir $dir, 0755;
+ print_color("$LOG creation of $dir", $color);
+ mkdir_p($dir);
+ } else {
+ print_color("$LOG $dir already exist", $color);
+ }
+}
+
+sub check_dir {
+ create_needed_dir($builddir);
+ create_needed_dir("$builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+ create_needed_dir($isodir);
+ create_needed_dir("/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}");
+}
+
+sub clean_all {
+ my @l = glob("/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}/$distrib_path/*");
+ foreach (@l) {
+ $_ or next;
+ if (-f "$_" || -d "$_") {
+ print_color("Distribution repositery already mounted exiting !\n Check /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}/$distrib_path directory", $color);
+ print_color("sudo umount /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}$distrib_path", $error_color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ $media->{external}{name} and print_color("You should check also umount the external media /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}/tmp/$media->{external}{name}\nsudo umount /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}/tmp/$media->{external}{name}", $error_color);
+ }
+ print_color("WARNING: if you didnt umount repositery or external media you can erase them unless they are mounted bind in RO mode.", $color);
+ exit 1;
+ }
+ }
+ print_color("$LOG rmdir /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}", $color);
+ system("sudo rm -rf /tmp/$isoconf->{nameid}-$version-$isoconf->{arch}");
+ print_color("$LOG rmdir $builddir", $color);
+ #pathrm("$wd/$isoconf->{iso}{genisoimage}{builddir}/$name/$arch") or die $!;
+ -d $builddir and system("rm -rf $builddir");
+ print_color("$LOG rmdir $isodir", $color);
+ #pathrm("$wd/$isoconf->{iso}{genisoimage}{isodir}/$name/$arch") or die $!;
+ -d $isodir and system("rm -rf $isodir");
+}
+1;
diff --git a/BCD/Genisoimage.pm b/BCD/Genisoimage.pm
new file mode 100644
index 0000000..9a7ab57
--- /dev/null
+++ b/BCD/Genisoimage.pm
@@ -0,0 +1,122 @@
+package BCD::Genisoimage;
+
+use strict;
+use XML::Simple;
+use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $version $builddir $isodir $error_color $repo $based_on);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_iso);
+
+my $LOG="GENISOIMAGE -";
+my $color = "green";
+
+# mandriva-linux-free-2009.1-i586
+my $isoname = $isoconf->{nameid} . '-' . $isoconf->{mediainfo}{version} . '-' . $isoconf->{arch};
+
+# genisoimage -f -sort /home/plop/tmp/build/2009.1/11.sort -r -J -hide-rr-moved -nobak -cache-inodes -A "Mandriva Linux - 2009 Spring (Free64)" -publisher "Mandriva" -sysid "Mandriva Linux" -p "Mandriva-Linux" -volset "Mandriva Linux - 2009 Spring (Free64) - DVD x86_64 [1/1]" -V "Free-20091-x86_64" -o /home/plop/iso/2009.1/11-2009.1.iso -b x86_64/isolinux/isolinux.bin -c x86_64/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "/home/plop/build/2009.1/first/11" /home/plop/build/2009.1/11
+
+
+sub create_version {
+ # create the VERSION file available on the base of the ISO
+ my $version_file = "$builddir/VERSION";
+ print_color("$LOG create the $version_file file", $color);
+ open my $VERSION, ">$version_file";
+ my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime(time());
+ $year += 1900;
+ my $tag = $isoconf->{iso}{tag};
+ my $product = $isoconf->{iso}{product};
+ my $publisher = $isoconf->{iso}{header}{publisherid};
+ printf $VERSION "$publisher $name $tag %04d%02d%02d $hour:%02d\n", $year, $mon+1, $mday, $min;
+ close $VERSION;
+}
+
+sub create_productid {
+ # vendor=Mandriva,distribution=Mandriva Linux,type=basic,version=2009.1,branch=cooker,release=0.1,arch=i586,product=maratangua
+ print_color("$LOG create the $builddir/product.id", $color);
+ my $productid_file = "$builddir/product.id";
+ open my $product_id, ">$productid_file";
+ print $product_id "vendor=$isoconf->{iso}{header}{publisherid},";
+ print $product_id "distribution=$isoconf->{iso}{header}{systemid},";
+ print $product_id "type=$isoconf->{iso}{type},";
+ print $product_id "version=$version,";
+ print $product_id "branch=$isoconf->{iso}{branch},";
+ print $product_id "release=$isoconf->{iso}{minor}.$isoconf->{iso}{subversion},";
+ print $product_id "arch=$arch,";
+ print $product_id "product=$isoconf->{iso}{product}";
+ close $product_id;
+}
+
+sub create_idx {
+ print_color("$LOG create the IDX file from $builddir/pkg-$version-$isoconf->{iso}{tag}.idx", $color);
+ # pkg-2009.1-pauillac.idx
+ system("find $builddir -name \*.rpm | awk -F 'media' {'print \"$isoconf->{iso}{header}{volumeid} \" \$2'} | sed -e 's/\.rpm\$//g' | sort > $builddir/pkg-$version-$isoconf->{iso}{tag}.idx");
+ system("cp -v $builddir/pkg-$version-$isoconf->{iso}{tag}.idx $isodir/$isoname.idx");
+}
+
+sub create_iso {
+ # build the ISO with all args
+ print_color("$LOG Building the ISO", $color);
+ my $cmd = "genisoimage $isoconf->{iso}{genisoimage}{options} \\
+-A '$isoconf->{iso}{header}{applicationid}' \\
+-publisher '$isoconf->{iso}{header}{publisherid}' \\
+-sysid '$isoconf->{iso}{header}{systemid}' \\
+-p '$isoconf->{iso}{header}{datapreparer}' \\
+-volset '$isoconf->{iso}{header}{volumesetid}' \\
+-V '$isoconf->{iso}{header}{volumeid}' \\
+-o '$isodir/$isoname.iso' \\
+-b $arch/isolinux/isolinux.bin \\
+-boot-info-table \\
+$builddir/../
+";
+#-quiet \\
+ print_color("\n------------\n $cmd", $color);
+ system($cmd);
+ system("du -h $isodir/$isoname.iso");
+ system("du -sh $builddir/install");
+
+}
+
+sub create_md5 {
+ # create the MD5 of the ISO
+ print_color("$LOG Create the MD5 and SHA1 of the ISO", $color);
+ my $ISOFILE = "$isodir/$isoname.iso";
+ if (! -f $ISOFILE) {
+ print_color("$LOG can't find $ISOFILE", $error_color);
+ exit 1;
+ } else {
+ print_color("$LOG do a: md5sum $ISOFILE > $ISOFILE.md5", $color);
+ system("cd $isodir && md5sum $isoname.iso > $ISOFILE.md5 &");
+ print_color("$LOG do a: sha1sum $ISOFILE > $ISOFILE.sha1", $color);
+ system("cd $isodir && sha1sum $isoname.iso > $ISOFILE.sha1 &");
+ }
+}
+
+sub isohybrid {
+ print_color("$LOG isohybrid the ISO", $color);
+ my $ISOFILE = "$isodir/$isoname.iso";
+ system("isohybrid $ISOFILE") == 0 or die "$LOG system isohybrid failed: $?\n";
+}
+
+sub copy_textfiles {
+ map { system("cp -vf $repo/$based_on/$arch/$_ $builddir/");
+ } qw(COPYING INSTALL.txt install.htm LICENSE.txt LICENSE-APPS.txt README.txt index.htm release-notes.html release-notes.txt);
+}
+
+sub main_iso {
+ my ($option) = @_;
+ create_version;
+ create_productid;
+ copy_textfiles;
+ create_idx;
+ if ($option =~ /noiso/) {
+ print_color("$LOG skipping ISO creation", $color);
+ } else {
+ create_iso;
+ isohybrid;
+ create_md5;
+ }
+
+}
+
+1;
+
diff --git a/BCD/Isolinux.pm b/BCD/Isolinux.pm
new file mode 100644
index 0000000..e172ef0
--- /dev/null
+++ b/BCD/Isolinux.pm
@@ -0,0 +1,101 @@
+package BCD::Isolinux;
+
+use File::Copy::Recursive qw(dircopy pathrm);
+use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $version $based_on $repo $builddir);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_isolinux);
+
+my $LOG="ISOLINUX -";
+my $color = "yellow";
+
+my $repo_isolinux;
+if (!defined($isoconf->{isolinux}{fullpath})) {
+ $repo_isolinux = "$repo/$based_on/$arch/$isoconf->{isolinux}{defaultpath}/";
+} else {
+ $repo_isolinux = $isoconf->{isolinux}{fullpath};
+}
+my $build_isolinux_dir = "$builddir/isolinux";
+
+sub switch_theme {
+ my $theme = $isoconf->{theme}{bootsplash};
+ print_color("$LOG switch to theme $theme", $color);
+ -d "$isoconf->{theme}{bootsplash_path}/themes/$theme" or die "$LOG cant find the gfxboot theme: $isoconf->{theme}{bootsplash_path}/themes/$theme";
+ opendir my $DIR, $build_isolinux_dir or die "$LOG FATAL switch_theme: unable to open $build_isolinux_dir\n";
+ foreach my $f (readdir $DIR) {
+ $f =~ /^\.{1,2}$/ and next;
+ -d "$build_isolinux_dir/$f" or next;
+ opendir my $ALT, "$build_isolinux_dir/$f" or die "LOG FATAL switch_theme: unable to open $dir/$f\n";
+ foreach my $all (readdir $ALT) {
+ $all =~ /all.rdz/ or next;
+ my $initrd = "$build_isolinux_dir/$f/$all";
+ my $binary = "/usr/share/bootsplash/scripts/make-boot-splash-raw";
+ -x $binary or die "$LOG you need $binary which is available in bootsplash >= 3.2.3\n";
+ my $cmd;
+ if ($isoconf->{based_on} gt "2009.1") {
+ $cmd = "$binary $initrd $theme";
+ } else {
+ # old script use a resolution parameter
+ $cmd = "$binary $initrd 800x600 $theme";
+ }
+ print_color("$LOG using $f", $color);
+ system($cmd) == 0 or die "$LOG FATAL switch_theme: config file for $theme may not exist\n";
+ }
+ closedir $ALT;
+ }
+ closedir $DIR;
+ # syslinux
+ my $lilo_sys = "$isoconf->{theme}{bootsplash_path}/themes/$theme/lilo/syslinux";
+ -f $lilo_sys and system("cp -vf $lilo_sys", "$build_isolinux_dir/boot.msg");
+ print_color("$LOG copy $isoconf->{theme}{gfxboot_path}/themes/*.jpg to $build_isolinux_dir/",, $color);
+ system("cp -vf $isoconf->{theme}{gfxboot_path}/themes/$theme/welcome.jpg $build_isolinux_dir/");
+ system("cp -vf $isoconf->{theme}{gfxboot_path}/themes/$theme/back.jpg $build_isolinux_dir/");
+}
+
+sub add_entry {
+ my $syslinuxcfg = "$build_isolinux_dir/isolinux.cfg";
+ -f $syslinuxcfg or die "$LOG can't path $syslinuxcfg";
+ foreach my $syslinux (@{$isoconf->{isolinux}{entry}}) {
+ $syslinux->{name} or next;
+ print_color("$LOG add $syslinux->{name} in $syslinuxcfg", $color);
+ open my $SYS, ">> $syslinuxcfg";
+ print $SYS "label $syslinux->{label}\n";
+ print $SYS " kernel $syslinux->{kernel}\n";
+ print $SYS " append $syslinux->{append}\n";
+ close $SYS;
+ if (-f $syslinux->{bin}) {
+ system("cp -vf $syslinux->{bin} $build_isolinux_dir/");
+ } else {
+ die "$LOG $syslinux->{bin} is not present on the system !\n";
+ }
+ }
+}
+
+sub copy_files {
+ foreach my $file (@{$isoconf->{isolinux}{tocopy}}) {
+ $file->{name} or next;
+ if (-f $file->{file}) {
+ print_color("$LOG copy $file->{file} in $build_isolinux_dir", $color);
+ system("cp -avf $file->{file} $build_isolinux_dir/");
+ } else {
+ die "$LOG $file->{file} is not present on the system !\n";
+ }
+ }
+}
+
+sub main_isolinux {
+ if (! -d $repo_isolinux) {
+ print_color("$LOG I can't find the isolinux dir $repo_isolinux !", $color);
+ exit;
+ }
+ print_color("$LOG Remove old copy of isolinux", $color);
+ pathrm("$build_isolinux_dir/isolinux") or die $!;
+ print_color("$LOG copy $repo_isolinux to $build_isolinux_dir", $color);
+ dircopy($repo_isolinux, $build_isolinux_dir) or die $!;
+ add_entry;
+ copy_files;
+ switch_theme;
+}
+
+1;
+
diff --git a/BCD/Media.pm b/BCD/Media.pm
new file mode 100644
index 0000000..3e9de7b
--- /dev/null
+++ b/BCD/Media.pm
@@ -0,0 +1,931 @@
+package BCD::Media;
+
+use File::Copy::Recursive qw(dircopy pathrm);
+use strict;
+use URPM;
+use File::Copy;
+use File::stat;
+use Data::Dumper;
+use MDK::Common;
+use File::Glob ':glob';
+use Parallel::ForkManager;
+
+use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $version $based_on $repo $builddir $distrib_path $error_color $DISTRIB $THEME $tmp_rpmsrate $NB_FORK $dir_deps);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_media list_media use_gendistrib list_medias_available check_repo_hdlist rpmcheck_launch solve_doble_issue);
+
+my $verbose;
+my $LOG="MEDIA -";
+my $color = "magenta";
+
+# all mounted loop dir to umount
+my @to_umount;
+my @add_media;
+
+my $mediainfo_sourcedir;
+if (defined($isoconf->{mediainfo}{fullpath})) {
+ $mediainfo_sourcedir = $isoconf->{mediainfo}{fullpath};
+} else {
+ $mediainfo_sourcedir = "$repo/$based_on/$arch/$isoconf->{mediainfo}{mediainfo_dir}";
+}
+my $chroot_path = "/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}";
+my $rpmcheck_list_pkg = "/tmp/rpmcheck_list_pkg_to_add_$isoconf->{nameid}-$version-$isoconf->{arch}";
+
+sub create_media {
+ print_color("$LOG Create the media dir in $builddir", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ create_needed_dir("$builddir/media/$media->{destmedia}");
+ }
+}
+
+sub show_size {
+ print_color("$LOG size of the builddir", $color);
+ system("du -sLh $builddir");
+}
+
+sub list_media {
+ print_color("$LOG all media are listed there:", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ print "
+name: $media->{name}
+ desc: $media->{desc}
+ mediadir: $media->{mediadir}
+ destmedia: $media->{destmedia}
+ pubkey: $media->{pubkey}\n";
+ foreach my $files (@{$media->{input}}) {
+ $files->{file} or next;
+ if (-f $files->{file}) {
+ print "list of wanted: $files->{file}\n";
+ } else { print_color("$files->{file} not present", $error_color); }
+ }
+ foreach my $files (@{$media->{exclude}}) {
+ $files->{file} or next;
+ if (-f $files->{file}) {
+ print "list of exclusion: $files->{file}\n";
+ } else { print_color("$files->{file} not present", $error_color); }
+ }
+ }
+}
+
+sub copy_pubkey {
+ my ($source_key, $destmedia) = @_;
+ print_color("$LOG copy $source_key to the $builddir/media/$destmedia/media_info directory", $color);
+ create_needed_dir("$builddir/media/$destmedia/media_info/");
+ if (! -f $source_key) {
+ print_color("$LOG can't find the $source_key", $error_color);
+ #exit;
+ }
+ system("cp -vf $source_key $builddir/media/$destmedia/media_info/");
+}
+
+sub use_gendistrib {
+ my $destmedia;
+ print_color("$LOG remove hdlists and synthesys from $builddir/media/$destmedia/media_info and $builddir/media/media_info", $color);
+ system("rm -vf $builddir/media/media_info/*.cz");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ system("rm -vf $builddir/media/$destmedia/media_info/*.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/MD5SUM");
+ }
+ undef $destmedia;
+ print_color("$LOG gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir", $color);
+ my $cmd = "gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir";
+ system($cmd) == 0 or die "$LOG system $cmd failed: $?\n";
+ if ($isoconf->{based_on} lt "2009.1") {
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG move hdlists and synthesys from $builddir/media/$destmedia/media_info to $builddir/media/media_info/", $color);
+ system("rm -vf $builddir/media/media_info/*_$media->{name}.cz");
+ system("rm -vf $builddir/media/media_info/pubkey_$media->{name}");
+ system("cp -avf $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ system("cp -avf $builddir/media/$destmedia/media_info/pubkey $builddir/media/media_info/pubkey_$media->{name}");
+ system("cp -avf $builddir/media/$destmedia/media_info/synthesis.hdlist.cz $builddir/media/media_info/synthesis.hdlist_$media->{name}.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/*.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/MD5SUM");
+ }
+ }
+}
+
+sub copy_rpm {
+ my ($source_dir, $dest_dir) = @_;
+ system ("cp -a $source_dir/*.rpm $dest_dir");
+}
+
+sub create_mediacfg {
+ print_color("$LOG $builddir/$isoconf->{iso}{mediacfg}", $color);
+ system("rm -rf $builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+ create_needed_dir("$builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+ my $media_cfg = "$builddir/$isoconf->{iso}{mediacfg}";
+ open my $MEDIACFG, ">$media_cfg";
+ print $MEDIACFG "\n";
+ print $MEDIACFG "[media_info]\n";
+ print $MEDIACFG "version=$version\n";
+ if ($isoconf->{based_on} gt "2009.1") {
+ print $MEDIACFG "mediacfg_version=2\n";
+ }
+ print $MEDIACFG "branch=$isoconf->{iso}{branch}\n";
+ print $MEDIACFG "arch=$arch\n";
+ print $MEDIACFG "minor=$isoconf->{iso}{minor}\n";
+ print $MEDIACFG "subversion=$isoconf->{iso}{subversion}\n";
+ if ($isoconf->{mediainfo}{suppl}{todo} eq "yes") {
+ print $MEDIACFG "suppl=1\n";
+ }
+ if ($isoconf->{mediainfo}{askmedia}{todo} eq "yes") {
+ print $MEDIACFG "askmedia=1\n";
+ }
+ if ($isoconf->{mediainfo}{xmlinfo}{todo} eq "yes") {
+ print $MEDIACFG "xml-info=1\n";
+ }
+ my $destmedia;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ if ($isoconf->{based_on} lt "2009.1") {
+ print $MEDIACFG "
+
+[$media->{destmedia}]
+hdlist=hdlist_$media->{name}.cz
+pubkey=pubkey_$media->{name}
+name=$isoconf->{iso}{header}{volumesetid}
+desc=$isoconf->{iso}{header}{volumesetid}
+\n";
+} else {
+ print $MEDIACFG "
+[$media->{destmedia}]
+synthesis=$media->{destmedia}/media_info/synthesis.hdlist.cz
+hdlist=$media->{destmedia}/media_info/hdlist.cz
+pubkey=$media->{destmedia}/media_info/pubkey
+name=$media->{desc}
+\n";
+ }
+ }
+ close $MEDIACFG;
+}
+
+# based on a similar functions in pkgs.pm
+sub get_list_from_CAT {
+ #4 META_CLASS"desktop" mandriva-xfce-config-One
+ my ($file, $cat, $poids) = @_;
+ my (%rates, @need_to_copy);
+ my (@l);
+ local $_;
+ foreach (cat_($file)) {
+ s/#.*//; # comments
+ my ($indent, $data) = /(\s*)(.*)/;
+ next if !$data; # skip empty lines
+
+ @l = grep { $_->[0] < length $indent } @l;
+
+ my @m = @l ? @{$l[-1][1]} : ();
+ my ($t, $flag, @l2);
+ while ($data =~
+ /^((
+ [1-5]
+ |
+ (?: (?: !\s*)? [0-9A-Z_]+(?:".*?")?)
+ (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)*
+ )
+ (?:\s+|$)
+ )(.*)/x) { #@")) {
+ ($t, $flag, $data) = ($1,$2,$3);
+ while ($flag =~ s,^\s*(("[^"]*"|[^"\s]*)*)\s+,$1,) {}
+ push @m, $flag;
+ push @l2, [ length $indent, [ @m ] ];
+ $indent .= $t;
+ }
+ if ($data) {
+ # has packages on same line
+ my ($rates, $flags) = partition { /^\d$/ } @m;
+ foreach my $name (split ' ', $data) {
+ if (member($cat, @$flags)) {
+ if ("@$rates" ge "$poids") {
+ push @need_to_copy, $name;
+ } else {
+ print "exclude $name of $cat (@$rates < $poids)\n";
+ }
+ next;
+ }
+ }
+ push @l, @l2;
+ } else {
+ push @l, [ $l2[0][0], $l2[-1][1] ];
+ }
+ }
+ \%rates, \@need_to_copy;
+}
+
+sub mini_chroot {
+ # it is usefull to use a mini chroot for add remove media, we have to keep the list of installed packages to copy them on ISO
+ print_color("$LOG create a mini chroot to run urpmi", $color);
+ # store all file needed to be installed on the system
+ my $cmd = "LC_ALL=C sudo urpmi --quiet --no-suggests --auto --no-verify-rpm --use-distrib $repo/$based_on/$arch --urpmi-root $chroot_path";
+ # sudo urpmi --no-verify-rpm --auto --urpmi-root /tmp/mk --use-distrib /mnt/BIG/dis/2009.0/i586/ basesystem-minimal urpmi --test
+ #
+ system("LC_ALL=C sudo urpmi --test --no-suggests --auto --no-verify-rpm --use-distrib $repo/$based_on/$arch --urpmi-root /tmp/$isoconf->{nameid}-$version-$isoconf->{arch} urpmi basesystem-minimal bash basesystem > $chroot_path/$isoconf->{tocopy_file}_TODO_chroot");
+ # install all those file to be able to use urpmi.XXXXXX
+ system("LC_ALL=C $cmd --prefer $DISTRIB,$THEME urpmi bash");
+ system("sudo chroot $chroot_path mkdir -p $distrib_path");
+ system("sudo mount -o bind $repo/$based_on/$arch $chroot_path/$distrib_path -o ro");
+ push @to_umount, $distrib_path;
+ system("sudo chroot $chroot_path urpmi.removemedia -a");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ chomp($media->{name});
+ system("LC_ALL=C sudo chroot $chroot_path urpmi.addmedia --probe-synthesis '$media->{name}' $distrib_path/media/$media->{mediadir}/release");
+ if ($media->{updates} eq "yes") {
+ system("LC_ALL=C sudo chroot $chroot_path urpmi.addmedia --update --probe-synthesis \"$media->{name} Updates\" $distrib_path/media/$media->{mediadir}/updates");
+ }
+ if ($media->{backports} eq "yes") {
+ system("sudo chroot $chroot_path urpmi.addmedia --probe-synthesis '$media->{name} Backports' $distrib_path/media/$media->{mediadir}/backport");
+ }
+ if ($media->{testing} eq "yes") {
+ system("sudo chroot $chroot_path urpmi.addmedia --probe-synthesis '$media->{name} Testing' $distrib_path/media/$media->{mediadir}/testing");
+ }
+ }
+# } else {
+# system("sudo chroot $chroot_path urpmi.addmedia --distrib $distrib_path --no-md5sum");
+# }
+}
+
+sub add_media {
+ my ($name, $path) = @_;
+ print_color("$LOG add media $name from $path", $color);
+ system("sudo chroot $chroot_path mkdir -p /tmp/$name");
+ system("sudo mount -o bind $path $chroot_path/tmp/$name -o ro");
+ system("LC_ALL=C sudo chroot $chroot_path urpmi.addmedia $name /tmp/$name");
+ push @to_umount, "/tmp/$name";
+ push @add_media, "$name";
+}
+
+
+my $listcopy = "$chroot_path/$isoconf->{tocopy_file}";
+sub generate_list_of_rpm_2_copy {
+ my @toget;my @toexclude;my $extra;
+# system("cp -vf /dev/null $tmp_filtre_from_rpmsrate");
+ mini_chroot;
+# system("sudo chroot $chroot_path cp /dev/null /tmp/filter_from_rpmsrate");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ $media->{external}{name} and add_media($media->{external}{name}, $media->{external}{fullpath_mediadir});
+ foreach my $input (@{$media->{input}}) {
+ $input->{file} or next;
+ -f $input->{file} or print_color("$LOG i can not find the $input->{file}, remove this list or fix...", $error_color);
+ foreach my $tohave (cat_($input->{file})) {
+ if ($tohave =~ /^\s/ || $tohave =~ /^\#/) {
+ next;
+ } elsif ($tohave =~ /^\S*\s\d$/) {
+ my ($section, $poids) = $tohave =~ /^(\S*)\s(\d)/;
+ print "$LOG get packages from $section using weight of $poids\n";
+ # TOFIX remove META_CLASS to avoid theme pb
+ system("cat $builddir/$isoconf->{mediainfo}{mediainfo_dir}/rpmsrate | grep -v META_CLASS > $tmp_rpmsrate");
+# system("cat $tmp_rpmsrate | grep -v theme > $tmp_rpmsrate");
+ my ($rates, $need_to_copy) = get_list_from_CAT($tmp_rpmsrate, $section, $poids);
+ foreach my $data (@{$need_to_copy}) {
+ push @toget, $data;
+# print "$LOG sudo chroot $chroot_path echo $data >> /tmp/filter_from_rpmsrate ";
+# system("sudo chroot $chroot_path echo $data >> /tmp/filter_from_rpmsrate");
+ }
+ next;
+ } else {
+ chomp($tohave);
+ $verbose and print "$LOG $tohave\n";
+ push @toget, $tohave;
+ next;
+ }
+ }
+ }
+ foreach my $exclude (@{$media->{exclude}}) {
+ $exclude->{file} or next;
+ -f $exclude->{file} or print_color("$LOG i can not find the $exclude->{file}, remove this list or fix...", $error_color);
+ foreach my $totest (cat_($exclude->{file})) {
+ if ($totest =~ /^\s/ || $totest =~ /^\#/) {
+ next;
+ } else {
+ chomp($totest);
+ push @toexclude, $totest;
+ next;
+ }
+ }
+ }
+# print "$LOG $media, $toget, $toexclude";
+ create_list($media, \@toget, \@toexclude, $media->{external}{name}, $media->{media_supp});
+ @toexclude = "";
+ @toget = "";
+ }
+}
+
+sub rpmcheck_list {
+ print_color("$LOG calculate deps from the auto-generated rpmcheck list file", $error_color);
+ my @toget = cat_($rpmcheck_list_pkg);
+ my $list_filename = "$isoconf->{tocopy_file}_todo_rpmcheck";
+ my $list = "$chroot_path/urpmq/$list_filename";
+ my $urpmq_options = "--requires-recursive -c --sources $isoconf->{mediainfo}{urpmi_option}";
+ my $pkgs;
+ foreach (@toget) { $_ or next ; chomp($_); $pkgs = "$_ " . $pkgs; }
+ my $cmd_do_it = "LC_ALL=C sudo -P chroot $chroot_path urpmq --prefer $DISTRIB,$THEME $urpmq_options --no-suggests";
+ do_fork($pkgs, $list_filename, $list, $cmd_do_it);
+}
+
+sub remove_notpresent {
+ my ($urpmi_error, $wanted) = @_;
+ my @toremove;
+ foreach my $entry (cat_($urpmi_error)) {
+ my ($data, $tor) = $entry =~ /(.*)\s(.*)\n/;
+ $data =~ /-/ and next;
+ $data =~ /^\s/ and next;
+ $tor or next;
+ push @toremove, $tor;
+ }
+ # keep only one line per packages
+ my %already_seen; my @final_list;
+ @already_seen{@toremove} = ();
+ foreach my $object (@{$wanted}) {
+ if (exists $already_seen{$object} and $verbose) { print_color("$LOG i cant find this package: $object, remove it from list", $error_color); }
+ push(@final_list, $object) unless exists $already_seen{$object};
+ }
+ # prepare the final list
+ my $final_list;
+ foreach (@final_list) {
+ chomp($_);
+ $final_list = $final_list . " $_";
+ }
+ return $final_list;
+}
+
+sub create_list {
+ my ($media, $wanted, $exclude, $extra, $media_supp) = @_;
+ my $extra_media;
+ # Main media is mandatory for all other media !
+ # we will use only Main + updates and this media + updates to calculte the list of wanted pkg
+ if ($media->{name} eq "Main") {
+ if ($media->{updates} eq "yes") {
+ #$extra_media = "--media \"Main,Main Updates,$extra,$media_supp\" --sortmedia \"Main Updates,Main\"";
+ $extra_media = "--media \"Main,Main Updates,$extra,$media_supp\"";
+ } else {
+ $extra_media = "--media \"Main,$extra,$media_supp\"";
+ }
+ } else {
+ my $extra2;
+ foreach (@add_media) { chomp($_); $_ and $extra2 = $_ . ',' . $extra2; };
+ #$extra_media = "--media \"Main,Main Updates,$extra2,$media_supp,$media->{name},$media->{name} Updates\" --sortmedia \"Main Updates,Main,$media->{name} Updates,$media->{name}\"";
+ if ($media->{updates} eq "yes") {
+ $extra_media = "--media \"Main,Main Updates,$extra2,$media_supp,$media->{name},$media->{name} Updates\"";
+ } else {
+ $extra_media = "--media \"Main,$extra2,$media_supp,$media->{name}\"";
+ }
+ }
+
+ # check the suggests option in the XML configuration
+ my $opt_sug;
+ if ($media->{nosuggests} eq "yes") {
+ $opt_sug = "--no-suggests";
+ } else { $opt_sug = ""; }
+ # list of wanted RPM per media name
+ my $list_filename = "$isoconf->{tocopy_file}_todo_$media->{name}";
+ my $list_filename_update = "$isoconf->{tocopy_file}_todo_$media->{name}_update";
+ my $list = "$chroot_path/urpmq/$list_filename";
+ my $list_update = "$chroot_path/urpmq/$list_filename_update";
+ system("sudo chroot $chroot_path mkdir -m 777 -p urpmq");
+ # urpmq error file
+ my $urpmq_error = "$chroot_path/$isoconf->{tocopy_file}_urpmi_error_$media->{name}";
+ my $urpmq_error_update = "$chroot_path/$isoconf->{tocopy_file}_urpmi_error_update_$media->{name}";
+
+ # create list of wanted and exlude
+ my $tested_exclude;
+ my $tested_wanted;
+ foreach (@{$wanted}) { $tested_wanted = $tested_wanted . " $_" }
+ foreach (@{$exclude}) { $tested_exclude = $tested_exclude . " --skip $_" };
+ print_color("$LOG remove unwanted mandriva-release, use $DISTRIB", $color);
+ # urpmq options (with option in the xml file)
+ my $urpmq_options = "--requires-recursive -c --sources $isoconf->{mediainfo}{urpmi_option}";
+ my $urpmq_extra_opt = "$opt_sug $extra_media";
+
+ ###
+ # do the job with update, find missing package from list
+ # only if the media as udpate option enable
+ if ($media->{updates} eq "yes") {
+ my $cmd_find_missing_update = "LC_ALL=C sudo chroot $chroot_path urpmq --update --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $tested_wanted $tested_exclude 2> $urpmq_error_update";
+ print_color("$LOG first attempt to run urpmq --update on media $media->{name} (to find all packages not availables in update)", $color);
+ system($cmd_find_missing_update);
+ # urpmq error found, so we have to remove some entry in the list of wanted packages
+ my $final_list_update = remove_notpresent($urpmq_error_update, $wanted);
+ my $cmd_do_it_update = "LC_ALL=C sudo -P chroot $chroot_path urpmq --update -a --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $tested_exclude";
+ do_fork($final_list_update, $list_filename_update, $list_update, $cmd_do_it_update);
+ }
+
+ ###
+ # select rpm from all media, find missing from list
+ my $cmd_find_missing = "LC_ALL=C sudo chroot $chroot_path urpmq --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $tested_wanted $tested_exclude 2> $urpmq_error > $list";
+ print_color("$LOG first attempt to run urpmq on media $media->{name} (to find all packages not availables)", $color);
+ system($cmd_find_missing);
+ # urpmq error found, so we have to remove some entry in the list of wanted packages
+ my $final_list = remove_notpresent($urpmq_error, $wanted);
+ print_color("$LOG launch urpmq on media $media->{name} (to create $list)", $color);
+ my $cmd_do_it = "LC_ALL=C sudo -P chroot $chroot_path urpmq --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $tested_exclude";
+ do_fork($final_list, $list_filename, $list, $cmd_do_it);
+}
+
+
+sub do_fork {
+ my ($final_list, $list_filename, $list, $cmd) = @_;
+ my @list_alone = split(/ /, $final_list);
+ my $count = @list_alone;
+ my $status = "0";
+ my $pm = new Parallel::ForkManager($NB_FORK);
+ print_color("$LOG $count transactions to do ... be patient !!!!", $color);
+ $| = 1;
+ foreach my $pkg (@list_alone) {
+ $pkg or next;
+ $status++;
+ my $pid = $pm->start and next;
+ back_and_print($status, $count);
+ # check an urpmq has been done before
+ if (-f "$dir_deps/$list_filename-$pkg") {
+ my $pkg_found = `grep -P '\/$pkg-' /$dir_deps/$list_filename-$pkg`;
+ $pkg_found = basename($pkg_found);
+ $verbose and print_color("$LOG found the urpmq transaction for $pkg_found, i will use it $dir_deps/$list_filename-$pkg", $color);
+ system("cp -f $dir_deps/$list_filename-$pkg $list-$pkg");
+ } else {
+ # match the case using --update option
+ my $cmd_do_it = "$cmd $pkg > $list-$pkg";
+ if ($cmd =~ /\-\-update/) {
+ my @result = `urpmq --update $pkg`;
+ foreach (@result) {
+ # exact match with --update option
+ $_ or next;
+ if ($_ =~ /^pkg/) {
+ system($cmd_do_it);
+ system("cp -f $list-$pkg $dir_deps/$list_filename-$pkg");
+ last;
+ } else { print "\n-DEBUG $pkg is not in update, it's a package that contains the string $pkg!\n"; last }
+ }
+ } else {
+ system($cmd_do_it);
+ system("cp -f $list-$pkg $dir_deps/$list_filename-$pkg");
+ }
+ }
+ $pm->finish;
+ }
+ print_color("$LOG Waiting for the end of some urpmq command...", $color);
+ $pm->wait_all_children;
+ print_color("$LOG all urpmq command are done...", $color);
+}
+
+
+sub back_and_print {
+ my ($status, $total) = @_;
+ printf STDERR "%s / %2d \n", $status, $total;
+ print STDERR "\e[A";
+}
+
+
+sub concatenate_files {
+ print_color("$LOG create the final list: $listcopy", $color);
+ system("cat $chroot_path/urpmq/$isoconf->{tocopy_file}_todo_* > $listcopy.tmp");
+ system("sed -e 's|^\\w*\\s/|/|' $listcopy.tmp > $listcopy");
+ system("grep '^/' $listcopy > $listcopy.tmp");
+ system("cat $listcopy.tmp | sort | uniq > $listcopy");
+}
+
+sub target_size {
+ print_color("$LOG calculate the size of all packages:", $color);
+ my $total;my $pkg_info;
+ foreach my $pkg (cat_($listcopy)) {
+ chomp($pkg);
+ if (-f "$pkg") {
+ # stat is not really good to get size file of linked packages over nfs
+ $pkg_info = stat($pkg);
+ $total = ($total+$pkg_info->size);
+ next;
+ } else { next; }
+ }
+ my $human_total = int(($total/1024)/1024);
+ print_color("$LOG Size of all RPMS: $human_total Mo", $color);
+ my $left = ($isoconf->{iso}{size} - $human_total);
+ # i need to add the install/ directory size
+ if ("$isoconf->{iso}{size}" ge "$human_total") {
+ print_color("$LOG all you data will fit on the CD/DVD, extra size: $left", $color);
+ } else {
+ print_color("$LOG all packages will not fit on $isoconf->{iso}{size}, i need $left Mo", $error_color);
+ }
+}
+
+sub count_nb_to_copy {
+ my ($file) = @_;
+ my $lines = 0;
+ open(FILE, $file) or die "Can't open `$file': $!";
+ while (sysread FILE, my $buffer, 4096) {
+ if ($buffer =~ /^install/ || $buffer =~ /^\-/ || $buffer =~ /^More/ || $buffer =~ /^Install/ ) {
+ next;
+ } else {
+ $lines += ($buffer =~ tr/\n//);
+ }
+ }
+ close FILE;
+ return $lines;
+}
+
+sub find_source_dest_media {
+ my ($todeal) = @_;
+ # distribution path
+ if ($todeal =~ m!^$distrib_path!) {
+ # find the source media name
+ # f_path will contrib/release, dir_f_path will be contrib
+ my ($f_path) = $todeal =~ /^$distrib_path\/media\/(.*)/;
+ my $dir_f_path = dirname($f_path);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ # find a mediadir or next one
+ $media->{mediadir} or next;
+ #print "DEBUG media->name: $media->{mediadir} f_path: $f_path\n";
+ # try to find the source media
+ if ($media->{mediadir} eq $dir_f_path) {
+ #print "DEBUG todeal: $todeal FROM $repo/$based_on/$arch/media/$f_path TO media/$media->{destmedia}\n";
+ return("$repo/$based_on/$arch/media/$f_path", "media/$media->{destmedia}");
+ }
+ }
+ next;
+ } else {
+ #external repository
+ #/tmp/u_xos
+ my ($source_media) = $todeal =~ /\/tmp\/(.*)/;
+ # find the dest media from source media
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ # find a media or next one
+ $media->{name} or next;
+ if ($media->{name} eq $source_media) {
+ #print "DEBUG todeal: $todeal DEBUG media->name: $media->{name} source_media: $source_media\n";
+ # we have found the media so destmedia is $media->{destmedia}
+ # return the destmedia
+ return($media->{external}{fullpath_mediadir}, "media/$media->{destmedia}");
+ }
+ next;
+ }
+ }
+}
+
+sub parse_copy_link {
+ my ($wichaction) = @_;
+ my $count;my $action;
+ if ($wichaction =~ /link/) {
+ $action = "ln -sf";
+ } else {
+ $action = "cp -fa";
+ }
+ my $total = count_nb_to_copy($listcopy);
+ print_color("$LOG $wichaction all wanted packages to $builddir/XXXX", $color);
+ # chroot packages
+ if (!-f "$chroot_path/$isoconf->{tocopy_file}_TODO_chroot") { exit 1 }
+ foreach my $line (cat_("$chroot_path/$isoconf->{tocopy_file}_TODO_chroot")) {
+ chomp($line);
+ my @list = split(/ /, $line);
+ my $data = $list[$#list];
+ # if (! -d $data) { print "$data is not a directory !\n"; }
+ foreach my $pkg (@list) {
+ if (-f "$data/$pkg") {
+ #print "$LOG $action $data/$pkg TO1 $builddir/media/main/$pkg\n";
+ system("$action $data/$pkg $builddir/media/main/$pkg");
+ next;
+ } elsif (-f $data) {
+ my $package = basename($data);
+ chomp($package);
+ #print "$LOG $action $data TO2 $builddir/media/main/$package\n";
+ system("$action $data $builddir/media/main/$package");
+ next;
+ }
+ }
+ }
+ foreach my $tocopy (cat_($listcopy)) {
+ chomp($tocopy);
+ #print "info tocopy $tocopy\n";
+ my @list = split(/ /, $tocopy);
+ # path final
+ my $data2 = $list[$#list];
+ my ($path, $pkg) = $tocopy =~ m!^(/.*)/(.*)\.[rpm|]$!;
+ # une ligne avec un mot avant
+ # $pkg or ($path, $pkg) = $tocopy =~ m!^\w+\s(/.*)/(.*)\.rpm$!;
+
+ my $source_media; my $dest_media;
+ my $package = basename($data2);
+ my $dirn = dirname($data2);
+ if (-f "$chroot_path/$data2" || !-d "$chroot_path/$data2") {
+ chomp($package);
+ ($source_media, $dest_media) = find_source_dest_media($dirn);
+ $dest_media or print "$LOG $package is require/suggest but has no destination, removing it from list\n" and next;
+ #print "parse_copy_link package: $package, sourcemedia: $source_media, dest_media: $dest_media\n";
+ #print "parse_copy_link $LOG $action $source_media/$package TO3 $builddir/$dest_media/$package\n";
+ system("$action $source_media/$package $builddir/$dest_media/$package");
+ next;
+ } else {
+ #print "$chroot_path/$data2 data2 is a directory \n";
+ ($source_media, $dest_media) = find_source_dest_media($data2);
+ foreach my $pkg2 (@list) {
+ if (-f "$chroot_path/$data2/$pkg2") {
+ print "DATA2/pkg2 i found $chroot_path/$data2/$pkg2 \n";
+ #print "$LOG $action $source_media/$pkg2 TO4 $builddir/$dest_media/$pkg2\n";
+ system("$action $source_media/$pkg2 $builddir/$dest_media/$pkg2");
+ next;
+ }
+ }
+ }
+ $path or next;
+ if (!-d "$chroot_path/$path") {
+ print "";
+ #print "$chroot_path/$path isnt a directory\n";
+ } elsif (-f "$chroot_path/$path/$pkg") {
+ #print "$chroot_path/$path/$pkg is a package\n";
+ ($source_media, $dest_media) = find_source_dest_media($path);
+ $package = basename("chroot_path/$path/$pkg");
+ chomp($package);
+ #print "$LOG $action $source_media/$package TO5 $builddir/$dest_media/$pkg\n";
+ system("$action $source_media/$package $builddir/$dest_media/$pkg");
+ next;
+ } else { print "lost in space !!\n"; }
+ next;
+ }
+}
+
+sub rpmVersionCompare {
+ my ($pkg1, $pkg2) = @_;
+ my ($name_a, $av, $ar) = $pkg1 =~ /^(?:([^:]*):)?([^-]*)(?:-(.*))?$/;
+ my ($name_b, $bv, $br) = $pkg2 =~ /^(?:([^:]*):)?([^-]*)(?:-(.*))?$/;
+ my $rc = 0;
+ if(defined($name_a) && ! defined($name_b)) {
+ return 1;
+ } elsif(!defined($name_a) && defined($name_b)) {
+ return -1;
+ } else {
+ $rc = URPM::rpmvercmp($name_a, $name_b) if (defined($name_a) && defined($name_b));
+ if ($rc == 0) {
+ $rc = URPM::rpmvercmp($av, $bv);
+ if ($rc == 0) {
+ if(defined($ar) && !defined($br)) {
+ return 1;
+ } elsif(!defined($ar) && defined($br)) {
+ return -1;
+ } elsif (!defined($ar) && !defined($br)) {
+ return 0;
+ } else {
+ return URPM::rpmvercmp($ar, $br);
+ }
+ } else {
+ return $rc;
+ }
+ } else {
+ return $rc;
+ }
+ }
+}
+
+sub remove_all_excluded {
+ # this functions should be available if explicitely needed, it's really too dangerous to remove packages from a list...
+ print_color("$LOG remove all RPM from exclude list", $color);
+ print_color("$LOG WARNING remove needed packages can break dependencies, check rpmcheck messages", $error_color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ foreach my $exclude (@{$media->{exclude}}) {
+ $exclude->{file} or next;
+ -f $exclude->{file} or print_color("$LOG i can not find the $exclude->{file}, remove this list or fix...", $error_color);
+ foreach my $totest (cat_($exclude->{file})) {
+ chomp($totest);
+ if (! $totest) { next };
+ if ($totest =~ /^\s.*/ || $totest =~ /^\#/) {
+ next;
+ } else {
+ my @l = glob("$builddir/media/$media->{destmedia}/$totest*.rpm");
+ foreach my $file (@l) {
+ $file or next;
+ if (-f $file) {
+ $verbose and print "$LOG $file found, removing this file\n";
+ system("rm -f $file");
+ next;
+ }
+ }
+ }
+ next;
+ }
+ next;
+ }
+ }
+}
+
+sub copy_filedeps {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps}" or print "$LOG missing filedeps\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps} $builddir/$isoconf->{mediainfo}{mediainfo_dir}/file-deps");
+}
+
+sub copy_rpmsrate {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate}" or print "$LOG missing rpmsrate\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate} $builddir/$isoconf->{mediainfo}{mediainfo_dir}/rpmsrate");
+}
+
+sub copy_compssusers {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers}" or print "$LOG missing compssusers\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers} $builddir/$isoconf->{mediainfo}{mediainfo_dir}/compssUsers.pl");
+}
+
+sub use_genhdlist2 {
+ my $destmedia;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG build hdlists and synthesys in $builddir/media/$media->{destmedia}", $color);
+ system("genhdlist2 -v --clean --file-deps $builddir/media/media_info/$isoconf->{medianfo}{filedeps} --media_info-dir $builddir/media/media_info/ $builddir/media/$media->{destmedia}");
+ system("mv $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ system("mv $builddir/media/$destmedia/media_info/synthesis.hdlist.cz $builddir/media/media_info/synthesis.hdlist_$media->{name}.cz");
+# system("genhdlist2 --quiet --clean --no-hdlist --file-deps $builddir/media/media_info/$isoconf->{medianfo}{filedeps} $builddir/media/$media->{destmedia}");
+ }
+ system("cd $builddir/media/media_info/ && md5sum *.cz > MD5SUM");
+}
+
+sub rpmcheck_launch {
+ my $options = "-explain -failures";
+ my $destmedia = "0";
+ print_color("$LOG launch rpmcheck to check hdlists", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ system("cp $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ }
+ my $cmd = "zcat $builddir/media/media_info/hdlist*.cz | rpmcheck $options";
+ print_color("$LOG $cmd", $color);
+ my $file_rpmcheck_log = "/tmp/rpmcheck_failure_$isoconf->{nameid}-$version-$isoconf->{arch}";
+ system("$cmd 2> /dev/null > $file_rpmcheck_log") == 0 or die "$LOG system $cmd failed: $?\n";
+ open my $LIST_FAILURE, ">$rpmcheck_list_pkg";
+ my @list_failure = cat_($file_rpmcheck_log);
+ foreach my $package (@list_failure) {
+ print "$package";
+ my ($package2) = $package =~ /^\s+(\S*)\s.*/;
+ $package2 and print $LIST_FAILURE "$package2\n";
+ }
+ close $LIST_FAILURE;
+ print_color("$LOG check this file $file_rpmcheck_log", $color);
+ print_color("$LOG check this file $rpmcheck_list_pkg", $color);
+}
+
+sub remove_hdlist {
+ my $destmedia;
+ if ($isoconf->{based_on} gt "2009.1") {
+ print_color("$LOG remove hdlists*.cz from $builddir/media/media_info", $color);
+ system("rm -vf $builddir/media/media_info/hdlist*.cz");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG remove hdlists from $builddir/media/$destmedia/media_info", $color);
+ system("rm -vf $builddir/media/$destmedia/media_info/hdlist.cz");
+ system("cd $builddir/media/$destmedia/media_info ; md5sum *.cz > MD5SUM");
+ }
+ }
+}
+
+sub copy_all_pubkey {
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($media->{pubkey} eq "") {
+ print_color("$LOG using $media->{file_pubkey}", $color);
+ copy_pubkey($media->{file_pubkey}, "$media->{destmedia}");
+ } else {
+ # media/ dir will be added in the copy_pubkey functions
+ print_color("$LOG $repo/$based_on/$arch/media/$media->{mediadir}/$media->{pubkey}, $media->{destmedia}", $color);
+ copy_pubkey("$repo/$based_on/$arch/media/$media->{mediadir}/$media->{pubkey}", "$media->{destmedia}");
+ }
+ next;
+ }
+}
+
+sub list_medias_available {
+ #my @mediacfg = cat_("$repo/$based_on/$arch/$isoconf->{mediainfo_dir}/media.cfg");
+ print_color("$LOG list all medias availables in $repo/$based_on/$arch repositery", $color);
+ my @mediacfg = cat_("$repo/$based_on/$arch/media/media_info/media.cfg");
+ my @medias = grep {/^name=/} @mediacfg;
+ foreach my $media (@medias) {
+ $media =~ s/name\=//;
+ $media and print("$media");
+ }
+}
+
+sub check_repo_hdlist {
+ my $options = "-explain -failures";
+ print_color("$LOG check media repositery hdlists in $repo/$version/$arch", $color);
+ system("zcat $repo/$version/$arch/media/media_info/hdlist*ain.cz | rpmcheck $options");
+}
+
+sub umount_all_mountloop {
+ print "$LOG umount all mounted loop dir\n";
+ foreach (@to_umount) {
+ system("sudo umount $chroot_path/$_");
+ }
+}
+
+sub solve_doble_issue {
+ my $pkg_name; my $pkg_version;
+ my @list_to_filter; my @todeal;
+ my %already_seen; my @final_list;
+ my $keeped;
+ my $pm = new Parallel::ForkManager(50);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ $media->{destmedia} or next;
+ # get all rpm from the media dir
+ my @list_pkg = glob("$builddir/media/$media->{destmedia}/*.rpm");
+ my $total = @list_pkg;
+ my $status = "0";
+ print_color("$LOG i have to check $total doble ... be patient !!!!", $color);
+ # parse all files in the media
+ foreach my $pkg (@list_pkg) {
+ $status++;
+ # get the rpm name
+ my $pid = $pm->start and next;
+ $pkg_name = `rpm -qp --queryformat %{name} $pkg`;
+ my @l = glob("$builddir/media/$media->{destmedia}/$pkg_name*.rpm");
+ my $l = @l; $l eq "0" and last;
+ foreach (@l) {
+ #print_color("$LOG compare versions of $filter and keep the latest one", $color);
+ $_ or next;
+ my $pkg = basename($_);
+ $pkg =~ /^$pkg_name\-\d.*/ or next;
+ # bypass special case like libwnck-1_22
+ $pkg =~ /^$pkg_name\-\d\_.*/ and next;
+ foreach (cat_($isoconf->{mediainfo}{filter})) { $pkg =~ /^$_/ and next }
+ # check it will be a number after the filter name
+ $keeped or $keeped = $pkg;
+ #print "$LOG COMPARE $pkg and $keeped: \n";
+ my $r = rpmVersionCompare($pkg, $keeped);
+ if ($r eq "-1") {
+ $keeped = $keeped;
+ $verbose and print "i will keep $keeped\n";
+ system("rm -vf $builddir/media/$media->{destmedia}/$pkg");
+ } elsif ($r eq "1") {
+ system("rm -vf $builddir/media/$media->{destmedia}/$keeped");
+ $keeped = $pkg;
+ $verbose and print "i will keep $keeped\n";
+ };
+ }
+ back_and_print($status, $total);
+ $pm->finish;
+ print_color("$LOG Waiting for the end of some system command...", $color);
+ $pm->wait_all_children;
+ }
+ }
+}
+
+sub process_list_link {
+ my ($option) = @_;
+ concatenate_files;
+ # link or copy
+ if ($option =~ /copy/) {
+ parse_copy_link("copy");
+ } else {
+ parse_copy_link("link");
+ }
+ # remove packages listed in exclude list
+ remove_all_excluded;
+ solve_doble_issue;
+ use_gendistrib;
+## use_genhdlist2;
+}
+
+sub main_media {
+ my ($option) = @_;
+ if ($option =~ /verbose/) {
+ $verbose = "1";
+ }
+ list_media;
+ create_media;
+ copy_all_pubkey;
+
+ create_mediacfg;
+
+ copy_filedeps;
+ copy_rpmsrate;
+ copy_compssusers;
+
+ create_needed_dir($chroot_path);
+ generate_list_of_rpm_2_copy;
+ process_list_link($option);
+ # target_size;
+ # first rpmcheck launch
+ rpmcheck_launch;
+ rpmcheck_list;
+ process_list_link($option);
+ # second laucn of rpmcheck (should have fix a lot of missing deps)
+ rpmcheck_launch;
+ umount_all_mountloop;
+ remove_hdlist;
+ show_size;
+}
+
+1;
+
diff --git a/BCD/Media.pm.good b/BCD/Media.pm.good
new file mode 100644
index 0000000..3202cd8
--- /dev/null
+++ b/BCD/Media.pm.good
@@ -0,0 +1,851 @@
+package BCD::Media;
+
+use File::Copy::Recursive qw(dircopy pathrm);
+use strict;
+use URPM;
+use File::Copy;
+use File::stat;
+use Data::Dumper;
+use MDK::Common;
+
+use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $version $based_on $repo $builddir $distrib_path $error_color $DISTRIB $THEME);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_media list_media use_gendistrib list_medias_available check_repo_hdlist rpmcheck_launch);
+
+my $LOG="MEDIA -";
+my $color = "magenta";
+
+# all mounted loop dir to umount
+my @to_umount;
+my @add_media;
+
+my $mediainfo_sourcedir;
+if (defined($isoconf->{mediainfo}{fullpath})) {
+ $mediainfo_sourcedir = $isoconf->{mediainfo}{fullpath};
+} else {
+ $mediainfo_sourcedir = "$repo/$based_on/$arch/$isoconf->{mediainfo}{mediainfo_dir}";
+}
+my $chroot_path = "/tmp/$isoconf->{nameid}-$version-$isoconf->{arch}";
+
+sub create_media {
+ print_color("$LOG Create the media dir in $builddir", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ create_needed_dir("$builddir/media/$media->{destmedia}");
+ }
+}
+
+sub show_size {
+ print_color("$LOG size of the builddir", $color);
+ system("du -sLh $builddir");
+}
+
+sub list_media {
+ print_color("$LOG all media are listed there:", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ print "
+name: $media->{name}
+ desc: $media->{desc}
+ mediadir: $media->{mediadir}
+ destmedia: $media->{destmedia}
+ pubkey: $media->{pubkey}\n";
+ foreach my $files (@{$media->{input}}) {
+ $files->{file} or next;
+ if (-f $files->{file}) {
+ print "list of wanted: $files->{file}\n";
+ } else { print_color("$files->{file} not present", $error_color); }
+ }
+ foreach my $files (@{$media->{exclude}}) {
+ $files->{file} or next;
+ if (-f $files->{file}) {
+ print "list of exclusion: $files->{file}\n";
+ } else { print_color("$files->{file} not present", $error_color); }
+ }
+ }
+}
+
+sub copy_pubkey {
+ my ($source_key, $destmedia) = @_;
+ print_color("$LOG copy $source_key to the $builddir/media/$destmedia/media_info directory", $color);
+ create_needed_dir("$builddir/media/$destmedia/media_info/");
+ if (! -f $source_key) {
+ print_color("$LOG can't find the $source_key", $error_color);
+ #exit;
+ }
+ system("cp -vf $source_key $builddir/media/$destmedia/media_info/");
+}
+
+sub use_gendistrib {
+ my $destmedia;
+ print_color("$LOG remove hdlists and synthesys from $builddir/media/$destmedia/media_info and $builddir/media/media_info", $color);
+ system("rm -vf $builddir/media/media_info/*.cz");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ system("rm -vf $builddir/media/$destmedia/media_info/*.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/MD5SUM");
+ }
+ undef $destmedia;
+ print_color("$LOG gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir", $color);
+ system("gendistrib --mediacfg $builddir/$isoconf->{iso}{mediacfg} $builddir");
+ if ($isoconf->{based_on} lt "2009.1") {
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG move hdlists and synthesys from $builddir/media/$destmedia/media_info to $builddir/media/media_info/", $color);
+ system("rm -vf $builddir/media/media_info/*_$media->{name}.cz");
+ system("rm -vf $builddir/media/media_info/pubkey_$media->{name}");
+ system("cp -avf $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ system("cp -avf $builddir/media/$destmedia/media_info/pubkey $builddir/media/media_info/pubkey_$media->{name}");
+ system("cp -avf $builddir/media/$destmedia/media_info/synthesis.hdlist.cz $builddir/media/media_info/synthesis.hdlist_$media->{name}.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/*.cz");
+ system("rm -vf $builddir/media/$destmedia/media_info/MD5SUM");
+ }
+ }
+}
+
+sub copy_rpm {
+ my ($source_dir, $dest_dir) = @_;
+ system ("cp -a $source_dir/*.rpm $dest_dir");
+}
+
+sub create_mediacfg {
+ print_color("$LOG $builddir/$isoconf->{iso}{mediacfg}", $color);
+ system("rm -rf $builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+ create_needed_dir("$builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+ my $media_cfg = "$builddir/$isoconf->{iso}{mediacfg}";
+ open my $MEDIACFG, ">$media_cfg";
+ print $MEDIACFG "\n";
+ print $MEDIACFG "[media_info]\n";
+ print $MEDIACFG "version=$version\n";
+ if ($isoconf->{based_on} gt "2009.1") {
+ print $MEDIACFG "mediacfg_version=2\n";
+ }
+ print $MEDIACFG "branch=$isoconf->{iso}{branch}\n";
+ print $MEDIACFG "arch=$arch\n";
+ print $MEDIACFG "minor=$isoconf->{iso}{minor}\n";
+ print $MEDIACFG "subversion=$isoconf->{iso}{subversion}\n";
+ if ($isoconf->{mediainfo}{suppl}{todo} eq "yes") {
+ print $MEDIACFG "suppl=1\n";
+ }
+ if ($isoconf->{mediainfo}{askmedia}{todo} eq "yes") {
+ print $MEDIACFG "askmedia=1\n";
+ }
+ if ($isoconf->{mediainfo}{xmlinfo}{todo} eq "yes") {
+ print $MEDIACFG "xml-info=1\n";
+ }
+ my $destmedia;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ if ($isoconf->{based_on} lt "2009.1") {
+ print $MEDIACFG "
+
+[$media->{destmedia}]
+hdlist=hdlist_$media->{name}.cz
+pubkey=pubkey_$media->{name}
+name=$isoconf->{iso}{header}{volumesetid}
+desc=$isoconf->{iso}{header}{volumesetid}
+\n";
+} else {
+ print $MEDIACFG "
+[$media->{destmedia}]
+synthesis=$media->{destmedia}/media_info/synthesis.hdlist.cz
+hdlist=$media->{destmedia}/media_info/hdlist.cz
+pubkey=$media->{destmedia}/media_info/pubkey
+name=$media->{desc}
+\n";
+ }
+ }
+ close $MEDIACFG;
+}
+
+# based on a similar functions in pkgs.pm
+sub get_list_from_CAT {
+ #4 META_CLASS"desktop" mandriva-xfce-config-One
+ my ($file, $cat, $poids) = @_;
+ my (%rates, @need_to_copy);
+ my (@l);
+ local $_;
+ foreach (cat_($file)) {
+ s/#.*//; # comments
+ my ($indent, $data) = /(\s*)(.*)/;
+ next if !$data; # skip empty lines
+
+ @l = grep { $_->[0] < length $indent } @l;
+
+ my @m = @l ? @{$l[-1][1]} : ();
+ my ($t, $flag, @l2);
+ while ($data =~
+ /^((
+ [1-5]
+ |
+ (?: (?: !\s*)? [0-9A-Z_]+(?:".*?")?)
+ (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)*
+ )
+ (?:\s+|$)
+ )(.*)/x) { #@")) {
+ ($t, $flag, $data) = ($1,$2,$3);
+ while ($flag =~ s,^\s*(("[^"]*"|[^"\s]*)*)\s+,$1,) {}
+ push @m, $flag;
+ push @l2, [ length $indent, [ @m ] ];
+ $indent .= $t;
+ }
+ if ($data) {
+ # has packages on same line
+ my ($rates, $flags) = partition { /^\d$/ } @m;
+ foreach my $name (split ' ', $data) {
+ if (member($cat, @$flags)) {
+ if ("@$rates" ge "$poids") {
+ push @need_to_copy, $name;
+ } else {
+ print "exclude $name of $cat (@$rates < $poids)\n";
+ }
+ next;
+ }
+ }
+ push @l, @l2;
+ } else {
+ push @l, [ $l2[0][0], $l2[-1][1] ];
+ }
+ }
+ \%rates, \@need_to_copy;
+}
+
+sub mini_chroot {
+ # it is usefull to use a mini chroot for add remove media, we have to keep the list of installed packages to copy them on ISO
+ print_color("$LOG create a mini chroot to run urpmi", $color);
+ # store all file needed to be installed on the system
+ my $cmd = "sudo urpmi --quiet --no-suggests --auto --no-verify-rpm --use-distrib $repo/$based_on/$arch --urpmi-root $chroot_path";
+ # sudo urpmi --no-verify-rpm --auto --urpmi-root /tmp/mk --use-distrib /mnt/BIG/dis/2009.0/i586/ basesystem-minimal urpmi --test
+ #
+ system("sudo urpmi --test --no-suggests --auto --no-verify-rpm --use-distrib $repo/$based_on/$arch --urpmi-root /tmp/$isoconf->{nameid}-$version-$isoconf->{arch} urpmi basesystem-minimal bash basesystem > $chroot_path/$isoconf->{tocopy_file}_TODO_chroot");
+ # install all those file to be able to use urpmi.XXXXXX
+ system("$cmd --prefer $DISTRIB,$THEME urpmi bash");
+ system("sudo chroot $chroot_path mkdir -p $distrib_path");
+ system("sudo mount -o bind $repo/$based_on/$arch $chroot_path/$distrib_path -o ro");
+ push @to_umount, $distrib_path;
+ system("sudo chroot $chroot_path urpmi.removemedia -a");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ chomp($media->{name});
+ system("sudo chroot $chroot_path urpmi.addmedia $media->{name} $distrib_path/media/$media->{mediadir}/release");
+ if ($media->{updates} eq "yes") {
+ system("sudo chroot $chroot_path urpmi.addmedia --update \"$media->{name} Updates\" $distrib_path/media/$media->{mediadir}/updates");
+ }
+ if ($media->{backports} eq "yes") {
+ system("sudo chroot $chroot_path urpmi.addmedia '$media->{name} Backports' $distrib_path/media/$media->{mediadir}/backport");
+ }
+ if ($media->{testing} eq "yes") {
+ system("sudo chroot $chroot_path urpmi.addmedia '$media->{name} Testing' $distrib_path/media/$media->{mediadir}/testing");
+ }
+ }
+# } else {
+# system("sudo chroot $chroot_path urpmi.addmedia --distrib $distrib_path --no-md5sum");
+# }
+}
+
+sub add_media {
+ my ($name, $path) = @_;
+ print_color("$LOG add media $name from $path", $color);
+ system("sudo chroot $chroot_path mkdir -p /tmp/$name");
+ system("sudo mount -o bind $path $chroot_path/tmp/$name -o ro");
+ system("sudo chroot $chroot_path urpmi.addmedia $name /tmp/$name");
+ push @to_umount, "/tmp/$name";
+ push @add_media, "$name";
+}
+
+
+my $listcopy = "$chroot_path/$isoconf->{tocopy_file}";
+sub generate_list_of_rpm_2_copy {
+ create_needed_dir($chroot_path);
+ my @toget;my @toexclude;my $extra;
+ system("cp -vf /dev/null $chroot_path/tmp/filter_from_rpmsrate");
+ mini_chroot;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ $media->{external}{name} and add_media($media->{external}{name}, $media->{external}{fullpath_mediadir});
+ foreach my $input (@{$media->{input}}) {
+ $input->{file} or next;
+ -f $input->{file} or print_color("$LOG i can not find the $input->{file}, remove this list or fix...", $error_color);
+ foreach my $tohave (cat_($input->{file})) {
+ if ($tohave =~ /^\s/ || $tohave =~ /^\#/) {
+ next;
+ } elsif ($tohave =~ /^\S*\s\d$/) {
+ my ($section, $poids) = $tohave =~ /^(\S*)\s(\d)/;
+ print "$LOG get packages from $section using weight of $poids\n";
+ my $tmp_rpmsrate = "/tmp/temp_rpmsrate";
+ # TOFIX remove META_CLASS to avoid theme pb
+ system("cat $builddir/$isoconf->{mediainfo}{mediainfo_dir}/rpmsrate | grep -v META_CLASS > $tmp_rpmsrate");
+# system("cat $tmp_rpmsrate | grep -v theme > $tmp_rpmsrate");
+ my ($rates, $need_to_copy) = get_list_from_CAT($tmp_rpmsrate, $section, $poids);
+ foreach my $data (@{$need_to_copy}) {
+ push @toget, $data;
+ system("echo $data >> $chroot_path/tmp/filter_from_rpmsrate");
+ }
+ next;
+ } else {
+ chomp($tohave);
+ push @toget, $tohave;
+ next;
+ }
+ }
+ }
+ foreach my $exclude (@{$media->{exclude}}) {
+ $exclude->{file} or next;
+ -f $exclude->{file} or print_color("$LOG i can not find the $exclude->{file}, remove this list or fix...", $error_color);
+ foreach my $totest (cat_($exclude->{file})) {
+ if ($totest =~ /^\s/ || $totest =~ /^\#/) {
+ next;
+ } else {
+ chomp($totest);
+ push @toexclude, $totest;
+ next;
+ }
+ }
+ }
+# print "$LOG $media, $toget, $toexclude";
+ create_list($media, \@toget, \@toexclude, $media->{external}{name}, $media->{media_supp});
+ @toexclude = "";
+ @toget = "";
+ }
+}
+
+sub remove_notpresent {
+ my ($urpmi_error, $wanted) = @_;
+ my @toremove;
+ foreach my $entry (cat_($urpmi_error)) {
+ my ($data, $tor) = $entry =~ /(.*)\s(.*)\n/;
+ $data =~ /-/ and next;
+ $data =~ /^\s/ and next;
+ $tor or next;
+ print "$tor ";
+ push @toremove, $tor;
+ }
+ # keep only one line per packages
+ my %already_seen; my @final_list;
+ @already_seen{@toremove} = ();
+ foreach my $object (@{$wanted}) {
+ if (exists $already_seen{$object}) { print_color("$LOG i cant find this package: $object, remove it from list", $error_color); }
+ push(@final_list, $object) unless exists $already_seen{$object};
+ }
+ # prepare the final list
+ my $final_list;
+ foreach (@final_list) {
+ chomp($_);
+ $final_list = $final_list . " $_";
+ }
+ return $final_list;
+}
+
+sub create_list {
+ my ($media, $wanted, $exclude, $extra, $media_supp) = @_;
+ my $extra_media;
+ # Main media is mandatory for all other media !
+ # we will use only Main + updates and this media + updates to calculte the list of wanted pkg
+ if ($media->{name} eq "Main") {
+ #$extra_media = "--media \"Main,Main Updates,$extra,$media_supp\" --sortmedia \"Main Updates,Main\"";
+ $extra_media = "--media \"Main,Main Updates,$extra,$media_supp\"";
+ } else {
+ my $extra2;
+ foreach (@add_media) { chomp($_); $_ and $extra2 = $_ . ',' . $extra2; };
+ #$extra_media = "--media \"Main,Main Updates,$extra2,$media_supp,$media->{name},$media->{name} Updates\" --sortmedia \"Main Updates,Main,$media->{name} Updates,$media->{name}\"";
+ $extra_media = "--media \"Main,Main Updates,$extra2,$media_supp,$media->{name},$media->{name} Updates\"";
+ }
+
+ # check the suggests option in the XML configuration
+ my $opt_sug;
+ if ($media->{nosuggests} eq "yes") {
+ $opt_sug = "--no-suggests";
+ }
+ # list of wanted RPM per media name
+ my $list = "$chroot_path/$isoconf->{tocopy_file}_todo_$media->{name}";
+ my $list2 = "$chroot_path/$isoconf->{tocopy_file}_todo_2_$media->{name}";
+ # urpmi error file
+ my $urpmq_error = "$chroot_path/$isoconf->{tocopy_file}_urpmi_error_$media->{name}";
+ my $urpmq_error2 = "$chroot_path/$isoconf->{tocopy_file}_urpmi_error_2_$media->{name}";
+
+ my $tested_wanted;
+ my $tested_exclude;
+ foreach (@{$wanted}) { $tested_wanted = $tested_wanted . " $_" }
+ foreach (@{$exclude}) { $tested_exclude = $tested_exclude . " --skip $_" };
+ print_color("$LOG remove unwanted mandriva-release, use $DISTRIB", $color);
+ # urpmq options (with option in the xml file)
+ my $urpmq_options = "--requires-recursive --sources $isoconf->{mediainfo}{urpmi_option}";
+ my $urpmq_extra_opt = "$opt_sug $extra_media";
+ my $cmd_find_missing = "sudo chroot $chroot_path urpmq --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $tested_wanted $tested_exclude 2> $urpmq_error > $list";
+ print_color("$LOG first attempt to run urpmq on media $media->{name} (to find all packages not availables)", $color);
+ system($cmd_find_missing);
+
+ # urpmi error found, so we have to remove some entry in the list of wanted packages
+ my $final_list;
+ if (-f $urpmq_error) {
+ $final_list = remove_notpresent($urpmq_error, $wanted);
+ } else {
+ $final_list = $tested_wanted;
+ }
+ print_color("$LOG launch urpmq on media $media->{name} (to create $list)", $color);
+ my $cmd_do_it = "sudo chroot $chroot_path urpmq --prefer $DISTRIB,$THEME $urpmq_options $urpmq_extra_opt $final_list $tested_exclude > $list";
+ print_color("$LOG $cmd_do_it", $color);
+ system($cmd_do_it);
+
+ # try to get rpm from list using only updates
+ my $cmd_find_missing_update = "sudo chroot $chroot_path urpmq --update --requires-recursive --sources $opt_sug $final_list 2> $urpmq_error2 > $list2";
+ print_color("$LOG launch urpmq on media $media->{name} only with updates (to create $list2, and only find update packages)", $color);
+ system($cmd_find_missing_update);
+ my $final_list2;
+ # full list of all RPM not in hdlists
+ my $all_notpresent = "/tmp/allerror";
+ system("cat $urpmq_error2 $urpmq_error > $all_notpresent");
+ if (-f $urpmq_error2) {
+ $final_list2 = remove_notpresent($all_notpresent, $wanted);
+ } else {
+ $final_list2 = remove_notpresent($all_notpresent, $wanted);
+ print "HMMM !! really strange, no packages in list are NOT PRESENT ? seems to be a bug...!\n";
+ }
+ my $cmd_do_it_with_update = "sudo chroot $chroot_path urpmq --update --requires-recursive --sources $opt_sug $final_list2 > $list2";
+ print_color("$LOG launch urpmq on media $media->{name} only with updates (to create $list2)\n$cmd_do_it_with_update", $color);
+ system($cmd_do_it_with_update);
+ print "DDDDD after cmd4\n";
+}
+
+sub concatenate_files {
+ print_color("$LOG create the final list: $listcopy", $color);
+ system("cat $chroot_path/$isoconf->{tocopy_file}_todo_* > $listcopy.tmp");
+ system("sed -e 's|^\\w*\\s/|/|' $listcopy.tmp > $listcopy");
+ system("grep '^/' $listcopy > $listcopy.tmp");
+ system("cat $listcopy.tmp | sort | uniq > $listcopy");
+}
+
+sub target_size {
+ print_color("$LOG calculate the size of all packages:", $color);
+ my $total;my $pkg_info;
+ foreach my $pkg (cat_($listcopy)) {
+ chomp($pkg);
+ if (-f "$pkg") {
+ # stat is not really good to get size file of linked packages over nfs
+ $pkg_info = stat($pkg);
+ $total = ($total+$pkg_info->size);
+ next;
+ } else { next; }
+ }
+ my $human_total = int(($total/1024)/1024);
+ print_color("$LOG Size of all RPMS: $human_total Mo", $color);
+ my $left = ($isoconf->{iso}{size} - $human_total);
+ # i need to add the install/ directory size
+ if ("$isoconf->{iso}{size}" ge "$human_total") {
+ print_color("$LOG all you data will fit on the CD/DVD, extra size: $left", $color);
+ } else {
+ print_color("$LOG all packages will not fit on $isoconf->{iso}{size}, i need $left Mo", $error_color);
+ }
+}
+
+sub count_nb_to_copy {
+ my ($file) = @_;
+ my $lines = 0;
+ open(FILE, $file) or die "Can't open `$file': $!";
+ while (sysread FILE, my $buffer, 4096) {
+ if ($buffer =~ /^install/ || $buffer =~ /^\-/ || $buffer =~ /^More/ || $buffer =~ /^Install/ ) {
+ next;
+ } else {
+ $lines += ($buffer =~ tr/\n//);
+ }
+ }
+ close FILE;
+ return $lines;
+}
+
+sub find_source_dest_media {
+ my ($todeal) = @_;
+ # distribution path
+ if ($todeal =~ m!^$distrib_path!) {
+ # find the source media name
+ # f_path will contrib/release, dir_f_path will be contrib
+ my ($f_path) = $todeal =~ /^$distrib_path\/media\/(.*)/;
+ my $dir_f_path = dirname($f_path);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ # find a mediadir or next one
+ $media->{mediadir} or next;
+ #print "DEBUG media->name: $media->{mediadir} f_path: $f_path\n";
+ # try to find the source media
+ if ($media->{mediadir} eq $dir_f_path) {
+ #print "DEBUG todeal: $todeal FROM $repo/$based_on/$arch/media/$f_path TO media/$media->{destmedia}\n";
+ return("$repo/$based_on/$arch/media/$f_path", "media/$media->{destmedia}");
+ }
+ }
+ next;
+ } else {
+ #external repository
+ #/tmp/u_xos
+ my ($source_media) = $todeal =~ /\/tmp\/(.*)/;
+ # find the dest media from source media
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ # find a media or next one
+ $media->{name} or next;
+ if ($media->{name} eq $source_media) {
+ #print "DEBUG todeal: $todeal DEBUG media->name: $media->{name} source_media: $source_media\n";
+ # we have found the media so destmedia is $media->{destmedia}
+ # return the destmedia
+ return($media->{external}{fullpath_mediadir}, "media/$media->{destmedia}");
+ }
+ next;
+ }
+ }
+}
+
+sub parse_copy_link {
+ my ($wichaction) = @_;
+ my $count;my $action;
+ if ($wichaction =~ /link/) {
+ $action = "ln -sf";
+ } else {
+ $action = "cp -fa";
+ }
+ my $total = count_nb_to_copy($listcopy);
+ print_color("$LOG copy all wanted packages to $builddir/XXXX", $color);
+ # chroot packages
+ if (!-f "$chroot_path/$isoconf->{tocopy_file}_TODO_chroot") { exit 1 }
+ foreach my $line (cat_("$chroot_path/$isoconf->{tocopy_file}_TODO_chroot")) {
+ chomp($line);
+ my @list = split(/ /, $line);
+ my $data = $list[$#list];
+ # if (! -d $data) { print "$data is not a directory !\n"; }
+ foreach my $pkg (@list) {
+ if (-f "$data/$pkg") {
+ #print "$LOG $action $data/$pkg TO1 $builddir/media/main/$pkg\n";
+ system("$action $data/$pkg $builddir/media/main/$pkg");
+ next;
+ } elsif (-f $data) {
+ my $package = basename($data);
+ chomp($package);
+ #print "$LOG $action $data TO2 $builddir/media/main/$package\n";
+ system("$action $data $builddir/media/main/$package");
+ next;
+ }
+ }
+ }
+ foreach my $tocopy (cat_($listcopy)) {
+ chomp($tocopy);
+ #print "info tocopy $tocopy\n";
+ my @list = split(/ /, $tocopy);
+ # path final
+ my $data2 = $list[$#list];
+ my ($path, $pkg) = $tocopy =~ m!^(/.*)/(.*)\.[rpm|]$!;
+ # une ligne avec un mot avant
+ # $pkg or ($path, $pkg) = $tocopy =~ m!^\w+\s(/.*)/(.*)\.rpm$!;
+
+ my $source_media; my $dest_media;
+ my $package = basename($data2);
+ my $dirn = dirname($data2);
+ if (-f "$chroot_path/$data2" || !-d "$chroot_path/$data2") {
+ chomp($package);
+ ($source_media, $dest_media) = find_source_dest_media($dirn);
+ $dest_media or print "$LOG $package is require/suggest but has no destination, removing it from list\n" and next;
+ #print "parse_copy_link package: $package, sourcemedia: $source_media, dest_media: $dest_media\n";
+ #print "parse_copy_link $LOG $action $source_media/$package TO3 $builddir/$dest_media/$package\n";
+ system("$action $source_media/$package $builddir/$dest_media/$package");
+ next;
+ } else {
+ #print "$chroot_path/$data2 data2 is a directory \n";
+ ($source_media, $dest_media) = find_source_dest_media($data2);
+ foreach my $pkg2 (@list) {
+ if (-f "$chroot_path/$data2/$pkg2") {
+ print "DATA2/pkg2 i found $chroot_path/$data2/$pkg2 \n";
+ #print "$LOG $action $source_media/$pkg2 TO4 $builddir/$dest_media/$pkg2\n";
+ system("$action $source_media/$pkg2 $builddir/$dest_media/$pkg2");
+ next;
+ }
+ }
+ }
+ $path or next;
+ if (!-d "$chroot_path/$path") {
+ print "";
+ #print "$chroot_path/$path isnt a directory\n";
+ } elsif (-f "$chroot_path/$path/$pkg") {
+ #print "$chroot_path/$path/$pkg is a package\n";
+ ($source_media, $dest_media) = find_source_dest_media($path);
+ $package = basename("chroot_path/$path/$pkg");
+ chomp($package);
+ #print "$LOG $action $source_media/$package TO5 $builddir/$dest_media/$pkg\n";
+ system("$action $source_media/$package $builddir/$dest_media/$pkg");
+ next;
+ } else { print "lost in space !!\n"; }
+ next;
+ }
+}
+
+sub rpmVersionCompare {
+ my ($pkg1, $pkg2) = @_;
+ my ($name_a, $av, $ar) = $pkg1 =~ /^(?:([^:]*):)?([^-]*)(?:-(.*))?$/;
+ my ($name_b, $bv, $br) = $pkg2 =~ /^(?:([^:]*):)?([^-]*)(?:-(.*))?$/;
+ my $rc = 0;
+ if(defined($name_a) && ! defined($name_b)) {
+ return 1;
+ } elsif(!defined($name_a) && defined($name_b)) {
+ return -1;
+ } else {
+ $rc = URPM::rpmvercmp($name_a, $name_b) if (defined($name_a) && defined($name_b));
+ if ($rc == 0) {
+ $rc = URPM::rpmvercmp($av, $bv);
+ if ($rc == 0) {
+ if(defined($ar) && !defined($br)) {
+ return 1;
+ } elsif(!defined($ar) && defined($br)) {
+ return -1;
+ } elsif (!defined($ar) && !defined($br)) {
+ return 0;
+ } else {
+ return URPM::rpmvercmp($ar, $br);
+ }
+ } else {
+ return $rc;
+ }
+ } else {
+ return $rc;
+ }
+ }
+}
+
+sub extra_filter {
+ my ($filter) = @_;
+ chomp($filter);
+ use File::Glob ':glob';
+ my @l; my $keeped;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ @l = glob("$builddir/media/$media->{destmedia}/$filter-*.rpm");
+ my $l = @l; $l eq "0" and last;
+ foreach (@l) {
+ print_color("$LOG compare versions of $filter and keep the latest one", $color);
+ my $pkg = basename($_);
+ # check it will be a number after the filter name
+ $pkg =~ /^$filter\-\d.*/ or next;
+ $keeped or $keeped = $pkg;
+ #print "$LOG COMPARE $pkg and $keeped: \n";
+ my $r = rpmVersionCompare($pkg, $keeped);
+ if ($r eq "-1") {
+ $keeped = $keeped;
+ print "i will keep $keeped\n";
+ system("rm -vf $builddir/media/$media->{destmedia}/$pkg");
+ } elsif ($r eq "1") {
+ system("rm -vf $builddir/media/$media->{destmedia}/$keeped");
+ $keeped = $pkg;
+ print "i will keep $keeped\n";
+ };
+ }
+ }
+}
+
+
+sub remove_all_excluded {
+ # this functions should be available if explicitely needed, it's really too dangerous to remove packages from a list...
+ print_color("$LOG remove all RPM from exclude list", $color);
+ print_color("$LOG WARNING remove needed packages can break dependencies, check rpmcheck messages", $error_color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ foreach my $exclude (@{$media->{exclude}}) {
+ $exclude->{file} or next;
+ -f $exclude->{file} or print_color("$LOG i can not find the $exclude->{file}, remove this list or fix...", $error_color);
+ foreach my $totest (cat_($exclude->{file})) {
+ chomp($totest);
+ if (! $totest) { next };
+ if ($totest =~ /^\s.*/ || $totest =~ /^\#/) {
+ next;
+ } else {
+ my @l = glob("$builddir/media/$media->{destmedia}/$totest*.rpm");
+ foreach my $file (@l) {
+ $file or next;
+ if (-f $file) {
+ print "$LOG $file found, removing this file\n";
+ system("rm -vf $file");
+ next;
+ }
+ }
+ }
+ next;
+ }
+ next;
+ }
+ }
+}
+
+sub copy_filedeps {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps}" or print "$LOG missing filedeps\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{filedeps} $builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+}
+
+sub copy_rpmsrate {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate}" or print "$LOG missing rpmsrate\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{rpmsrate} $builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+}
+
+sub copy_compssusers {
+ print_color("$LOG copy $mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers} in $builddir/$isoconf->{mediainfo}{mediainfo_dir}", $color);
+ -f "$mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers}" or print "$LOG missing compssusers\n";
+ system("cp -vf $mediainfo_sourcedir/$isoconf->{mediainfo}{compssusers} $builddir/$isoconf->{mediainfo}{mediainfo_dir}");
+}
+
+sub use_genhdlist2 {
+ my $destmedia;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG build hdlists and synthesys in $builddir/media/$media->{destmedia}", $color);
+ system("genhdlist2 -v --clean --file-deps $builddir/media/media_info/$isoconf->{medianfo}{filedeps} --media_info-dir $builddir/media/media_info/ $builddir/media/$media->{destmedia}");
+ system("mv $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ system("mv $builddir/media/$destmedia/media_info/synthesis.hdlist.cz $builddir/media/media_info/synthesis.hdlist_$media->{name}.cz");
+# system("genhdlist2 --quiet --clean --no-hdlist --file-deps $builddir/media/media_info/$isoconf->{medianfo}{filedeps} $builddir/media/$media->{destmedia}");
+ }
+ system("cd $builddir/media/media_info/ && md5sum *.cz > MD5SUM");
+}
+
+sub rpmcheck_launch {
+ my $options = "-explain -failures";
+ my $destmedia;
+ print_color("$LOG launch rpmcheck to check hdlists", $color);
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ system("cp $builddir/media/$destmedia/media_info/hdlist.cz $builddir/media/media_info/hdlist_$media->{name}.cz");
+ }
+ my $cmd = "zcat $builddir/media/media_info/hdlist*.cz | rpmcheck $options";
+ print_color("$LOG $cmd", $color);
+ my $file_list_pkg_to_add = "/tmp/rpmcheck_list_pkg_to_add_$isoconf->{nameid}-$version-$isoconf->{arch}";
+ my $file_rpmcheck_log = "/tmp/rpmcheck_failure_$isoconf->{nameid}-$version-$isoconf->{arch}";
+ system("$cmd 2> /dev/null > $file_rpmcheck_log");
+ open my $LIST_FAILURE, ">$file_list_pkg_to_add";
+ my @list_failure = cat_($file_rpmcheck_log);
+ foreach my $package (@list_failure) {
+ print "$package";
+ my ($package2) = $package =~ /^\s+(\S*)\s.*/;
+ $package2 and print $LIST_FAILURE "$package2\n";
+ }
+ close $LIST_FAILURE;
+ print_color("$LOG check this file $file_rpmcheck_log", $color);
+ print_color("$LOG check this file $file_list_pkg_to_add", $color);
+}
+
+sub remove_hdlist {
+ my $destmedia;
+ if ($isoconf->{based_on} gt "2009.1") {
+ print_color("$LOG remove hdlists*.cz from $builddir/media/media_info", $color);
+ system("rm -vf $builddir/media/media_info/hdlist*.cz");
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($destmedia eq $media->{destmedia}) { next }
+ $destmedia = $media->{destmedia};
+ print_color("$LOG remove hdlists from $builddir/media/$destmedia/media_info", $color);
+ system("rm -vf $builddir/media/$destmedia/media_info/hdlist.cz");
+ system("cd $builddir/media/$destmedia/media_info ; md5sum *.cz > MD5SUM");
+ }
+ }
+}
+
+sub copy_all_pubkey {
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ if ($media->{pubkey} eq "") {
+ print_color("$LOG no pubkey to copy (usefull when mixing main/contrib packages)", $error_color);
+ } else {
+ # media/ dir will be added in the copy_pubkey functions
+ print_color("$LOG $repo/$based_on/$arch/media/$media->{mediadir}/$media->{pubkey}, $media->{destmedia}", $color);
+ copy_pubkey("$repo/$based_on/$arch/media/$media->{mediadir}/$media->{pubkey}", "$media->{destmedia}");
+ }
+ next;
+ }
+}
+
+sub list_medias_available {
+ #my @mediacfg = cat_("$repo/$based_on/$arch/$isoconf->{mediainfo_dir}/media.cfg");
+ print_color("$LOG list all medias availables in $repo/$based_on/$arch repositery", $color);
+ my @mediacfg = cat_("$repo/$based_on/$arch/media/media_info/media.cfg");
+ my @medias = grep {/^name=/} @mediacfg;
+ foreach my $media (@medias) {
+ $media =~ s/name\=//;
+ $media and print("$media");
+ }
+}
+
+sub check_repo_hdlist {
+ my $options = "-explain -failures";
+ print_color("$LOG check media repositery hdlists in $repo/$version/$arch", $color);
+ system("zcat $repo/$version/$arch/media/media_info/hdlist*ain.cz | rpmcheck $options");
+}
+
+sub umount_all_mountloop {
+ print "$LOG umount all mounted loop dir\n";
+ foreach (@to_umount) {
+ system("sudo umount $chroot_path/$_");
+ }
+}
+
+sub solve_doble_issue {
+ if (-f $isoconf->{mediainfo}{filter}) {
+ foreach my $filtered (cat_($isoconf->{mediainfo}{filter})) {
+ $filtered or next;
+ extra_filter($filtered);
+ }
+ } else { print_color("$LOG $isoconf->{mediainfo}{filter} file doesnt exist", $error_color) }
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ $media->{name} or next;
+ foreach my $files (@{$media->{input}}) {
+ $files->{file} or next;
+ if (-f $files->{file}) {
+ print "$LOG extra_filter from list $files->{file}\n";
+ foreach my $filtered (cat_($files->{file})) {
+ $filtered or next;
+ $filtered =~ /^[^:]/ or next;
+ extra_filter($filtered);
+ }
+ } else { print_color("$files->{file} not present", $error_color); }
+ }
+ }
+ foreach my $filtered (cat_("$chroot_path/tmp/filter_from_rpmsrate")) {
+ $filtered or next;
+ extra_filter($filtered);
+ }
+}
+
+sub main_media {
+ my ($option) = @_;
+ list_media;
+ create_media;
+ copy_all_pubkey;
+
+ create_mediacfg;
+
+ copy_filedeps;
+ copy_rpmsrate;
+ copy_compssusers;
+
+ generate_list_of_rpm_2_copy;
+ concatenate_files;
+ target_size;
+ # link or copy
+ if ($option =~ /copy/) {
+ parse_copy_link("copy");
+ } else {
+ parse_copy_link("link");
+ }
+
+ solve_doble_issue;
+
+ # remove packages listed in exclude list
+ remove_all_excluded;
+ umount_all_mountloop;
+ use_gendistrib;
+## use_genhdlist2;
+ rpmcheck_launch;
+ remove_hdlist;
+ show_size;
+}
+
+1;
+
diff --git a/BCD/Resign.pm b/BCD/Resign.pm
new file mode 100644
index 0000000..4a0e02c
--- /dev/null
+++ b/BCD/Resign.pm
@@ -0,0 +1,56 @@
+package Resign;
+
+use strict;
+use Parallel::ForkManager;
+use File::Glob ':glob';
+use File::Basename;
+use Expect;
+
+use BCD::Common qw(:DEFAULT $isoconf $NB_FORK $rpmrc $pwd_file);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(resign_media);
+
+my $verbose;
+my $LOG="MEDIA -";
+my $color = "purple";
+
+my $password = `cat $pwd_file`;
+my $verbose = "0" ;
+
+sub print_info {
+ print_color("$LOG i will resign using info in those files: $rpmrc $pwd_file", $color);
+}
+
+sub resign_media {
+ print_info();
+ my $pm = new Parallel::ForkManager($NB_FORK);
+ my @list_path;
+ foreach my $media (@{$isoconf->{media}{list}}) {
+ push @list_path, $media->{destmedia};
+ }
+ foreach (@list_path) {
+ my @list_pkg = glob("$_/*.rpm");
+ my $count = @list_pkg;
+ print_color("$count transactions to do ... be patient !!!!", $color);
+ my $status = "0";
+ foreach my $pkg (@list_pkg) {
+ $pkg or next;
+ my $basename_pkg = basename($pkg);
+ $status++;
+ my $pid = $pm->start and next;
+ print("$basename_pkg ($status/$count)\n");
+ my $command = Expect->spawn("LC_ALL=C rpm --rcfile=$rpmrc --resign $pkg") or die "Couldn't start rpm: $!\n";
+ $command->log_stdout($verbose);
+ $command->expect(20, -re, 'Enter pass phrase:' => sub { print $command $password; });
+ $command->expect(undef);
+ $command->soft_close();
+ $pm->finish;
+ }
+ print_color("Waiting for the end of some signature...", $color);
+ $pm->wait_all_children;
+ print_color("all signature are done...", $color);
+ }
+}
+
+1;
diff --git a/BCD/Stagex.pm b/BCD/Stagex.pm
new file mode 100644
index 0000000..5791ae1
--- /dev/null
+++ b/BCD/Stagex.pm
@@ -0,0 +1,76 @@
+package BCD::Stagex;
+
+
+use strict;
+use XML::Simple;
+use File::Copy::Recursive qw(dircopy pathrm);
+use BCD::Common qw(:DEFAULT $isoconf $wd $name $arch $based_on $repo $version $builddir $error_color);
+
+our @ISA = qw(Exporter);
+our @EXPORT = qw(main_stagex);
+
+my $LOG="STAGEX -";
+my $color = "blue";
+my $installer_destdir = "$builddir/$isoconf->{installer}{defaultpath}";
+
+sub update_stage {
+-d $repo or print_color("$LOG $repo does not exists !", $color) and exit;
+
+my $installer_dir;
+if (!defined($isoconf->{installer}{fullpath})) {
+ $installer_dir = "$repo/$based_on/$arch/$isoconf->{installer}{defaultpath}";
+} else {
+ $installer_dir = "$isoconf->{installer}{fullpath}/install";
+}
+-d $installer_dir or print_color("$LOG $installer_dir does not exists !", $error_color) and exit;
+
+
+# print "$LOG remove old copy $builddir\n";
+# pathrm($builddir) or die $!;
+ print_color("$LOG copy $installer_dir to $installer_destdir", $color);
+ dircopy($installer_dir, $installer_destdir) or die $!;
+}
+
+sub update_advertising {
+if (defined($isoconf->{installer}{advertising}{fullpath})) {
+ print_color("$LOG copy $isoconf->{installer}{advertising}{fullpath} to $installer_destdir/extra/", $color);
+ system("rm -rf $installer_destdir/extra/advertising");
+ system("cp -a $isoconf->{installer}{advertising}{fullpath} $installer_destdir/extra/");
+ }
+}
+
+sub copy_dosutils {
+ print_color("$LOG copy of dosutils directory from $repo/$based_on/$arch to $builddir/../", $color);
+ if (-d "$repo/$based_on/$arch/dosutils") {
+ system("cp -a $repo/$based_on/$arch/dosutils $builddir/../");
+ system("cp -a $repo/$based_on/$arch/autorun.inf $builddir/../");
+ } else {
+ print_color("$LOG FAILED copy of dosutils directory from $repo/$based_on/$arch", $error_color);
+ }
+}
+
+sub copy_doc {
+ print_color("$LOG copy of doc directory from $repo/$based_on/$arch to $builddir/", $color);
+ if (-d "$repo/$based_on/$arch/doc") {
+ system("cp -a $repo/$based_on/$arch/doc $builddir/");
+ } else {
+ print_color("$LOG FAILED copy of doc directory from $repo/$based_on/$arch", $error_color);
+ }
+}
+
+sub patch_oem {
+ if (-f $isoconf->{installer}{patch}) {
+ print_color("$LOG copy $isoconf->{installer}{patch} to $installer_destdir/", $color);
+ system("cp -a $isoconf->{installer}{patch} $installer_destdir/");
+ }
+}
+
+sub main_stagex {
+ update_stage;
+ update_advertising;
+ copy_dosutils;
+ copy_doc;
+ patch_oem;
+}
+
+1;
diff --git a/bcd.pl b/bcd.pl
new file mode 100755
index 0000000..721f3a9
--- /dev/null
+++ b/bcd.pl
@@ -0,0 +1,9 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+# internal lib
+use BCD::Bcd;
+use BCD::Common;
+
+main_bcd();
diff --git a/bcd.pod b/bcd.pod
new file mode 100644
index 0000000..1eb0a30
--- /dev/null
+++ b/bcd.pod
@@ -0,0 +1,386 @@
+=head1 NAME
+
+bcd tools - A simple program to generate Mandriva's ISO
+
+=head1 SYNOPSIS
+
+bcd configuration.xml [options]
+
+=cut
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<First arg must be:>
+
+ The XML configuration file
+
+=item B<Second arg must be:>
+
+ stagex: update the stage1/stage2 in builddir
+ isolinux: update the isolinux in builddir
+ clean: clean the builddir and isodir
+ media: create the list of wanted packages, create all media in builddir,
+ link/copy packages in builddir/media, create the media.cfg,
+ and generate the hdtlist/synthesis
+ gendistrib: create the hdlists/synthesis in builddir (depends on the based_on tag)
+ list: list all media and list of input/exclude (from the xml conf file)
+ mediarepo: list all medias availables in the repositery
+ checkrepo: rpmcheck main hdlists in the repositery
+ all: run all stage in order to get an ISO
+ md5: create MD5 sum of the ISO
+ info: parse the configuration file (usefull to check the XML syntax)
+ iso: create the final ISO from the builddir
+
+=item B<extra arg:>
+
+ noiso: don't build the iso (md5, isohybrid) in case of 'all' process
+ copy: copy rpm instead of link them from the repositery
+
+=back
+
+=head1 EXAMPLES
+
+the folowing example will do all step to create an ISO:
+
+ bcd mdv-20091.xml all
+
+the following example will create the build dir without creating ISO:
+ bcd.pl mdv-20091.xml all noiso
+
+same as above but copy packages instead of link them from the repositery:
+ bcd.pl mdv-20091.xml all noiso copy
+
+the following will update the isolinux in the build directory:
+ bcd.pl mdv-20091.xml isolinux
+
+to check the main hdlist in the repositery with rpmcheck
+ bcd.pl mdv-20091.xml checkrepo
+
+clean the builddir and isodir
+ bcd.pl mdv-20091.xml clean
+
+=cut
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 Mandriva <aginies_@_mandriva.com>
+
+=cut
+
+=head1 DESCRIPTION
+
+BCD is used to create Mandriva ISO.
+features are:
+- configuration file is in XML format
+- use of genhdlist2 with file-deps
+- support the add of an isolinux entry
+- change the theme on all.rdz files
+- just need an input and an exclude file for package list
+- write media.cfg
+- support of custom rpmsrate of compssusers.pl
+- support of custom advertising
+- support of custom stage2
+- extra filter to remove doble packages (keep latest version)
+- all sub-media supported (updates, testing...)
+- create the iso HEADER
+- use of urpmi to calculate deps/conflicts/suggests
+- create an md5 file
+- create a product.id file
+- create a VERSION file
+- support of no-suggests option per media
+- support extra external media with hdlists
+
+=cut
+
+=head1 USER conf
+
+Your user must have some sudo root right to be able to use chroot, urpmi
+rm, mount umount tools. IE: for user plop in /etc/sudoers file
+
+ plop ALL=(root) NOPASSWD:/bin/mount, /bin/umount, \
+ /usr/sbin/chroot, \
+ /usr/sbin/urpmi, \
+ /usr/sbin/urpmi.addmedia, \
+ /usr/sbin/urpmi.removemedia, \
+ /bin/rm
+
+=cut
+
+=head1 LISTS
+
+input list:
+list of rpm needed on the CD. Those list should contains the name
+or the provides of a package. You may also use a CAT_XXX from the
+rpmsrate file, with the wheigth parameter.
+
+ ie: of lists/input_main
+ INSTALL 1
+ CAT_X 1
+ CAT_GNOME 1
+ CAT_AUDIO 1
+ aumix
+ task-lxde
+
+exclude list:
+list of unwanted packages on the CD. Be carreful to do not exclude mandatory packages
+or you CD will be unusable. Rpmcheck will report any bug in hdlists at the end of
+the 'media' step process. Packages listed in exclude list will be removed from the
+DVD at the end of the build process.
+
+extra-filter:
+list of RPM you want to compare to keep the latest one. Usefull for kernel
+and dkms release.
+
+=cut
+
+=head1 ISSUE
+
+ - if you want to build ISO for x86_64 you must used an x86_64 system (due to urpmi)
+ - can't build dual arch ISO
+ - if hdlist/synthesis are corrupted in your repositery, you can't build ISO
+
+=cut
+
+=head1 conf.xml
+
+Example of a commented conf.xml file. Keep in mind that most of those
+parameters are correct, and you don't need to change whole of them.
+Examples are available in this package, so please use one of them to
+base your configuration.
+
+You should only change those one:
+{nameid}
+{version}
+{arch}
+{repo}{path}
+{media}{list}*
+{iso}{header}*
+
+Fully commented file:
+---------------------
+first it's an xml file:
+ <?xml version='1.0'?>
+
+name of the product
+ <productname desc="The Linux product">
+
+identification of the product
+ <nameid>XtreemOS</nameid>
+
+based_on parameter define on wich version of Mandriva this product will be built.
+This parameter define if we need synthesis or hdlists (since 2009.1 only synthesis are needed)
+It will be use to get the path of the Mandriva repositery
+ <based_on>2009.0</based_on>
+
+Arch parameter is mandatory, it will be also used to get the path of the MDV repositery
+ <arch>i586</arch>
+
+path to the repositery
+ <repo desc="Where is the repositery of the distribution">
+ <path>/mnt/BIG/dis</path>
+ </repo>
+
+so the full path of the Mandriva repositery will be in our example
+ </mnt/BIG/dis/2009.0/i586>
+
+workdir is where you want to store the result of the build
+ <workdir desc="Where is my working dir">
+ <path>/home/xtreemos/build_bcd</path>
+ </workdir>
+
+basename of log files
+ <tocopy_file>tocopy_plop</tocopy_file>
+
+all Isolinux information
+ <isolinux desc="isolinux info">
+ <defaultpath>isolinux</defaultpath>
+
+if you want to point to a custom isolinux directory
+ <fullpath>/home/xtreemos/export_i386/isolinux</fullpath>
+
+if you want to add a entry in your isolinux.cfg
+ <!-- add hdt entry in syslinux.cfg -->
+ <entry name="hdt" desc="Main media">
+ <bin>/usr/lib/syslinux/hdt.c32</bin>
+ <label>hdt</label>
+ <kernel>hdt.c32</kernel>
+ <append>modules=modules.pci</append>
+ </entry>
+
+some section are mandatory to keep the array structure of the xml file
+ <!-- keep this entry to create an array ref -->
+ <entry></entry>
+
+if you want to copy extra files to the isolinux buildir
+ <tocopy name="pcimap">
+ <file>/lib/modules/2.6.31-server-2mnb/modules.pcimap</file>
+ </tocopy>
+ <tocopy name="ids">
+ <file>/usr/share/pci.ids</file>
+ </tocopy>
+ <tocopy></tocopy>
+ </isolinux>
+
+all information relatives to the installer (stage2)
+ <installer desc="path to the Mandriva installer (stage1/stage2)">
+ <defaultpath>install</defaultpath>
+
+if you want to use a custom installer
+ <fullpath>/home/xtreemos/export_i386</fullpath>
+
+path to custom advertising
+ <advertising>
+ <defaultpath>advertising</defaultpath>
+ <fullpath>/home/xtreemos/Build/pieces/advertising</fullpath>
+ </advertising>
+
+full path and name of your patch for stage2 to copy in the buildir/install directory
+ <patch>/home/xtreemos/Build/pieces/patch-oem.pl</patch>
+ </installer>
+
+theme to use to patch all.rdz file
+theme name will be used to install mandriva-release-THEMENAME and avoid
+problem of mixing theme on a same product
+ <!-- theme must be available to path altx/all.rdz files -->
+ <theme name="mandriva-release-Free">
+ <bootsplash>Mandriva-Free</bootsplash>
+ <bootsplash_path>/usr/share/bootsplash</bootsplash_path>
+ <gfxboot_path>/usr/share/gfxboot</gfxboot_path>
+ </theme>
+
+media section will defined wich media you want to use and you want to create on the DVD
+ <media desc="media to take into account to build the ISO">
+ <!-- WARNING this media must be named "Main" because main media is mandatory for all other media-->
+ <!-- Morever the "Main" media is always the Name use for an MDV repositery -->
+ <!-- futur feature will provide a way to specify another name for the basic repo of an MDV distribution -->
+ <!-- use the supp_media option if you needed to use media option of urpmi, usefull for external media
+ wich need main and contrib to be installed, use the urpmi syntax of \-\-media (no space, media separated by coma)
+ <media_supp>Main,Main Updates,Contrib,Contrib Updates</media_supp>-->
+ <list name="Main" desc="Main_media">
+ <!-- MANDATORY list of wanted packages on the iso -->
+ <input name="base">
+ <file>lists/input_main</file>
+ </input>
+ <input name="lang">
+ <file>lists/languages</file>
+ </input>
+ <!-- to create an array you must keep this even if it is empty -->
+ <input name="xos">
+ <file>lists/xos_list</file>
+ </input>
+
+you can use an external media, but this media must have a media_info directory
+you must use external media if this media is not available in the repositery.
+IE: restricted32 packages on a PowerPack 64bits product
+ <!-- external media repositery with hdlists -->
+ <external name="xos">
+ <fullpath_mediadir>/home/xtreemos/repo_xos/2009.0/i586/media/xtreemos/release</fullpath_mediadir>
+ </external>
+
+Packages unwated on the DVD, they will be removed at the end of the installation process
+ <!-- MANDATORY list of unwanted packages on the iso -->
+ <exclude name="exclude">
+ <file>lists/exclude_main</file>
+ </exclude>
+ <!-- to create an array you must keep this even if it is empty -->
+ <exclude>
+ </exclude>
+
+switch nosuggest options to yes if you don't want to use RPMS's suggests
+ <!-- nosuggests options should be yes or no -->
+ <nosuggests>no</nosuggests>
+
+I will use the media name "mediadir" and put it in the directory media/'destmedia' on the DVD
+ <!-- will be taken in {repo}{version}{arch}/media -->
+ <mediadir>main</mediadir>
+ <destmedia>main</destmedia>
+
+where to find the pubkey in the repositery (the path will be media/'mediadir'/'pubkey')
+ <pubkey>release/media_info/pubkey</pubkey>
+
+if you want to use backports, testing or updates sub-media, set option to yes, note: release media should be mandatory
+ <release>yes</release>
+ <updates>yes</updates>
+ <backport>no</backport>
+ <testing>no</testing>
+ </list>
+ <!-- keep this entry to create an array ref -->
+ <list></list>
+ </media>
+
+all media_info informations are in this section
+ <mediainfo desc="All files relatives to media_info dir">
+
+version will be used to generate a good media.cfg files (we don't use hdlits.cz since 2009.1 release)
+ <version>2009.0</version>
+
+use 'fullpath' parameter to use custom files
+ <!-- set fullpath if you want to use an files in a non MDV repositery -->
+ <fullpath>/home/xtreemos/Build/pieces</fullpath>
+ <mediainfo_dir>media/media_info</mediainfo_dir>
+ <rpmsrate>rpmsrate</rpmsrate>
+ <compssusers>compssUsers.pl</compssusers>
+ <filedeps>file-deps</filedeps>
+
+if you want to add an urpmi options to install packages
+ <urpmi_option>-a</urpmi_option>
+
+if you want to do some extra filter to keep latest release of a packages on the DVD
+ <filter>lists/extra-filter</filter>
+
+media.cfg options
+ <askmedia desc="add for other media ?">
+ <todo>yes</todo>
+ </askmedia>
+ <suppl desc="add an external media ?">
+ <todo>yes</todo>
+ </suppl>
+ <xmlinfo>
+ <todo>no</todo>
+ </xmlinfo>
+ </mediainfo>
+
+ISO section
+ <iso>
+
+tag name and some extra parameters
+ <tag>rc1</tag>
+ <minor>0</minor>
+ <subversion>1</subversion>
+ <product>Download</product>
+ <branch>Devel</branch>
+ <type>basic</type>
+ <!-- dual arch not yet supported -->
+ <dualarch>no</dualarch>
+ <!-- SIZE is not YET USED !!! -->
+ <size>700</size>
+ <!-- media.cfg will be stored on genisoimage->{builddir}/{nameid}/{arch} -->
+ <mediacfg>media/media_info/media.cfg</mediacfg>
+ <hdlist>yes</hdlist>
+ <synthesis>yes</synthesis>
+
+info used by the genisoimage tool
+ <header desc="Iso header info">
+ <systemid>XtreemOS Linux</systemid>
+ <volumeid>XOS-2.0-i586</volumeid>
+ <volumesetid>XtreemOS Linux - 2.0 - i586 DVD </volumesetid>
+ <publisherid>XtreemOS</publisherid>
+ <datapreparer>XtreemOS-Linux</datapreparer>
+ <applicationid>XtreemOS Linux - 2.0</applicationid>
+ <copyrightid>XtreemOS Linux</copyrightid>
+ </header>
+
+genisoimage paramater
+ <genisoimage desc="iso generation tool">
+ <options>-f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 </options>
+ <bootcat>isolinux/boot.cat</bootcat>
+ <!-- builddir and destdir will always use the workdir -->
+ <builddir>build</builddir>
+ <isodir>iso</isodir>
+ </genisoimage>
+ </iso>
+ </productname>
+
+=cut
diff --git a/bcd.xml b/bcd.xml
new file mode 100644
index 0000000..bb5a51b
--- /dev/null
+++ b/bcd.xml
@@ -0,0 +1,183 @@
+<?xml version='1.0'?>
+
+<productname desc="The Linux product">
+ <nameid>mandriva-linux-free</nameid>
+ <!-- you must specify on wich distrib this iso will be built -->
+ <based_on>2010.1</based_on>
+ <!-- -->
+ <arch>i586</arch>
+ <repo desc="Where is the repositery of the distribution">
+ <path>/mnt/ken/dis/</path>
+ </repo>
+ <workdir desc="Where is my working dir">
+ <path>/home/plop/build_bcd</path>
+ </workdir>
+ <tocopy_file>tocopy_plop</tocopy_file>
+ <isolinux desc="isolinux info">
+ <defaultpath>isolinux</defaultpath>
+ <!--<fullpath></fullpath>-->
+ <!-- add hdt entry in syslinux.cfg -->
+ <entry name="hdt" desc="Main media">
+ <bin>/usr/lib/syslinux/hdt.c32</bin>
+ <label>hdt</label>
+ <kernel>hdt.c32</kernel>
+ <append>modules=modules.pci</append>
+ </entry>
+ <!-- keep this entry to create an array ref -->
+ <entry></entry>
+ <tocopy name="pcimap">
+ <file>/lib/modules/2.6.32-server-1mnb/modules.pcimap</file>
+ </tocopy>
+ <tocopy name="ids">
+ <file>/usr/share/pci.ids</file>
+ </tocopy>
+ <tocopy></tocopy>
+ </isolinux>
+ <installer desc="path to the Mandriva installer (stage1/stage2)">
+ <defaultpath>install</defaultpath>
+ <!--<fullpath></fullpath>-->
+ <advertising>
+ <defaultpath>advertising</defaultpath>
+ <!--<fullpath></fullpath>-->
+ </advertising>
+ </installer>
+
+ <!-- theme must be available to path altx/all.rdz files -->
+ <theme name="mandriva-release-Free">
+ <bootsplash>Mandriva-Free</bootsplash>
+ <bootsplash_path>/usr/share/bootsplash</bootsplash_path>
+ <gfxboot_path>/usr/share/gfxboot</gfxboot_path>
+ </theme>
+
+ <media desc="media to take into account to build the ISO">
+ <!-- WARNING thie media must be named "Main" because main media is mandatory for all other media-->
+ <!-- Morever the "Main" media is always the Name use for an MDV reposiery -->
+ <!-- futur feature will provide a way to specify another name for the basic repo of an MDV distribution -->
+ <list name="Main" desc="Main media">
+ <!-- MANDATORY list of wanted packages on the iso -->
+ <input name="base">
+ <file>lists/input_main</file>
+ </input>
+ <!-- to create an array you must keep this even if it is empty -->
+ <input name="extra">
+ <file>lists/input_main_extra</file>
+ </input>
+ <!-- external media repositery with hdlists -->
+ <external name="corpo">
+ <fullpath_mediadir>/home/plop/pieces/corpo</fullpath_mediadir>
+ </external>
+ <!-- MANDATORY list of unwanted packages on the iso -->
+ <exclude name="exclude">
+ <file>lists/exclude_main</file>
+ </exclude>
+ <!-- to create an array you must keep this even if it is empty -->
+ <exclude name="extra">
+ <file>lists/exclude_main_extra</file>
+ </exclude>
+ <!-- nosuggests options should be yes or no -->
+ <nosuggests>no</nosuggests>
+ <!-- will be taken in {repo}{version}{arch}/media -->
+ <mediadir>main</mediadir>
+ <destmedia>main</destmedia>
+ <!--
+ <fullpath_mediadir>/home/plop/iso/final/t/i586/media/main</fullpath_mediadir>
+ -->
+ <pubkey>release/media_info/pubkey</pubkey>
+ <release>yes</release>
+ <updates>yes</updates>
+ <backport>no</backport>
+ <testing>no</testing>
+ </list>
+ <list name="Contrib" desc="Contrib media">
+ <!-- Supp media needed to install packages from this media, usefull for external media
+ wich need main and contrib, use the urpmi syntax of \-\-media (no space, media separated by coma)
+ <media_supp>Main,Main Updates,Contrib,Contrib Updates</media_supp>
+ -->
+ <input name="base">
+ <file>lists/input_contrib</file>
+ </input>
+ <!-- to create an array you must keep this even if it is empty -->
+ <input name="extra">
+ <file>lists/input_contrib_extra</file>
+ </input>
+ <!-- MANDATORY list of unwanted packages on the iso -->
+ <exclude name="exclude">
+ <file>lists/exclude_contrib</file>
+ </exclude>
+ <!-- to create an array you must keep this even if it is empty -->
+ <exclude name="extra">
+ <file>lists/exclude_contrib_extra</file>
+ </exclude>
+ <!-- nosuggests options should be yes or no -->
+ <nosuggests>no</nosuggests>
+ <!-- will be taken in {repo}{version}{arch}/media -->
+ <mediadir>contrib</mediadir>
+ <destmedia>contrib</destmedia>
+ <!--
+ <fullpath_mediadir>/home/plop/build/2009.1/100/i586/media/contrib</fullpath_mediadir>
+ -->
+ <pubkey>release/media_info/pubkey</pubkey>
+ <release>yes</release>
+ <updates>yes</updates>
+ <backport>no</backport>
+ <testing>no</testing>
+ </list>
+ <!-- keep this entry to create an array ref -->
+ <list></list>
+ </media>
+
+ <mediainfo desc="All files relatives to media_info dir">
+ <!-- since 2009.1 we dont need hdlist anymore -->
+ <version>2010.1</version>
+ <!-- set fullpath if youy want to use an files in a non MDV repositery -->
+ <!--<fullpath></fullpath>-->
+ <mediainfo_dir>media/media_info</mediainfo_dir>
+ <rpmsrate>rpmsrate</rpmsrate>
+ <compssusers>compssUsers.pl</compssusers>
+ <filedeps>file-deps</filedeps>
+ <filter>lists/extra-filter</filter>
+ <urpmi_option>-a</urpmi_option>
+ <askmedia desc="add for other media ?">
+ <todo>yes</todo>
+ </askmedia>
+ <suppl desc="add an external media ?">
+ <todo>yes</todo>
+ </suppl>
+ <xmlinfo>
+ <todo>no</todo>
+ </xmlinfo>
+ </mediainfo>
+
+ <iso>
+ <tag>alpha1</tag>
+ <minor>0</minor>
+ <subversion>1</subversion>
+ <product>Download</product>
+ <branch>Cooker</branch>
+ <type>basic</type>
+ <!-- dual arch not yet supported -->
+ <dualarch>no</dualarch>
+ <!-- SIZE is not YET USED !!! -->
+ <size>700</size>
+ <!-- media.cfg will be stored on genisoimage->{builddir}/{nameid}/{arch} -->
+ <mediacfg>media/media_info/media.cfg</mediacfg>
+ <hdlist>yes</hdlist>
+ <synthesis>yes</synthesis>
+ <header desc="Iso header info">
+ <systemid>Mandriva Linux</systemid>
+ <volumeid>FREE-20101-i586</volumeid>
+ <volumesetid>Mandriva Linux - 2010 Spring (Free) - i586 DVD</volumesetid>
+ <publisherid>Mandriva</publisherid>
+ <datapreparer>Mandriva-Linux</datapreparer>
+ <applicationid>Mandriva Linux - 2010 Spring (Free)</applicationid>
+ <copyrightid>Mandriva Linux</copyrightid>
+ </header>
+ <genisoimage desc="iso generation tool">
+ <options>-f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 </options>
+ <bootcat>isolinux/boot.cat</bootcat>
+ <!-- builddir and destdir will always use the workdir -->
+ <builddir>build</builddir>
+ <isodir>iso</isodir>
+ </genisoimage>
+ </iso>
+</productname>
diff --git a/compare_idx_32_64_dual.sh b/compare_idx_32_64_dual.sh
new file mode 100755
index 0000000..763ccfd
--- /dev/null
+++ b/compare_idx_32_64_dual.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+WDIR="/home/installeur/mymkcd-cs5/build_bcd/build/"
+
+D32="$WDIR/MES5-dual-5.1/i586"
+D64="$WDIR/MES5-dual-5.1/x86_64"
+
+cat $D32/*.idx | grep -v "main/lib" | cut -d " " -f 2 | perl -pi -e "s/i586|x86_64|i386//g" > /tmp/idx_d32
+cat $D64/*.idx | grep -v "main/lib64" | cut -d " " -f 2 | perl -pi -e "s/i586|x86_64|i386//g" > /tmp/idx_d64
+
+diff -ru /tmp/idx_d32 /tmp/idx_d64
+
diff --git a/create_dual.sh b/create_dual.sh
new file mode 100755
index 0000000..fc56dc5
--- /dev/null
+++ b/create_dual.sh
@@ -0,0 +1,76 @@
+#!/bin/sh +xv
+
+
+./bcd.pl dual.xml all copy noiso
+./bcd.pl dual64.xml all copy noiso
+
+rm -vf $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586/install/images/boot.iso
+rm -vf $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/install/images/boot.iso
+
+cp -vf $HOME/mymkcd-cs5/pieces/updates/64/all.rdz $HOME/mymkcd-cs5/pieces/updates/64/vmlinuz $HOME/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/isolinux/alt0
+cp -vf $HOME/mymkcd-cs5/pieces/updates/64/bootlogo $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/isolinux
+cp -vf $HOME/mymkcd-cs5/pieces/updates/64/mdkinst.sqfs $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/install/stage2
+cp -vf $HOME/mymkcd-cs5/pieces/updates/64/compssUsers.pl.dual $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/media/media_info/compssUsers.pl
+cp -vf $HOME/mymkcd-cs5/pieces/updates/64/rpmsrate $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64/media/media_info
+
+cp -vf $HOME/mymkcd-cs5/pieces/updates/32/all.rdz $HOME/mymkcd-cs5/pieces/updates/32/vmlinuz $HOME/build_bcd/build/MES5-dual-5.1-i586/i586/isolinux/alt0
+cp -vf $HOME/mymkcd-cs5/pieces/updates/32/bootlogo $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586/isolinux
+cp -vf $HOME/mymkcd-cs5/pieces/updates/32/mdkinst.sqfs $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586/install/stage2
+cp -vf $HOME/mymkcd-cs5/pieces/updates/32/compssUsers.pl.dual $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586/media/media_info/compssUsers.pl
+cp -vf $HOME/mymkcd-cs5/pieces/updates/32/rpmsrate $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586/media/media_info
+
+
+sync
+
+du -sh $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586
+du -sh $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64
+
+rm -rf $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+rm -rvf $HOME/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1
+mkdir -p $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+mkdir -p $HOME/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1
+
+cp -af $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-i586/i586 $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+cp -af $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1-x86_64/x86_64 $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+
+cp -af /mnt/pieces/pieces/2010.0/i586/dosutils $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+cp -af /mnt/pieces/pieces/2010.0/i586/autorun.inf $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1
+
+cd $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/x86_64/media/main
+
+for i in *noarch.rpm
+do
+ if [ -f "../../../i586/media/main/$i" ];then
+ echo $i
+ echo "erase package $i"
+ rm -vf $i
+ echo "link with the i586 one"
+ ln -sf ../../../i586/media/main/$i .
+ else
+ echo "no ../../../i586/media/main/$i package"
+ fi
+done
+
+
+cp -avf $HOME/bcd/compssUsers.pl $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/i586/media/media_info/compssUsers.pl
+cp -avf $HOME/bcd/compssUsers.pl $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/x86_64/media/media_info/compssUsers.pl
+
+
+genisoimage -f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 \
+ -A 'Mandriva Linux - MES5' \
+ -publisher 'Mandriva' \
+ -sysid 'Mandriva Linux' \
+ -p 'Mandriva-Linux BCD' \
+ -volset 'Mandriva Linux - MES5 - DUAL CD' \
+ -V 'MES5-DUAL' \
+ -o '/home/installeur/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1/MES5-dual-5.1.iso' \
+ -b i586/isolinux/isolinux.bin \
+ -boot-info-table \
+ $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/
+
+cd $HOME/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1/
+md5sum MES5-dual-5.1.iso > MES5-dual-5.1.iso.md5
+sha1sum MES5-dual-5.1.iso > MES5-dual-5.1.iso.sha1
+cat $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/i586/pkg-5.1-Official.idx > $HOME/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1/MES5-dual-5.1.idx
+cat $HOME/mymkcd-cs5/build_bcd/build/MES5-dual-5.1/x86_64/pkg-5.1-Official.idx >> $HOME/mymkcd-cs5/build_bcd/iso/MES5-dual-5.1/MES5-dual-5.1.idx
+
diff --git a/create_dvd.sh b/create_dvd.sh
new file mode 100755
index 0000000..8d3a4ea
--- /dev/null
+++ b/create_dvd.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+path32=/home/installeur/mymkcd-cs5/build_bcd/build/MES5-corporate-5.1-i586
+path64=/home/installeur/mymkcd-cs5/build_bcd/build/MES5-corporate-5.1-x86_64
+updates=$HOME/mymkcd-cs5/pieces/updates
+
+case $1 in
+
+ 64) ./bcd.pl mes5_x86_64.xml all noiso
+cp -vf $updates/64/all.rdz $updates/64/vmlinuz $path64/x86_64/isolinux/alt0
+cp -vf $updates/64/bootlogo $path64/x86_64/isolinux
+cp -vf $updates/64/mdkinst.sqfs $path64/x86_64/install/stage2
+
+ ./bcd.pl mes5_x86_64.xml iso
+ ;;
+
+ 32) ./bcd.pl mes5.xml all noiso
+cp -vf $updates/32/all.rdz $updates/32/vmlinuz $path32/i586/isolinux/alt0
+cp -vf $updates/32/bootlogo $path32/i586/isolinux
+cp -vf $updates/32/mdkinst.sqfs $path32/i586/install/stage2
+ ./bcd.pl mes5.xml iso
+ ;;
+
+ *) echo "Enter one argument, this parameter should be either 32 or 64"
+
+esac
+
+
diff --git a/dual.xml b/dual.xml
new file mode 100644
index 0000000..264fed2
--- /dev/null
+++ b/dual.xml
@@ -0,0 +1,136 @@
+<?xml version='1.0'?>
+
+<productname desc="The Linux product">
+ <nameid>MES5-dual</nameid>
+ <nb_fork>10</nb_fork>
+ <!-- you must specify on wich distrib this iso will be built -->
+ <based_on>2009.0</based_on>
+ <!-- -->
+ <arch>i586</arch>
+ <repo desc="Where is the repositery of the distribution">
+ <path>/data</path>
+ </repo>
+ <workdir desc="Where is my working dir">
+ <path>/home/installeur/mymkcd-cs5/build_bcd</path>
+ </workdir>
+ <tocopy_file>tocopy_plop</tocopy_file>
+ <isolinux desc="isolinux info">
+ <defaultpath>isolinux</defaultpath>
+ <!--<fullpath></fullpath>-->
+ <!-- add hdt entry in syslinux.cfg -->
+ <entry>
+ </entry>
+ <!-- keep this entry to create an array ref -->
+ <entry></entry>
+ </isolinux>
+
+ <installer desc="path to the Mandriva installer (stage1/stage2)">
+ <defaultpath>install</defaultpath>
+ <!--<fullpath></fullpath> -->
+ </installer>
+
+ <!-- theme must be available to path altx/all.rdz files -->
+ <theme name="Mandriva-release-Server">
+ <theme>mandriva-theme-Corporate</theme>
+ <bootsplash>Mandriva-Corporate</bootsplash>
+ <bootsplash_path>/usr/share/bootsplash</bootsplash_path>
+ <gfxboot_path>/usr/share/gfxboot</gfxboot_path>
+ </theme>
+
+ <media desc="media to take into account to build the ISO">
+ <!-- WARNING this media must be named "Main" because main media is mandatory for all other media-->
+ <!-- Morever the "Main" media is always the Name use for an MDV reposiery -->
+ <!-- futur feature will provide a way to specify another name for the basic repo of an MDV distribution -->
+ <list name="Main" desc="Main media">
+ <!-- MANDATORY list of wanted packages on the iso -->
+ <input name="k32">
+ <file>lists/kernel32</file>
+ </input>
+ <input name="basesystem_common">
+ <file>lists/basesystem_mini</file>
+ </input>
+ <input name="lang">
+ <file>lists/languages_mini</file>
+ </input>
+ <exclude name="theme-corpo">
+ <file>lists/exclude-theme-corpo</file>
+ </exclude>
+ <exclude name="exclude">
+ <file>lists/exclude_mini</file>
+ </exclude>
+ <exclude name="exclude32">
+ <file>lists/exclude_mini32</file>
+ </exclude>
+ <exclude>
+ </exclude>
+ <!-- nosuggests options should be yes or no -->
+ <nosuggests>yes</nosuggests>
+ <!-- will be taken in {repo}{version}{arch}/media -->
+ <mediadir>main</mediadir>
+ <destmedia>main</destmedia>
+ <!--
+ <fullpath_mediadir>/home/plop/iso/final/t/i586/media/main</fullpath_mediadir>
+ -->
+ <pubkey>release/media_info/pubkey</pubkey>
+ <release>yes</release>
+ <updates>yes</updates>
+ <backport>no</backport>
+ <testing>no</testing>
+ </list>
+ <!-- keep this entry to create an array ref -->
+ <list></list>
+ </media>
+
+ <mediainfo desc="All files relatives to media_info dir">
+ <version>5.1</version>
+ <mediainfo_dir>media/media_info</mediainfo_dir>
+ <rpmsrate>rpmsrate</rpmsrate>
+ <compssusers>compssUsers.pl</compssusers>
+ <filedeps>file-deps</filedeps>
+ <filter>lists/extra-filter</filter>
+ <restricted>no</restricted>
+ <urpmi_option>-p </urpmi_option>
+ <askmedia desc="add for other media ?">
+ <todo>no</todo>
+ </askmedia>
+ <suppl desc="add an external media ?">
+ <todo>no</todo>
+ </suppl>
+ <xmlinfo>
+ <todo>no</todo>
+ </xmlinfo>
+ </mediainfo>
+
+ <iso>
+ <tag>Official</tag>
+ <minor>1</minor>
+ <subversion>1</subversion>
+ <product>Corporate</product>
+ <branch>Official</branch>
+ <type>basic</type>
+ <!-- dual arch not yet supported -->
+ <dualarch>no</dualarch>
+ <!-- SIZE is not YET USED !!! -->
+ <size>700</size>
+ <!-- media.cfg will be stored on genisoimage->{builddir}/{nameid}/{arch} -->
+ <mediacfg>media/media_info/media.cfg</mediacfg>
+ <hdlist>yes</hdlist>
+ <synthesis>yes</synthesis>
+ <header desc="Iso header info">
+ <systemid>Mandriva Linux</systemid>
+ <volumeid>MES5-Corporate-i586</volumeid>
+ <volumesetid>Mandriva Linux - MES5 - i586</volumesetid>
+ <publisherid>Mandriva</publisherid>
+ <datapreparer>Mandriva-Linux BCD</datapreparer>
+ <applicationid>Mandriva Linux - MES5</applicationid>
+ <copyrightid>Mandriva Linux</copyrightid>
+ </header>
+ <genisoimage desc="iso generation tool">
+ <options>-f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 </options>
+ <bootcat>isolinux/boot.cat</bootcat>
+ <!-- builddir and destdir will always use the workdir -->
+ <builddir>build</builddir>
+ <isodir>iso</isodir>
+ </genisoimage>
+ </iso>
+</productname>
diff --git a/dual64.xml b/dual64.xml
new file mode 100644
index 0000000..26809b4
--- /dev/null
+++ b/dual64.xml
@@ -0,0 +1,133 @@
+<?xml version='1.0'?>
+
+<productname desc="The Linux product">
+ <nameid>MES5-dual</nameid>
+ <nb_fork>10</nb_fork>
+ <!-- you must specify on wich distrib this iso will be built -->
+ <based_on>2009.0</based_on>
+ <!-- -->
+ <arch>x86_64</arch>
+ <repo desc="Where is the repositery of the distribution">
+ <path>/data</path>
+ </repo>
+ <workdir desc="Where is my working dir">
+ <path>/home/installeur/mymkcd-cs5/build_bcd</path>
+ </workdir>
+ <tocopy_file>tocopy_plop</tocopy_file>
+ <isolinux desc="isolinux info">
+ <defaultpath>isolinux</defaultpath>
+ <!--<fullpath></fullpath>-->
+ <!-- add hdt entry in syslinux.cfg -->
+ <entry>
+ </entry>
+ <!-- keep this entry to create an array ref -->
+ <entry></entry>
+ </isolinux>
+
+ <installer desc="path to the Mandriva installer (stage1/stage2)">
+ <defaultpath>install</defaultpath>
+ <!--<fullpath></fullpath> -->
+ </installer>
+
+ <!-- theme must be available to path altx/all.rdz files -->
+ <theme name="Mandriva-release-Server">
+ <theme>mandriva-theme-Corporate</theme>
+ <bootsplash>Mandriva-Corporate</bootsplash>
+ <bootsplash_path>/usr/share/bootsplash</bootsplash_path>
+ <gfxboot_path>/usr/share/gfxboot</gfxboot_path>
+ </theme>
+
+ <media desc="media to take into account to build the ISO">
+ <!-- WARNING this media must be named "Main" because main media is mandatory for all other media-->
+ <!-- Morever the "Main" media is always the Name use for an MDV reposiery -->
+ <!-- futur feature will provide a way to specify another name for the basic repo of an MDV distribution -->
+ <list name="Main" desc="Main media">
+ <!-- MANDATORY list of wanted packages on the iso -->
+ <input name="k64">
+ <file>lists/kernel64</file>
+ </input>
+ <input name="basesystem_common">
+ <file>lists/basesystem_mini</file>
+ </input>
+ <input name="lang">
+ <file>lists/languages_mini</file>
+ </input>
+ <exclude name="theme-corpo">
+ <file>lists/exclude-theme-corpo</file>
+ </exclude>
+ <exclude name="exclude">
+ <file>lists/exclude_mini</file>
+ </exclude>
+ <exclude>
+ </exclude>
+ <!-- nosuggests options should be yes or no -->
+ <nosuggests>yes</nosuggests>
+ <!-- will be taken in {repo}{version}{arch}/media -->
+ <mediadir>main</mediadir>
+ <destmedia>main</destmedia>
+ <!--
+ <fullpath_mediadir>/home/plop/iso/final/t/i586/media/main</fullpath_mediadir>
+ -->
+ <pubkey>release/media_info/pubkey</pubkey>
+ <release>yes</release>
+ <updates>yes</updates>
+ <backport>no</backport>
+ <testing>no</testing>
+ </list>
+ <!-- keep this entry to create an array ref -->
+ <list></list>
+ </media>
+
+ <mediainfo desc="All files relatives to media_info dir">
+ <version>5.1</version>
+ <mediainfo_dir>media/media_info</mediainfo_dir>
+ <rpmsrate>rpmsrate</rpmsrate>
+ <compssusers>compssUsers.pl</compssusers>
+ <filedeps>file-deps</filedeps>
+ <filter>lists/extra-filter</filter>
+ <restricted>no</restricted>
+ <urpmi_option>-p </urpmi_option>
+ <askmedia desc="add for other media ?">
+ <todo>no</todo>
+ </askmedia>
+ <suppl desc="add an external media ?">
+ <todo>no</todo>
+ </suppl>
+ <xmlinfo>
+ <todo>no</todo>
+ </xmlinfo>
+ </mediainfo>
+
+ <iso>
+ <tag>Official</tag>
+ <minor>1</minor>
+ <subversion>1</subversion>
+ <product>Corporate</product>
+ <branch>Official</branch>
+ <type>basic</type>
+ <!-- dual arch not yet supported -->
+ <dualarch>no</dualarch>
+ <!-- SIZE is not YET USED !!! -->
+ <size>700</size>
+ <!-- media.cfg will be stored on genisoimage->{builddir}/{nameid}/{arch} -->
+ <mediacfg>media/media_info/media.cfg</mediacfg>
+ <hdlist>yes</hdlist>
+ <synthesis>yes</synthesis>
+ <header desc="Iso header info">
+ <systemid>Mandriva Linux</systemid>
+ <volumeid>MES5-Corporate-x86_64</volumeid>
+ <volumesetid>Mandriva Linux - MES5 - x86_64</volumesetid>
+ <publisherid>Mandriva</publisherid>
+ <datapreparer>Mandriva-Linux BCD</datapreparer>
+ <applicationid>Mandriva Linux - MES5</applicationid>
+ <copyrightid>Mandriva Linux</copyrightid>
+ </header>
+ <genisoimage desc="iso generation tool">
+ <options>-f -r -J -hide-rr-moved -nobak -cache-inodes -no-emul-boot -boot-load-size 4 </options>
+ <bootcat>isolinux/boot.cat</bootcat>
+ <!-- builddir and destdir will always use the workdir -->
+ <builddir>build</builddir>
+ <isodir>iso</isodir>
+ </genisoimage>
+ </iso>
+</productname>