Skip to content

Commit 65a9f36

Browse files
Create README.md
1 parent 925a7e7 commit 65a9f36

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# kernel_cmdline_extractor
2+
Outputs data to stdout that is associated with a label i.e shredos="xxxxx xxxxx xxxx" from /proc/cmdline. Specically written for ShredOS but could be used elsewhere.
3+
4+
Given a specific label from the kernel command line (cat /proc/cmdline) as input, this program will read the kernel command line
5+
searching for the specified label and output the associated data. If the data associated with the label is double quoted then the
6+
data can include embedded whitespace characters.
7+
8+
If not quoted then only the first word after the = symbol is read.
9+
10+
### syntax:
11+
kernel_cmdline_extractor label
12+
13+
### Examples:
14+
If the kernel command line is as follows
15+
```
16+
linux /boot/shredos console=tty3 loglevel=3 shredos="--autopoweroff --nousb" loadkeys=uk
17+
```
18+
then specifing shredos as the argument to kernel_cmdline_extractor would output ..
19+
```
20+
#> kernel_cmdline_extractor shredos
21+
#> --autopoweroff --nousb
22+
```
23+
For options that can be used with shredos, see nwipe's help, i.e. nwipe --help
24+
25+
In addition the keyboard could be set from the data associated with the label loadkeys
26+
```
27+
#> kernel_cmdline_extractor loadkeys
28+
#> uk
29+
```
30+
#### Return codes:
31+
* 0 = success
32+
* 1 = unable to open /proc/cmdline
33+
* 2 = unable to read /proc/cmdline
34+
* 3 = No label specified by user
35+
* 4 = label not found in kernel command line

0 commit comments

Comments
 (0)