- Timestamp:
- Feb 3, 2012, 12:17:04 AM (13 years ago)
- Location:
- devel
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.conf
r1374 r1402 343 343 344 344 # Where to store packages downloaded temporarily by rpmbootstrap 345 rbscachedir default = /var/cache/rpmbootstrap 345 cachedir rpmbootstrap = /var/cache/rpmbootstrap 346 cachedir pbmkbm = /var/cache/rpmbootstrap 346 347 347 348 # Options to pass to rpmbootstrap command. By default keep downloaded packages … … 377 378 verpmtype pbmkbm = rpmbootstrap 378 379 vedebtype pbmkbm = debbootstrap 380 381 # Log command to use to have a sufficient understanding of the environment in which we oprate 382 logcmd pbmkbm = internal 383 # internal or sos, or cfg2html, or ... 384 logopt pbmkbm = --options 385 logfiles pbmkbm = /etc/raidtab,/proc/cmdline,/proc/swaps,/proc/partitions,/proc/filesystems,/proc/lvm,/dev/mapper 386 logcommands pbmkbm = mount,lsmod,esxcfg-module -l,df -T 387 388 # Directories to create on the target media 389 targetdir pbmkbm = /bin,/usr/bin,/tmp 390 # Files to embed on the target media 391 mandatoryfiles pbmkbm = 392 optionalfiles pbmkbm = 393 394 # Where are the ISO bootloader for this OS 395 mkbmisobl linux = /usr/lib/syslinux/isolinux.bin,/usr/lib64/syslinux/isolinux.bin 396 mkbmkbd mageia = /usr/lib/kbd 379 397 380 398 # pb install dependencies per distro … … 502 520 oscmd rpmbootstrap = rpm,rpm2cpio,wget 503 521 #oscmdopt rpmbootstrap = 504 # 522 oscmd pbmkbm = 523 oscmdopt pbmkbm = 524 # 525 # If busybox, which one is used (from mindi, or native, ...) 526 ospathcmd-busybox default = /usr/lib/mindi/rootfs/bin/busybox 505 527 506 528 # Some path for commands may defer from one system to another -
devel/pb-modules/lib/ProjectBuilder/Base.pm
r1400 r1402 393 393 394 394 # On linux can also use /proc/sys/kernel/osrelease 395 return(chomp(`uname -r`)); 395 my $rel = `uname -m`; 396 chomp($rel); 397 return($rel); 396 398 } 397 399 … … 480 482 } else { 481 483 pb_log(2,"OK\n"); 482 return($found); 483 } 484 } 485 return($found); 484 486 } 485 487 -
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r1212 r1402 560 560 561 561 This function gets the OS context passed as parameter and return the corresponding distribution hash 562 If passed undef or "" then auto-detects 562 563 563 564 =cut … … 569 570 my $pbos; 570 571 571 if ( defined $os) {572 if ((defined $os) && ($os ne "")) { 572 573 my ($name,$ver,$darch) = split(/-/,$os); 573 574 pb_log(0,"Bad format for $os") if ((not defined $name) || (not defined $ver) || (not defined $darch)) ; -
devel/pb/bin/pb
r1401 r1402 544 544 if (defined $opts{'t'}) { 545 545 $pbtarget = $opts{'t'}; 546 # GetOptions may create an empty string, we use internally undef for that type of target547 if ($pbtarget eq "") {548 $pbtarget = undef;549 }550 546 } 551 547 … … 3999 3995 4000 3996 # Get list of distributions for which we need to generate build files if no target 4001 if (not defined ($pbtarget)) {3997 if (not defined $pbtarget) { 4002 3998 my @pt = pb_conf_get_if("vmlist","velist","rmlist"); 4003 3999 if (defined $pt[0]->{$ENV{'PBPROJ'}}) { -
devel/pbmkbm/bin/pbmkbm
r1352 r1402 16 16 use File::Basename; 17 17 use File::Copy; 18 use POSIX qw(strftime); 19 18 20 use ProjectBuilder::Version; 19 21 use ProjectBuilder::Base; … … 235 237 } 236 238 pb_log_init($pbdebug, $pbLOG); 239 pb_log(1,"$appname Version $projectbuilderver-$projectbuilderrev\n"); 240 my @date = pb_get_date(); 241 my $pbdate = strftime("%Y-%m-%d %H:%M:%S", @date); 242 243 pb_log(1,"Start: $pbdate\n"); 237 244 238 245 # Get VE name … … 256 263 # Check for command requirements 257 264 # 258 my ($req,$opt) = pb_conf_get_if(" mkbmcmd","mkbmcmdopt");265 my ($req,$opt) = pb_conf_get_if("oscmd","oscmdopt"); 259 266 pb_check_requirements($req,$opt,$appname); 260 267 … … 265 272 # Where is our build target directory 266 273 # 267 268 274 if (not defined $targetdir) { 269 275 $targetdir = "/var/cache/pbmkbm"; 270 276 my ($vestdpath) = pb_conf_get("mkbmpath"); 271 277 $targetdir = "$vestdpath->{'default'}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}" if (defined $vestdpath->{'default'}); 272 } 273 274 die pb_log(0,"No target-dir specified and no default mkbmpath found in $ENV{'PBETC'}\n") if (not defined $targetdir); 278 pb_log(1,"No target-dir specified, using $targetdir\n"); 279 } 275 280 276 281 # Point to the right subdir and create it if needed 277 282 pb_mkdir_p($targetdir) if (! -d $targetdir); 278 283 284 # Log information on our system 285 # TODO: this should be put in a subfunction 286 my ($logcmd) = pb_conf_get("logcmd"); 287 my ($logopt) = pb_conf_get_if("logopt"); 288 # check that the command is there first and then use it. 289 if ($logcmd->{$appname} ne "internal") { 290 $logcmd = pb_check_req($logcmd->{$appname},1); 291 if (not defined $logcmd) { 292 pb_log(1,"INFO: command $logcmd->{$appname} doesn't exist. No log report is available\n"); 293 } else { 294 my $c = $logcmd->{$appname}; 295 $c .= " $logopt->{$appname}" if (defined $logopt->{$appname}); 296 pb_system("$c","Creating a log report of your system"); 297 } 298 } else { 299 # We provide our own internal log reporter as a std one isn't found 300 my ($lcmds,$lfiles) = pb_conf_get_if("logcommands","logfiles"); 301 pb_log(1,"------------------\n"); 302 if (defined $lcmds->{$appname}) { 303 foreach my $c (split(/,/,$lcmds->{$appname})) { 304 my $lcmd = $c; 305 $lcmd =~ s/ .*$//; 306 $lcmd = pb_check_req($lcmd,1); 307 if (not defined $lcmd) { 308 pb_log(1,"INFO: command $lcmd (in $c) doesn't exist\n"); 309 pb_log(1,"------------------\n"); 310 next; 311 } 312 pb_log(1,"Execution of $c\n"); 313 pb_log(1,"------------------\n"); 314 pb_system($c,"",1); 315 pb_log(1,"------------------\n"); 316 } 317 } 318 if (defined $lfiles->{$appname}) { 319 foreach my $f (split(/,/,$lfiles->{$appname})) { 320 if (! -e $f) { 321 pb_log(1,"INFO: $f doesn't exist\n"); 322 pb_log(1,"------------------\n"); 323 next; 324 } 325 if (! -r $f) { 326 pb_log(1,"INFO: $f isn't readable\n"); 327 pb_log(1,"------------------\n"); 328 next; 329 } 330 if ((-f $f) || (-l $f)) { 331 if (! open(FILE,$f)) { 332 pb_log(1,"INFO: Unable to open $f\n"); 333 pb_log(1,"------------------\n"); 334 next; 335 } 336 pb_log(1,"Content of $f\n"); 337 pb_log(1,"------------------\n"); 338 while (<FILE>) { 339 pb_log(1,$_); 340 } 341 close(FILE); 342 pb_log(1,"------------------\n"); 343 } elsif (-d $f) { 344 my $dh; 345 if (! opendir($dh,$f)) { 346 pb_log(1,"INFO: Unable to opendir $f\n"); 347 pb_log(1,"------------------\n"); 348 next; 349 } 350 pb_log(1,"Content of directory $f\n"); 351 pb_log(1,"----------------------------\n"); 352 while (readdir $dh) { 353 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$f/$_"); 354 my $str = sprintf("%10s %2s %5s %5s %10s %14s %s",$mode,$ino,$uid,$gid,$size,$mtime,$_); 355 pb_log(1,"$str\n"); 356 } 357 closedir($dh); 358 pb_log(1,"------------------\n"); 359 } else { 360 pb_log(1,"INFO: $f is special\n"); 361 pb_log(1,"------------------\n"); 362 } 363 } 364 } 365 } 279 366 280 367 # Now the preparation is over, we need to do something useful :-) … … 287 374 pb_mkbm_create_media(); 288 375 376 @date = pb_get_date(); 377 $pbdate = strftime("%Y-%m-%d %H:%M:%S", @date); 378 379 pb_log(1,"End: $pbdate\n"); 380 289 381 sub pb_mkbm_create_content { 290 382 … … 294 386 $opts{'b'} = "ve" if (not defined $opts{'b'}); 295 387 388 # Hash of target content 389 # atribute could be, copy, remove, link, dir 390 my %targettree; 391 296 392 if ($opts{'b'} eq "ve") { 297 # Use existing toolsto create a good VE !393 # Use project-builder VE mecanism to create a good VE ! 298 394 pb_ve_launch($ENV{'PBV'},1); 299 395 } elsif ($opts{'b'} eq "native") { 300 396 # Use native tools to create a good VE ! 397 } elsif ($opts{'b'} eq "drakut") { 398 # Use drakut to create a good VE ! 399 } elsif ($opts{'b'} eq "busybox") { 400 # Use busybox to create a good VE ! 401 pb_mkbm_create_busybox_ve(\%targettree); 301 402 } else { 302 403 die "Unknown method $opts{'b'} used to create the media content"; 303 404 } 304 405 406 # Create the directory structure needed on the target dir 407 $targettree->{"/bin"} = "dir"; 408 305 409 # Once the environment is made, add what is needed for this boot media to it. 410 # Keyboard 411 # Terminfo 412 # List of commands 413 # List of dependencies 414 # Kernel 415 # Initrd 416 # init 417 # BootLoader and its configuration 418 # Additional data files coming from a potential caller (MondoRescue e.g. with fstab, LVM, mountlist, ...) 419 } 420 421 sub pb_mkbm_create_busybox_ve { 422 423 my $tgtree = shift; 424 425 # First, check which are the supported command in that version of busybox 426 # and create the links for it in the target VE 427 428 my $busycmd = pb_distro_get_param($pbos,pb_conf_get("ospathcmd-busybox")); 429 open(BUSY,"$busycmd |") || die "Unable to execute $busycmd"; 430 my $cmdlist = 0; 431 while (<BUSY>) { 432 pb_log(3,"busybox line : $_"); 433 chomp($_); 434 # After these words, we have the list of functions, so trigger their analysis 435 if ($_ =~ /defined functions:/) { 436 $cmdlist = 1; 437 next; 438 } 439 # Analyse the list of commands provided by that busybox (, separated) 440 if ($cmdlist == 1) { 441 pb_log(3,"Analyzing that busybox line\n"); 442 foreach my $c (split(/,/,$_)) { 443 $c =~ s/\s*//g; 444 # skip empty strings 445 next if ($c =~ /^$/); 446 my $c1 = pb_check_req($c,0); 447 if (defined $c1) { 448 $tgtree->{$c1} = "link:$busycmd"; 449 } else { 450 # When not found on the system, create the link under /usr/bin by default 451 $tgtree->{"/usr/bin/$c"} = "link:$busycmd"; 452 } 453 } 454 } 455 } 456 pb_log(2,"Target Tree is now: ".Dumper($tgtree)."\n"); 457 close(BUSY); 306 458 } 307 459 -
devel/pbmkbm/etc/pbmkbm.conf
r1341 r1402 12 12 mkbmmindep fedora-4 = MAKEDEV,SysVinit,audit-libs,basesystem,bash,beecrypt,bzip2-libs,chkconfig,coreutils,cracklib,cracklib-dicts,db4,device-mapper,e2fsprogs,elfutils-libelf,ethtool,expat,filesystem,findutils,gawk,gdbm,glib2,glibc,glibc-common,grep,info,initscripts,iproute,iputils,krb5-libs,libacl,libattr,libcap,libgcc,libidn,libselinux,libsepol,libstdc++,libtermcap,libxml2,libxml2-python,mingetty,mktemp,module-init-tools,ncurses,neon,net-tools,openssl,pam,pcre,popt,procps,psmisc,python,python-elementtree,python-sqlite,python-urlgrabber,readline,rpm,rpm-libs,rpm-python,sed,setup,shadow-utils,sqlite,sysklogd,termcap,tzdata,udev,util-linux,yum,zlib 13 13 14 # Where to store packages downloaded temporarily by rpmbootstrap 15 mkbmcachedir default = /var/cache/rpmbootstrap 14 # Commands needed on the underlying system 15 mkbmcmd pbmkbm = #tar,chmod,ls 16 mkbmcmdopt pbmkbm = #,cfghtml,wget,sudo,mv,gzip,rm,chroot,schroot,cp,chown,mkdir,cat,bash, 17 # 16 18 17 # Commands needed on the underlying system 18 mkbmcmd pb = tar,chmod,ls 19 mkbmcmdopt pb = rpmbuild,dpkg-buildpackage,rpm,dpkg,wget,sudo,apt-get,mv,gzip,ebuild,makepkg,pkgmk,pkgtrans,rm,rpmlint,lintian,chroot,schroot,cp,chown,debsign,qemu-img,qemu,kvm,rpmbootstrap,rinse,mock,debootstrap,mkdir,cat,ssh,scp,yum,bash,make,vi,ssh-keygen,svn,hg,cvs,git,svk,svn2cl,cvs2cl,urpmi 20 mkbmcmd rpmbootstrap = rpm,rpm2cpio,wget 21 #mkbmcmdopt rpmbootstrap = 22 # 19 # Directories to create on the target media 20 mkbmtargetdir pbmkbm = /bin,/usr/bin,/tmp 21 # Files to embed on the target media 22 mkbmtargetfiles pbmkbm = 23 24 # Where are the ISO bootloader for this OS 25 mkbmisobl linux = /usr/lib/syslinux/isolinux.bin,/usr/lib64/syslinux/isolinux.bin 26 mkbmkbd mageia = /usr/lib/kbd 23 27 24 28 # How do you want to install content in your VE (pkg or file) -
devel/rpmbootstrap/bin/rpmbootstrap
r1326 r1402 257 257 # Get the package list to download, store them in a cache directory 258 258 # 259 my ($rbscachedir) = pb_conf_get_if(" rbscachedir");259 my ($rbscachedir) = pb_conf_get_if("cachedir"); 260 260 my ($pkgs,$mirror) = pb_distro_get_param($pbos,pb_conf_get("rbsmindep","rbsmirrorsrv")); 261 261 262 262 my $cachedir = "/var/cache/rpmbootstrap"; 263 263 $cachedir = $rbscachedir->{'default'} if (defined $rbscachedir->{'default'}); 264 $cachedir = $rbscachedir->{$appname} if (defined $rbscachedir->{$appname}); 264 265 265 266 # Point to the right subdir and create it if needed
Note:
See TracChangeset
for help on using the changeset viewer.