ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/pbcdedit/pbcdedit
(Generate patch)

Comparing pbcdedit/pbcdedit (file contents):
Revision 1.35 by root, Thu Aug 15 08:46:27 2019 UTC vs.
Revision 1.36 by root, Thu Aug 15 08:53:14 2019 UTC

19# along with this program. If not, see <https://www.gnu.org/licenses/>. 19# along with this program. If not, see <https://www.gnu.org/licenses/>.
20# 20#
21 21
22use 5.016; # numerous features need 5.14, __SUB__ needs 5.16 22use 5.016; # numerous features need 5.14, __SUB__ needs 5.16
23 23
24our $VERSION = '1.0'; 24our $VERSION = '1.1';
25our $JSON_VERSION = 1; # the versiobn of the json objects generated by this program 25our $JSON_VERSION = 1; # the versiobn of the json objects generated by this program
26 26
27=head1 NAME 27=head1 NAME
28 28
29 pbcdedit - portable boot configuration data (BCD) store editor 29 pbcdedit - portable boot configuration data (BCD) store editor
222successfully boot any post-XP version of Windows (suitable C<device> and 222successfully boot any post-XP version of Windows (suitable C<device> and
223C<osdevice> values, of course): 223C<osdevice> values, of course):
224 224
225 { 225 {
226 "{bootmgr}" : { 226 "{bootmgr}" : {
227 "resumeobject" : "{45b547a7-8ca6-4417-9eb0-a257b61f35b4}" 227 "default" : "{45b547a7-8ca6-4417-9eb0-a257b61f35b4}"
228 }, 228 },
229 229
230 "{45b547a7-8ca6-4417-9eb0-a257b61f35b1}" : { 230 "{45b547a7-8ca6-4417-9eb0-a257b61f35b1}" : {
231 "type" : "application::osloader", 231 "type" : "application::osloader",
232 "description" : "Windows Boot", 232 "description" : "Windows Boot",
359 359
360This represents a single GUID value wrapped in curly braces. It is used a 360This represents a single GUID value wrapped in curly braces. It is used a
361lot to refer from one BCD object to other one. 361lot to refer from one BCD object to other one.
362 362
363For example, The C<{bootmgr}> object might refer to a resume boot option 363For example, The C<{bootmgr}> object might refer to a resume boot option
364using C<resumeobject>: 364using C<default>:
365 365
366 "resumeobject" : "{7ae02178-821d-11e7-8813-1c872c5f5ab0}", 366 "default" : "{7ae02178-821d-11e7-8813-1c872c5f5ab0}",
367 367
368Human readable aliases are used and allowed. 368Human readable aliases are used and allowed.
369 369
370=item guid list 370=item guid list
371 371
736Similar to C<get>, but sets the element to the given I<value> instead. 736Similar to C<get>, but sets the element to the given I<value> instead.
737 737
738Example: change the bootmgr default too 738Example: change the bootmgr default too
739C<{b097d2ad-bc00-11e9-8a9a-525400123456}>: 739C<{b097d2ad-bc00-11e9-8a9a-525400123456}>:
740 740
741 pbcdedit edit BCD set "{bootmgr}" resumeobject "{b097d2ad-bc00-11e9-8a9a-525400123456}" 741 pbcdedit edit BCD set "{bootmgr}" default "{b097d2ad-bc00-11e9-8a9a-525400123456}"
742 742
743=item C<eval> I<perlcode> 743=item C<eval> I<perlcode>
744 744
745This takes the next argument, interprets it as Perl code and 745This takes the next argument, interprets it as Perl code and
746evaluates it. This allows you to do more complicated modifications or 746evaluates it. This allows you to do more complicated modifications or
769 769
770 pbcdedit edit BCD eval 'say $BCD->{$DEFAULT}{description}' 770 pbcdedit edit BCD eval 'say $BCD->{$DEFAULT}{description}'
771 771
772The example given for C<set> could be expressed like this: 772The example given for C<set> could be expressed like this:
773 773
774 pbcdedit edit BCD eval '$BCD->{$DEFAULT}{resumeobject} = "{b097d2ad-bc00-11e9-8a9a-525400123456}"' 774 pbcdedit edit BCD eval '$BCD->{"{bootmgr}"{default} = "{b097d2ad-bc00-11e9-8a9a-525400123456}"'
775 775
776=item C<do> I<path> 776=item C<do> I<path>
777 777
778Similar to C<eval>, above, but instead of using the argument as perl code, 778Similar to C<eval>, above, but instead of using the argument as perl code,
779it loads the perl code from the given file and executes it. This makes it 779it loads the perl code from the given file and executes it. This makes it
1492 0x25000002 => 'testmix', 1492 0x25000002 => 'testmix',
1493 0x26000003 => 'cacheenable', 1493 0x26000003 => 'cacheenable',
1494 0x26000003 => 'customsettings', 1494 0x26000003 => 'customsettings',
1495 0x23000003 => 'default', 1495 0x23000003 => 'default',
1496 0x25000003 => 'failurecount', 1496 0x25000003 => 'failurecount',
1497 0x23000003 => 'resumeobject',
1498 0x26000004 => 'failuresenabled', 1497 0x26000004 => 'failuresenabled',
1499 0x26000004 => 'pae', 1498 0x26000004 => 'pae',
1500 0x26000004 => 'stampdisks', 1499 0x26000004 => 'stampdisks',
1501 0x25000004 => 'testtofail', 1500 0x25000004 => 'testtofail',
1502 0x25000004 => 'timeout', 1501 0x25000004 => 'timeout',
2263} 2262}
2264 2263
2265sub bcd_edit { 2264sub bcd_edit {
2266 my ($path, $bcd, @insns) = @_; 2265 my ($path, $bcd, @insns) = @_;
2267 2266
2268 my $default = $bcd->{"{bootmgr}"}{resumeobject}; 2267 my $default = $bcd->{"{bootmgr}"}{default};
2269 2268
2270 # prepare "officially visible" variables 2269 # prepare "officially visible" variables
2271 local $pbcdedit::PATH = $path; 2270 local $pbcdedit::PATH = $path;
2272 local $pbcdedit::BCD = $bcd; 2271 local $pbcdedit::BCD = $bcd;
2273 local $pbcdedit::DEFAULT = $default; 2272 local $pbcdedit::DEFAULT = $default;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines