… | |
… | |
29 | 1.3 |
29 | 1.3 |
30 | - output of pbcdedit elements --json has changed, as it didn't |
30 | - output of pbcdedit elements --json has changed, as it didn't |
31 | take the reorganisation by classes fully into account. |
31 | take the reorganisation by classes fully into account. |
32 | - json schema bumped to 3. |
32 | - json schema bumped to 3. |
33 | - new "bcd-device" and "bcd-legacy-device" subcommands. |
33 | - new "bcd-device" and "bcd-legacy-device" subcommands. |
|
|
34 | - implement --json option for lsblk. |
34 | |
35 | |
35 | 1.2 Fri Aug 16 00:20:41 CEST 2019 |
36 | 1.2 Fri Aug 16 00:20:41 CEST 2019 |
36 | - bcde element names now depend on the bcd object type they are in, |
37 | - bcde element names now depend on the bcd object type they are in, |
37 | also affects "elements" output. |
38 | also affects "elements" output. |
38 | - json schema bumped to 2. |
39 | - json schema bumped to 2. |
… | |
… | |
143 | =item C<parse> F<path> I<instructions...> |
144 | =item C<parse> F<path> I<instructions...> |
144 | |
145 | |
145 | Same as C<edit>, above, except it doesn't save the data store again. Can |
146 | Same as C<edit>, above, except it doesn't save the data store again. Can |
146 | be useful to extract some data from it. |
147 | be useful to extract some data from it. |
147 | |
148 | |
148 | =item C<lsblk> |
149 | =item C<lsblk> [C<--json>] |
149 | |
150 | |
150 | On a GNU/Linux system, you can get a list of partition device descriptors |
151 | On a GNU/Linux system, you can get a list of partition device descriptors |
151 | using this command - the external C<lsblk> command is required, as well as |
152 | using this command - the external C<lsblk> command is required, as well as |
152 | a mounted C</sys> file system. |
153 | a mounted C</sys> file system. |
153 | |
154 | |
154 | The output will be a list of all partitions in the system and C<partition> |
155 | The output will be a list of all partitions in the system and C<partition> |
155 | descriptors for GPT and both C<legacypartition> and C<partition> |
156 | descriptors for GPT and both C<legacypartition> and C<partition> |
156 | descriptors for MBR partitions. |
157 | descriptors for MBR partitions. |
|
|
158 | |
|
|
159 | With C<--json> it will print similar informationm as C<lsblk --json>, but |
|
|
160 | with extra C<bcd_device> and C<bcd_legacy_device> attributes. |
157 | |
161 | |
158 | =item C<bcd-device> F<path> |
162 | =item C<bcd-device> F<path> |
159 | |
163 | |
160 | Tries to find the BCD device element for the given device, which currently |
164 | Tries to find the BCD device element for the given device, which currently |
161 | must be a a partition of some kind. Prints the C<partition=> descriptor as |
165 | must be a a partition of some kind. Prints the C<partition=> descriptor as |
… | |
… | |
2598 | "import-regf" => sub { |
2602 | "import-regf" => sub { |
2599 | regf_save shift, rdjson; |
2603 | regf_save shift, rdjson; |
2600 | }, |
2604 | }, |
2601 | |
2605 | |
2602 | lsblk => sub { |
2606 | lsblk => sub { |
|
|
2607 | my $json = $_[0] eq "--json"; |
|
|
2608 | |
2603 | my $lsblk = lsblk; |
2609 | my $lsblk = lsblk; |
2604 | |
2610 | |
|
|
2611 | if ($json) { |
|
|
2612 | prjson $lsblk; |
|
|
2613 | } else { |
2605 | printf "%-10s %-8.8s %-6.6s %-3s %s\n", "DEVICE", "LABEL", "FSTYPE", "PT", "DEVICE DESCRIPTOR"; |
2614 | printf "%-10s %-8.8s %-6.6s %-3s %s\n", "DEVICE", "LABEL", "FSTYPE", "PT", "DEVICE DESCRIPTOR"; |
2606 | for my $dev (@$lsblk) { |
2615 | for my $dev (@$lsblk) { |
2607 | for my $bcd ($dev->{bcd_device}, $dev->{bcd_legacy_device}) { |
2616 | for my $bcd ($dev->{bcd_device}, $dev->{bcd_legacy_device}) { |
2608 | printf "%-10s %-8.8s %-6.6s %-3s %s\n", |
2617 | printf "%-10s %-8.8s %-6.6s %-3s %s\n", |
2609 | $dev->{path}, $dev->{label}, $dev->{fstype}, $dev->{pttype}, $bcd |
2618 | $dev->{path}, $dev->{label}, $dev->{fstype}, $dev->{pttype}, $bcd |
2610 | if $bcd; |
2619 | if $bcd; |
|
|
2620 | } |
2611 | } |
2621 | } |
2612 | } |
2622 | } |
2613 | }, |
2623 | }, |
2614 | |
2624 | |
2615 | "bcd-device" => sub { |
2625 | "bcd-device" => sub { |