Changeset 1408 in ProjectBuilder
- Timestamp:
- Feb 6, 2012, 9:37:38 AM (13 years ago)
- Location:
- devel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.conf
r1403 r1408 396 396 mkbmbootcmds linux = perl,mt,awk,gawk,dd,grep,uname,df,loadkeys,pidof,gzip,klogd,syslogd,rsyslogd,syslog-ng,mount,mount.nfs,mount.nfs4,sshfs,mount.fuse,fusermount,ssh,ulockmgr_server,mount.cifs,mount.cifs3,mount.smb,mount.smb3,mount.smbfs,mount.smbfs3,mount.ntfs,mount.ntfs-3g,MAKEDEV,udev.static,udevsend,udevd,hwup,path_id,scsi_tur,udeadm,udevstart.static,udev_volume_id,start_udev,udevstart,create_static_dev_nodes,scsi_id,insmod,lsmod,modprobe,mdadm,mdassemble,raidstart,multipath,dmsetup,kpartx,dmraid,mpath_prio_alua,mpath_wait,mpath_ctl,mpath_prio_emc,mpath_prio_hds_modular,mpath_prio_netapp,mpath_prio_ontap,mpath_prio_rdac,mpath_prio_tpc,ping,ifconfig,ip,route,dhclient,dhcpcd, 397 397 398 # Where is your kernel file - optional if you want to really be sure of what is used 399 #mkbmkerneldir linux = /boot 400 # Where is your kernel directory 401 mkbmkerneldir linux = /boot 402 #mkbmkerneldir linux = /boot/efi 403 # What is the regular expression to find the kernel file 404 mkbmkernelnamere linux = ^linu|^vmlinu|^xen 405 398 406 # Files to add on the boot media to support a full working system 399 407 mkbmbasefiles linux = /etc/modules.conf,/etc/fstab,/etc/hosts,/etc/host.conf,/etc/resolv.conf,/etc/hosts.allow,/etc/hosts.deny,/etc/nsswitch.conf,/usr/share/misc/file/magic,/usr/share/file/magic,/usr/share/file/magic.mgc … … 405 413 # 406 414 # To support debug 407 mkbm bbgfiles linux =408 mkbm bbgcmds linux = ldd,strace,valgrind,dmidecode,lsusb,lshw,lspci,ethtool409 mkbm bbgdirs linux = /usr/lib/valgrind,/usr/lib64/valgrind415 mkbmdbgfiles linux = 416 mkbmdbgcmds linux = ldd,strace,valgrind,dmidecode,lsusb,lshw,lspci,ethtool 417 mkbmdbgdirs linux = /usr/lib/valgrind,/usr/lib64/valgrind 410 418 411 419 # Where are the ISO bootloader for this OS -
devel/pb-modules/etc/pb.conf.pod
r1386 r1408 12 12 =head1 SYNOPSIS 13 13 14 Those files have the same format, which is near from a aperl hash structure:14 Those files have the same format, which is near from a perl hash structure: 15 15 keyword key = value1[,value2,...] 16 16 … … 111 111 Example: filteredfiles mindi = rootfs/sbin/init,mindi,install.sh,doc/mindi.8 112 112 113 =item B<logcmd> 114 115 Nature: Mandatory 116 Key: project (as defined in the -p option or PBPROJ environment variable) 117 Value: internal (the application then handles the logging of what it finds useful) or the name of an application to launch to log context (e.g. sos, cfg2html, ...). 118 Conffile: pb 119 Example: logcmd pbmkbm = sos 120 121 =item B<logcmds> 122 123 Nature: Optional 124 Key: project (as defined in the -p option or PBPROJ environment variable) 125 Value: In case the B<logcmd> command is internal, a coma separated list of the commands whose trace execution is to be captured in order to log context. 126 Conffile: pb 127 Example: logcmds pbmkbm = mount,lsmod,esxcfg-module -l,df -T 128 129 =item B<logfiles> 130 131 Nature: Optional 132 Key: project (as defined in the -p option or PBPROJ environment variable) 133 Value: In case the B<logcmd> command is internal, a coma separated list of the files to capture in order to log context. 134 Conffile: pb 135 Example: logfiles pbmkbm = /etc/raidtab,/proc/cmdline,/proc/swaps 136 137 =item B<logopt> 138 139 Nature: Optional 140 Key: project (as defined in the -p option or PBPROJ environment variable) 141 Value: In case the B<logcmd> command is not internal, the options of the B<logcmd> application to launch to log context 142 Conffile: pb 143 Example: logcmd pbmkbm = --all 144 145 =item B<mkbmbootcmds> 146 147 Nature: Mandatory 148 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 149 Value: coma separated list of commands to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target). Their actual path is deduced from the PATH variable. 150 Conffile: pb 151 Example: mkbmbootcmds linux = perl,awk,gawk,dd,grep,uname 152 153 =item B<mkbmbootdirs> 154 155 Nature: Mandatory 156 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 157 Value: coma separated list of directories to be copied from the original OS to the target boot media tree (works recursively on the target). 158 Conffile: pb 159 Example: mkbmbootdirs linux = /etc/ssh,/etc/udev,/etc/mdadm 160 161 =item B<mkbmbootfiles> 162 163 Nature: Mandatory 164 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 165 Value: coma separated list of files to be copied from the original OS to the target boot media tree (works recursively for directory creation on the target). 166 Conffile: pb 167 Example: mkbmbootfiles linux = /etc/mdadm.conf,/etc/raidtab,/etc/modprobe.conf 168 169 =item B<mkbmkerneldir> 170 171 Nature: Mandatory 172 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 173 Value: path of the directory containing your kernel. 174 Conffile: pb 175 Example: mkbmkerneldir linux = /boot 176 177 =item B<mkbmkernelfile> 178 179 Nature: Optional 180 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 181 Value: full path of the your kernel. 182 Conffile: pb 183 Example: mkbmkernelfile linux = /boot/vmlinuz-specific 184 185 =item B<mkbmkernelnamere> 186 187 Nature: Mandatory 188 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 189 Value: Perl Regular Expression allowing to find OS kernel names in the B<kerneldir> directory. 190 Conffile: pb 191 Example: mkbmkerneldir linux = ^linu|^vmlinu|^xen 192 113 193 =item B<mkbmpath> 114 194 … … 118 198 Conffile: pb 119 199 Example: mkbmpath default = /var/cache/pbmkbm 200 201 =item B<mkbmtargetdirs> 202 203 Nature: Mandatory 204 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 205 Value: coma separated list of empty directory paths to be created on the target boot media. 206 Conffile: pb 207 Example: mkbmtargetdirs linux = /tmp,/dev 120 208 121 209 =item B<namingtype> -
devel/pb-modules/lib/ProjectBuilder/Base.pm
r1402 r1408 393 393 394 394 # On linux can also use /proc/sys/kernel/osrelease 395 my $rel = `uname - m`;395 my $rel = `uname -r`; 396 396 chomp($rel); 397 397 return($rel); -
devel/pbmkbm/bin/pbmkbm
r1403 r1408 306 306 $lcmd = pb_check_req($lcmd,1); 307 307 if (not defined $lcmd) { 308 pb_log(1,"INFO: command $ lcmd (in $c)doesn't exist\n");308 pb_log(1,"INFO: command $c doesn't exist\n"); 309 309 pb_log(1,"------------------\n"); 310 310 next; … … 405 405 406 406 # Create the directory structure needed on the target dir 407 my ($tdirs,$bdirs,$bfiles,$bcmds) = pb_distro_get_param($pbos,pb_conf_get("mkbmtargetdirs","mkbmbootdirs","mkbmbootfiles","mkbmbootcmds") ;407 my ($tdirs,$bdirs,$bfiles,$bcmds) = pb_distro_get_param($pbos,pb_conf_get("mkbmtargetdirs","mkbmbootdirs","mkbmbootfiles","mkbmbootcmds")); 408 408 # Create empty dirs for these 409 409 foreach my $d (split(/,/,$tdirs)) { 410 $targettree ->{$d} = "emptydir";410 $targettree{$d} = "emptydir"; 411 411 } 412 412 # And copy dirs for those 413 413 foreach my $d (split(/,/,$bdirs)) { 414 414 if (-d $d) { 415 $targettree->{$d} = "dir"; 415 $targettree{$d} = "dir"; 416 } elsif (-l $d) { 417 $targettree{$d} = "link"; 416 418 } else { 417 pb_log( 419 pb_log(1,"INFO: Directory $d doesn't exist\n"); 420 } 418 421 } 419 422 foreach my $f (split(/,/,$bfiles)) { 420 $targettree->{$d} = "dir"; 421 } 423 $targettree{$f} = "file"; 424 } 425 pb_log(2,"INFO: Target Tree is now: ".Dumper(%targettree)."\n"); 422 426 # Once the environment is made, add what is needed for this boot media to it. 423 427 # Keyboard … … 425 429 # List of commands 426 430 # List of dependencies 427 # Kernel 431 # Kernel - We use 2 objects, the running kernel and the target kernel which could be different 432 my %rkernel; 433 my %tkernel; 434 pb_mkbm_find_kernel(\%rkernel); 428 435 # Initrd 429 436 # init … … 471 478 } 472 479 480 sub pb_mkbm_find_kernel { 481 482 my $kernel = shift; 483 484 $kernel->is_xen = undef; 485 # See if we're booted from a Xen kernel 486 # From http://wiki.xensource.com/xenwiki/XenCommonProblems#head-26434581604cc8357d9762aaaf040e8d87b37752 487 if ( -f "/proc/xen/capabilities") { 488 # It's a Xen kernel 489 pb_log(2,"INFO: We found a Xen Kernel running\n"); 490 } 491 492 my $kfile = pb_distro_get_param($pbos,pb_conf_get_if("mkbmkernelfile")); 493 if ((defined $kfile) && ($kfile ne "")) { 494 pb_log(1,"INFO: You specified your kernel as $kfile, so using it\n"); 495 $kernel->file = $kfile; 496 } else { 497 $kernel->dir = pb_distro_get_param($pbos,pb_conf_get("mkbmkerneldir")); 498 die "ERROR: The mkbmkerneldir content ($kernel->dir) doesn't refer to a directory\n"if (! -d $kernel->dir); 499 pb_log(1,"INFO: Analyzing directory $kernel->dir to find your kernel"); 500 $kernel->namere = pb_distro_get_param($pbos,pb_conf_get("mkbmkernelnamere")); 501 } 502 503 # TODO: Look at a better way to find the name of the kernel we run 504 # look at /proc/sys/kernel/bootloader_type /proc/sys/kernel/bootloader_version 505 # to have a better guess 506 my $dh; 507 die "ERROR: Unable to open the mkbmkerneldir content ($kernel->dir)" if (! opendir($dh,$kernel->dir)); 508 while (readdir $dh) { 509 # Skip non-files 510 next if ((! -f $_) && (! -l $_)); 511 # Skip files not correpsonding to the RE planned 512 next if ($_ !~ /$kernel->namere/); 513 #my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat("$f/$_"); 514 } 515 closedir($dh); 516 $kernel->release = pb_get_osrelase(); 517 } 518 473 519 sub pb_mkbm_create_media { 474 520
Note:
See TracChangeset
for help on using the changeset viewer.