-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathddiskit.1
1841 lines (1837 loc) · 52.1 KB
/
ddiskit.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" Code block begin/end. Borrowed from strace.1.
.de CS
.sp
.in +4n
.nf
.ft CW
..
.de CE
.ft R
.fi
.in
.sp
..
.\" Like .OP, but with ellipsis at the end in order to signify that option
.\" can be provided multiple times. Based on .OP definition in groff's
.\" an-ext.tmac.
.de OM
. ie \\n(.$-1 \
. RI "[\fB\\$1\fR" "\ \\$2" "]...\&"
. el \
. RB "[" "\\$1" "]...\&"
..
.TH DDISKIT "1"
.SH NAME
ddiskit \- Red Hat tool for Driver Update Disk creation
.SH SYNOPSIS
.SY ddiskit
.OP -h
.OP -vvv
.OP -qQ
.OP -p PROFILE
.OP -R RES_DIR
.OP -T TEMPLATE_DIR
.OP -P PROFILE_DIR
.OP -d
.OP -o DUMP_CONFIG_NAME
.OM -C \fIKEY\fR=\fIVALUE\fR
.I ACTION
.OM \fIACTION_OPTIONS\fR
.YS
.SH DESCRIPTION
.B ddiskit
(pronounced dee-dis-kit)
aids and simplifies the creation of (back-ported) out-of-tree kernel module
RPMs and Driver Update Disks containing them.
These RPMs and DUDs are deemed suitable for using with distributions based on
Red Hat Enterprise Linux.
This version of
.B ddiskit
supports RHEL 7 and backward-compatible with RHEL 6.
.B ddiskit
assumes some workflow which is described in the
.I USAGE EXAMPLE
section.
It is tailored to the process used for developing and releasing
Driver Update Disks, and, while it can be used for creating driver packages for
RHEL-based distributions in general, it also worth considering other tools
for the similar purpose, like
.BR dkms "(8) or " akmods (1).
.SH OPTIONS
Please refer to the
.I Configuration generation
section for the description of "configuration option name" and "default value"
fields, and to the
.I ACTIONS
section for the description of the actions mentioned.
.SS General options
.TP
\fB-h\fR, \fB--help\fR
Print a list of options.
.B ddiskit
will exit after this action, ignoring the remainder of the command line.
.TP
\fB-v\fR, \fB--verbosity\fR
Increase output verbosity by 1.
Value of 1 means verbose output (it toggles printing of most of executed
commands and all warnings), and value of 2 is useful for debugging
(it enables printing of all the executed commands output, actions,
and messages).
Value of 3 further increases output verbosity of issued
.BR rpm (1)
commands.
.IP
Configuration option name:
.I defaults.verbosity
.br
Default value: 0
.TP
\fB-p\fR \fIPROFILE\fR, \fB--profile\fR \fIPROFILE\fR
Configuration profile to use.
Please refer to the
.I Configuration generation
section for the additional information about profiles.
.IP
Configuration option name:
.I defaults.profile
.br
Default value: none; "default" is provided in package configuration
.TP
\fB-R\fR \fIRES_DIR\fR, \fB--res-dir\fR \fIRES_DIR\fR
Resources directory.
Used as a base of evaluation for template and profile directory paths.
.IP
Configuration option name:
.I defaults.res_dir
.br
Default value: none; "/usr/share/ddiskit/" is a hard-coded default.
.TP
\fB-T\fR \fITEMPLATE_DIR\fR, \fB--template-dir\fR \fITEMPLATE_DIR\fR,
Templates directory, used as a base for searching for spec or module
configuration templates.
Please refer to the
.I File path evaluation
section for the information regarding template file path resolution.
.IP
Configuration option name:
.I defaults.template_dir
.br
Default value: none; "{res_dir}/templates" is a hard-coded default.
.TP
\fB-P\fR \fIPROFILE_DIR\fR, \fB--profile-dir\fR \fIPROFILE_DIR\fR
Profiles directory, used as a base for searching for profiles.
Please refer to the
.I File path evaluation
section for the information regarding profile file path resolution.
.IP
Configuration option name:
.I defaults.profile_dir
.br
Default value: none; "{res_dir}/profiles" is a hard-coded default.
.TP
\fB-d\fR, \fB--dump-config\fR
Dump the derived configuration after performing the action.
.IP
Configuration option name:
.I defaults.dump_config
.br
Default value: False
.TP
\fB-o\fR \fIDUMP_CONFIG_NAME\fR, \fB--dump-config-name\fR \fIDUMP_CONFIG_NAME\fR
Path to the file targeted for the configuration dump.
.IP
Configuration option name:
.I defaults.dump_config_name
.br
Default value: none; "{config}.generated" is a hard-coded default.
.TP
\fB-q\fR, \fB--quilt-enable\fR
Enable quilt support.
Please refer to the
.I QUILT INTEGRATION
section for the information regarding quilt integration.
The option sets
.I defaults.quilt_support
configuration option to
.BR True .
.TP
\fB-Q\fR, \fB--quilt-disable\fR
Disable quilt support.
The option sets
.I defaults.quilt_support
configuration option to
.BR False .
.TP
\fB-C\fR \fIKEY\fR=\fIVALUE\fR, \fB--config-option\fR \fIKEY\fR=\fIVALUE\fR
Override arbitrary configuration option that have the name
.I KEY
with
.IR VALUE .
The
.I KEY
should follow the "{\fB[\fR\fIsection_name\fR.\fB]\fR\fIkey_name\fR}" syntax,
and \fIdefaults\fR section is assumed in case \fIsection_name\fR part is
omitted.
The argument can be used multiple times in order to override multiple options.
.\"
.SS Options for prepare_sources action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-t\fR \fICONFIG_TEMPLATE\fR, \fB--config-template\fR \fICONFIG_TEMPLATE\fR
Configuration file template.
Please refer to the
.I File path evaluation
section for the information regarding configuration template file path
resolution.
.IP
Configuration option name:
.I defaults.config_template
.br
Default value: none; "config" is a hard-coded default.
.TP
\fB-g\fR \fIGIT_DIRECTORY\fR, \fB--git-dir\fR \fIGIT_DIRECTORY\fR
Path to
.B .git
directory containing repository from where source files should be checked out.
.IP
Configuration option name:
.I defaults.git_dir
.br
Default value: none
.TP
\fB-r\fR \fIREVISION\fR, \fB--git-revision\fR \fIREVISION\fR
Revision specification at which source files should be checked out from the
repository.
.IP
Configuration option name:
.I defaults.git_revision
.br
Default value: "HEAD"
.TP
\fB-d\fR \fIDIRECTORIES\fR, \fB--git-src-directory\fR \fIDIRECTORIES\fR
Whitespace-separated list of paths which should be checked out from the
repository.
.IP
Configuration option name:
.I defaults.git_src_directory
.br
Default value: none
.TP
\fB-M\fR \fIMAJOR\fR, \fB--major\fR \fIMAJOR\fR
Major version number of the distribution the package is built for
(for example, "\fB7\fR" for RHEL 7.3).
.IP
Configuration option name:
.I defaults.major
.br
Default value: 7
.TP
\fB-m\fR \fIMINOR\fR, \fB--minor\fR \fIMINOR\fR
Minor version number of the distribution the package is built for
(for example, "\fB3\fR" for RHEL 7.3).
.IP
Configuration option name:
.I defaults.minor
.br
Default value: 0
.\"
.SS Options for generate_spec action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-t\fR \fISPEC_TEMPLATE\fR, \fB--spec-template\fR \fISPEC_TEMPLATE\fR
RPM spec file template.
Please refer to the
.I File path evaluation
section for the information regarding RPM spec template file path resolution.
.IP
Configuration option name:
.I defaults.spec_template
.br
Default value: none; "spec" is a hard-coded default.
.\"
.SS Options for build_rpm action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-a\fR, \fB--tar-all\fR
Tar all files, including hidden ones (files with names starting with dot).
Otherwise, only files with names starting with non-dot character will be added
to the source tarball.
The option sets the value of the relevant configuration parameter to
.BR True .
Note that this check is independent from the check controlled by the
.I defaults.tar_strict
configuration parameter.
.IP
Configuration option name:
.I defaults.tar_all
.br
Default value: False
.TP
\fB-e\fR, \fB--tar-strict\fR
Tar only expected files.
Only the files with names matching the regular expression pattern provided in
.I defaults.src_patterns
configuration option will be added to the source tarball.
The option sets the value of the relevant configuration parameter to
.BR True .
Note that this check is independent from the check controlled by the
.I defaults.tar_all
configuration parameter.
.IP
Configuration option name:
.I defaults.tar_strict
.br
Default value: False
.TP
\fB-s\fR, \fB--srpm\fR
Force building of source RPM instead of binary one.
.B ddiskit
has several heuristics (whether host architecture is among architectures
targeted by module, whether RPM build check passes) that detect possibility
of binary RPM build and falls back to building source RPM only in case they
indicated that binary RPM build is impossible; however, one can force building
of source RPM instead of binary one with this switch.
The option sets the value of the relevant configuration parameter to
.BR True .
.IP
Configuration option name:
.I defaults.srpm
.br
Default value: False
.TP
\fB-m\fR, \fB--mock\fR
Enable
.BR mock (1)
usage for building RPM.
See the
.I MOCK SUPPORT
section for additional information.
.IP
Configuration option name:
.I defaults.mock
.br
Default value: False
.TP
\fB-r\fR \fIMOCK_CONFIG\fR, \fB--mock-config\fR \fIMOCK_CONFIG\fR
Which mock configuration should be used for building RPM.
.IP
Configuration option name:
.I defaults.mock_config
.br
Default value: "default"
.TP
\fB-l\fR, \fB--mock-offline\fR
Whether to pass
.B --offline
option to
.BR mock .
.IP
Configuration option name:
.I defaults.mock_offline
.br
Default value: False
.TP
\fB-O\fR \fIMOCK_OPTIONS\fR, \fB--mock-opts\fR \fIMOCK_OPTIONS\fR
Additional options that have to be passed to
.B mock
invocations.
Shell quoting is supported.
Overwrites options set by previous
.BR -O " and/or " -A
options.
.IP
Configuration option name:
.I defaults.mock_opts
.br
Default value: none
.TP
\fB-A\fR \fIMOCK_OPTIONS\fR, \fB--mock-opts-append\fR \fIMOCK_OPTIONS\fR
Additional options that have to be passed to
.B mock
invocations.
Shell quoting is supported.
Appends options to the options set by previous
.BR -O " and/or " -A
options.
.IP
Configuration option name:
.I defaults.mock_opts
.br
Default value: none
.TP
\fB-g\fR \fILEVEL\fR, \fB--check-git-src\fR \fILEVEL\fI
Set the level of source code repository authenticity check. See the
.I SOURCE CODE VERIFICATION
section for the details.
.IP
Configuration option name:
.I defaults.check_get_src
.br
Default value: 0
.TP
\fB-G\fR, \fB--generate-spec-on-build\fR
Call the
.I generate_spec
action at the beginning of the
.I build_rpm
action execution.
This saves for calling
.I generate_spec
action separately each time module configuration or patch list are changed
(assuming that spec file does not need manual changes after generation).
.IP
Configuration option name:
.I defaults.generate_spec_on_build
.br
Default value: 0
.\"
.SS Options for build_iso action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-i\fR \fIISOFILE\fR, \fB--isofile\fR \fIISOFILE\fR
File name for the output ISO.
.IP
Configuration option name:
.I defaults.isofile
.br
Default value: none; see also
.I build_iso
action description section.
.\"
.SS Options for dump_config action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-o\fR \fIDUMP_CONFIG_NAME\fR, \fB--dump-config-name\fR \fIDUMP_CONFIG_NAME\fR
Name of the file where to store configuration dump.
This is the same option as the \fB-o\fR option in the
.I General options
section, and present here only for convenience.
.IP
Configuration option name:
.I defaults.dump_config_name
.br
Default value: none; "{config}.generated" is a hard-coded default.
.\"
.SS Options for update_kabi action
.TP
\fB-c\fR \fICONFIG\fR, \fB--config\fR \fICONFIG\fR
Path to the module configuration file.
.IP
Configuration option name:
.I defaults.config
.br
Default value: "module.config"
.TP
\fB-g\fR \fIGIT_DIRECTORY\fR, \fB--git-dir\fR \fIGIT_DIRECTORY\fR
Path to
.B .git
directory containing repository from where source files should be checked out.
.IP
Configuration option name:
.I defaults.git_dir
.br
Default value: none
.TP
\fB-d\fR \fIKABI_DIRECTORY\fR, \fB--kabi-dest-dir\fR \fIKABI_DIRECTORY\fR
Path to kABI symbol information files directory withing kernel source tree
that is ought to be updated.
.IP
Configuration option name:
.I defaults.kabi_dest_dir
.br
Default value: none
.TP
\fB-e\fR, \fB--extract-kmod\fR
Extract kmods from RPMs and use their modversion data instead of
RPM "\fBRequires\fR" tags.
The option sets
.I defaults.kabi_use_rpm_ko
configuration option to
.BR True .
.TP
\fB-E\fR, \fB--no-extract-kmod\fR
Do not extract kmods from RPM and use data provided in "\fBRequires\fR" tags
instead.
The option sets
.I defaults.kabi_use_rpm_ko
configuration option to
.BR False .
.TP
\fB-o\fR, \fB--overwrite\fR
Overwrite existing kABI symbol information files.
The option sets
.I defaults.kabi_files_overwrite
configuration option to
.BR 2 .
.TP
\fB-O\fR, \fB--no-overwrite\fR
Do not overwrite existing kABI symbol information files.
The option sets
.I defaults.kabi_files_overwrite
configuration option to
.BR 0 .
.TP
\fB-i\fR, \fB--overwrite-interactive\fR
Ask user when a possibility of existing kABI symbol information file overwrite
appears.
The option sets
.I defaults.kabi_files_overwrite
configuration option to
.BR 1 .
.TP
\fB-t\fR, \fB--commit\fR
Perform create a git commit with the affected kABI symbol files on success.
The option sets
.I defaults.kabi_commit
configuration option to
.BR True .
.TP
\fB-n\fR, \fB--no-commit\fR
Do not perform create a git commit with the affected kABI symbol files
on success.
The option sets
.I defaults.kabi_commit
configuration option to
.BR False .
.TP
\fB-m\fR \fIMESSAGE\fR, \fB--kabi-commit-message\fR \fIMESSAGE\fR
Commit message that is supplied for the git commit with the affected kABI
symbol files.
.IP
Configuration option name:
.I defaults.kabi_commit
.br
Default value: none
.TP
\fB-M\fR \fISYMVERS_PATH\fR, \fB--symvers-path\fR \fISYMVERS_PATH\fR
Path to a relevant kernel's Module.symvers file (for example,
"/usr/src/kernels/\fIKERNEL_VERSION\fR.{arch}/Module.symvers",
present in the \fBkernel-devel\fR RPM).
.IP
Configuration option name:
.I defaults.symvers_path
.br
Default value: none
.TP
\fB-w\fR \fIWHITELIST_PATH\fR, \fB--kabi-whitelist\fR \fIWHITELIST_PATH\fR
Path to a file containing a list of symbols already white listed,
in \fBModule.symvers\fR format.
.IP
Configuration option name:
.I defaults.kabi_whitelist
.br
Default value: none
.TP
\fB-b\fR, \fB--break-on-errors\fR
Abort when a symbol version conflict is discovered.
The option sets
.I defaults.kabi_check_symvers_conflicts
configuration option to
.BR 2 .
.TP
\fB-B\fR, \fB--no-break-on-version-conflicts\fR
Continue processing even if a symbol version conflict is discovered.
The option sets
.I defaults.kabi_check_symvers_conflicts
configuration option to
.BR 0 .
.TP
\fB-a\fR, \fB--ask-on-version-conflicts\fR
Ask user what to do when a symbol version conflict is discovered.
The option sets
.I defaults.kabi_check_symvers_conflicts
configuration option to
.BR 1 .
.\"
.\"
.SH CONFIGURATION
Configuration is a sectioned key-value store, with values being strings and
interpreted based on the context (see
.I CONFIGURATION VALUES REFERENCE
section for the reference) as strings, integers, booleans (see
.I Boolean values
section for the details on boolean value derivation), or arrays.
.\"
.SS Configuration generation
In order to construct its configuration,
.B ddiskit
gathers configuration options from the multiple sources, then performs
some fixed processing.
The sources of configuration options are the following:
.IP \(bu 3
Hard-coded defaults, present in
.B ddiskit
source code.
These are mostly for default configuration search paths and for other values
which are expected to be defined one way or another. Currently, it contains
the following configuration options:
.RS
.IP \(bu 3
.IR defaults " section"
.RS
.IP \(bu 3
.IR res_dir
= "/usr/share/ddiskit"
.IP \(bu
.IR template_dir
= "{res_dir}/templates"
.IP \(bu
.IR profile_dir
= "{res_dir}/profiles"
.IP \(bu
.IR config_template
= "config"
.IP \(bu
.IR quilt_support
= True
.IP \(bu
.IR spec_template
= "spec"
.IP \(bu
.IR src_patterns
= "^Kbuild$|^Kconfig$|^Makefile$|^.*\.[ch]$"
.RE
.IP \(bu 3
.IR global " section"
.RS
.IP \(bu 3
.IR module_vendor
= "ENTER_MODULE_VENDOR"
.IP \(bu
.IR module_author
= "ENTER_MODULE_AUTHOR"
.IP \(bu 3
.IR module_author_email
= "ENTER_MODULE_AUTHOR_EMAIL"
.RE
.RE
.IP \(bu
The "package" configuration.
It contains the rest of the configuration option defaults which should be defined
for proper operation (like spec file generation).
Package configuration is read from the fixed path
"/usr/share/ddiskit/ddiskit.config"
which is not expected to be modified by user or system administrator (and is
usually overwritten by package update).
.IP \(bu
The "site" configuration. Located in "/etc/ddiskit.config", this file is
treated as a configuration file and is subject to possible changes by the
system administrator.
.IP \(bu
The "user" configuration. In case user wants some user-specific changes
(like his own default values for
.IR global.module_author " or " global.module_author_email
configuration options, as well as default profile), he should place it in
".ddiskitrc" file in his home directory.
.IP \(bu
Profile. The profile in use is derived from
.IR defaults.profile " and " default.profile_dir
configuration variables (see more in the
.I File path evaluation
section on how the path to the profile is evaluated).
It contains overrides suitable for a particular use case (for example, the
.B rh-testing
profile contains spec file description suffix with a notice that the package
provided is a testing package).
Note that the values for aforementioned configuration variables can be
overridden by
.BR -p " and " -P
command line arguments.
.IP \(bu
Module configuration. This file is usually called "module.config"
(but can be overridden by
.B -c
command line argument) and contains module-specific configuration.
It is usually generated from template by
.I prepare_sources
action and is self-documented in terms of what values user is expected
to provide there.
.IP \(bu
Command-line arguments. They update
.I defaults
section of the configuration dictionary, and usually have key name equal
to the long option name, with dashes replaced with underscores.
Configuration option name for each specific command line option is provided
in the
.I OPTIONS
section.
Unless explicitly specified (with default value being "none"),
command line option \fIalways\fR updates the configuration option value.
.PP
These files are applied one after another in aforementioned order, so the
"last wins" rule applies.
The exception from the rule are command line options, which take precedence
at each point of configuration generation (during the profile path evaluation,
for example).
.PP
The configuration files themselves are sectioned key-value files,
syntax of which is described in the
.UR https://docs.python.org/2/library/configparser.html
related Python module documentation
.UE ,
except for the interpolation part, which is home-grown and described
in the section
.IR "Configuration value evaluation" .
.\"
.SS Kernel package versioning scheme
Red Hat Enterprise Linux follows specific kernel package versioning scheme, and
.B ddiskit
employs it in order to generate proper dependencies on the kernel package.
As a result, it expects that in places where kernel version is provided,
this version follows specific scheme.
More specifically, two version schemes are supported:
.IP \(bu 3
Y-stream kernel version.
This kernel package version is shipped as a part of General Availability
release, and has the following format:
.CS
\fIkernel_version\fR.\fIkernel_patchlevel\fR.\fIkernel_sublevel\fR-\fIrhel_release\fR.\fIrpm_dist\fR
.CE
For example, RHEL 7.3 GA kernel has kernel version 3.10.0-514.el7.
Consequently, it is expected that
.IR kernel_version ", " kernel_patchlevel ", " kernel_sublevel ", " rhel_release
are decimal numbers (having no more than 1, 2, 2, and 4 digits, respectively),
and
.I rpm_dist
part is provided in the form of "el\fI<number>\fR", where \fI<number>\fR is
a 1-digit or 2-digit number not less than 6.
.IP \(bu
Z-stream kernel version.
These kernel packages are provided as a part of updates for the existing release
(so-called Z-stream).
The versions of these packages have the following format:
.CS
\fIkernel_version\fR.\fIkernel_patchlevel\fR.\fIkernel_sublevel\fR-\fIrhel_release\fR\fB[\fR.\fIupdate_release\fR\fB]+\fR.\fIrpm_dist\fR
.CE
The restrictions on the parts that also used for the Y-stream kernel package
version description are the same, and \fIupdate_release\fR is a number that
can have up to 3 digits.
Example of a Z-stream kernel package version (RHEL 7.3 update from 2017-05-25):
3.10.0-514.21.1.el7.
.PP
Generally, it is expected that kernel module RPMs and Driver Update Disks are
built for using along with the Y-stream GA kernel (and all the following
Z-stream kernels, thanks to kABI compatibility), so when Z-stream kernel package
version is detected, the user is warned about this.
The differences between kernel package dependency generation in these cases
are described in the
.I Spec file generation
section.
.PP
In order to enforce these checks,
.B ddiskit
uses regular expression-based approach: it checks the version provided in the
.I defaults.kernel_version
configuration variable against regular expressions set via the
.I defaults.kernel_flex_version_re
and
.I defaults.kernel_fixed_version_re
configuration options, which contain Python regular expressions (see
.UR https://docs.python.org/2/library/re.html
Python \fBre\fR module documentation
.UE
for details about regular expression syntax) for matching Y-stream and Z-stream
kernel versioning scheme, respectively.
In order to extract parts of kernel version described above, the following
regular expression groups are used:
.TP 18
.B version
Kernel's major version
.RI ( kernel_version
in the description above).
.TQ
.B patchlevel
Kernel's patch level
.RI ( kernel_patchlevel ).
.TQ
.B sublevel
Kernel's sub-patch level
.RI ( kernel_sublevel ).
.TQ
.B rpm_release
Major part of RPM release
.RI ( rhel_release ).
.TQ
.B rpm_release_add
Remaining part of RPM release
.RI ( update_release ).
.TQ
.B rpm_dist
RPM release dist part
.RI ( rpm_dist ).
.PP
The default values of the
.I defaults.kernel_flex_version_re
and
.I defaults.kernel_fixed_version_re
configuration options are set via other configuration options:
.CS
kernel_flex_verson_re = {kernel_nvr_re}{kernel_dist_re}
kernel_fixed_version_re = {kernel_nvr_re}{kernel_fixed_re}{kernel_dist_re}
kernel_nvr_re = (?P<version>[0-9])\.(?P<patchlevel>[0-9]{1,2})\.(?P<sublevel>[0-9]{1,2})-(?P<rpm_release>[0-9]{1,4})
kernel_fixed_re = (?P<rpm_release_add>(\.[0-9]{1,3})+)
kernel_dist_re = (?P<rpm_dist>\.el([6-9]|[1-9][0-9]))
.CE
This allows for some flexibility in case some tuning of these checks is needed.
.\"
.SS Configuration check
After the configuration has been constructed (and in case module configuration
is present), it is subject to a set of checks:
.IP \(bu 3
Whether
.IR global " and " spec_file
configuration sections are present.
.IP \(bu
Whether all configuration options in
.IR global " and " spec_file
sections have non-default values.
Default value is a value which is the concatenation of "ENTER_" and upper-cased
configuration key name ("ENTER_MODULE_NAME" for
.I spec_file.module_name
configuration option, for example). The exception is
.I spec_file.firmware_version
option, in case
.I spec_file.firmware_include
configuration options is set to
.BR False .
.IP \(bu
Whether
.I spec_file.kernel_version
has proper format (only Y-stream and Z-stream kernel versions are accepted,
see the
.I Kernel package versioning scheme
section for the acceptable version string format configuration details).
.IP \(bu
Whether
.IR spec_file.module_name ", " spec_flie.module_version ", and "
.I spec_file.module_rpm_release
configuration options contain only characters accepted by RPM
(alphanumeric plus
.RB ' . "', '" - "', '" _ "', '" + "', '" % "', '" { "', '" } "'"
for
.IR spec_file.module_name ;
alphanumeric plus
.RB ' . "', '" _ "', '" + "', '" % "', '" { "', '" } "', '" ~ "'"
for
.IR spec_flie.module_version " and " spec_file.module_rpm_release ).
.\"
.SS File path evaluation
Paths to various external resource files (like templates and profiles)
are evaluated based on provided resource directory and name
using the following algorithm:
.IP \(bu 3
If resource name does not have slashes, then it is considered that this name
refers to the file in the provided directory.
.IP \(bu
Otherwise, it is interpreted as a path relative to the current working
directory (which is the directory the where module configuration resides).
.PP
For example, profile "\fBmy-profile\fR" is searched relative to profile directory
(stored in the \fIdefaults.profile_dir\fR configuration option,
"\fB/usr/share/ddiskit/profiles\fR" by default), but profile "\fB./my-profile\fR"
is searched relative to module's configuration directory.
.\"
.SS Configuration value evaluation
Configuration option values can reference other configuration options using
the "{\fB[\fR\fIsection_name\fR.\fB]\fR\fIkey_name\fR}" syntax.
If section is not present, it is assumed that the referenced key is
in the same section as the value which references it.
If the referenced key is not found, no substitution occurs.
.PP
For example, let's assume the following configuration file:
.CS
[foo]
foo = aaa {bar} {bar.baz}
bar = bbb {baz} {bar.foo}
[bar]
foo = ccc {baz}
bar = ddd {foo.foo}
baz = eee
.CE
After the evaluation,
.I foo.foo
key would have the value "aaa bbb {baz} ddd ccc eee eee",
.I foo.bar
would equal to "bbb {baz} ccc eee",
.I bar.foo
would be "ccc eee", and
.I bar.bar
is "ddd ccc eee".
.PP
Circular dependencies are not explicitly resolved, there's only substitution
depth limit present (which is set to 8 currently).
.\"
.SS Boolean values
The values which are treated as boolean can have the following
(case-insensitive) values in order to indicate that the value
should be evaluated to
.IR True :
.BR 1 ", " t ", " y ", " true ", or " yes .
In order to indicate
.I False
value, one of the following strings may be used:
.BR 0 ", " f ", " n ", " false ", or " no .
In case configuration value doesn't evaluate to
.IR True " or " False
value, it is evaluated as
.IR None .
.I None
value is treated as
.I False
in most places, but sometimes it is important to provide specific choice,
and in these cases error would occur if boolean value was evaluated to
.IR None .
.\"
.SS Spec file generation
Before spec file generation takes place, additional configuration processing
is performed:
.IP \(bu 3
.IR spec_file.source_patches " and " spec_file.source_patches_do
generated in accordance with a lexicographically sorted list of patch files
found in the patch directory: \fBsrc/patch\fR relative to the current working
directory (except when
.BR quilt (1)
integration is enabled; see the
.I QUILT INTEGRATION
section for details).
.I spec_file.source_patches
contains lines in the "Patch\fIN\fR: \fIpatch-file-name\fR" format, and
.I spec_file.source_patches_do
contains lines in the "%patch\fIN\fR -p1" format.
As a result, first configuration variable is suitable for patch file list
description, and second is useful in the \fB%prep\fR section for patch applying.
If the
.I default.quilt_support
configuration option is enabled, file named
.B series
is ignored in the patch directory.
.IP \(bu
.I spec_file.firmware_files
configuration variable contains list of files found in the \fBsrc/firmware\fR
directory with the \fB/lib/firmware/\fR directory prepended, which is suitable
for the \fB%files\fR section of the firmware sub-package.
.IP \(bu
.I spec_file.firmware_files_install
configuration variable contains list for firmware file installation commands
in the format "install -m 644 -D source/firmware/\fIfirmware-file-path\fR
$RPM_BUILD_ROOT/lib/firmware/\fIfirmware-file-path\fR", which is suitable
for the \fB%install\fR section of the firmware sub-package.
.IP \(bu
.I spec_file.firmware_begin
configuration option is set to "%if 1" or "%if 0" when the
.I spec_file.firmware_include
configuration variable is true or not, respectively.
.IP \(bu
.I spec_file.firmware_end
configuration variable is set to "%endif".
.IP \(bu
.I spec_file.date
is set to the current date and time in "%a %b %d %Y"
.BR strftime (3)
format, if this variable hasn't been set already.
.IP \(bu
.I spec_file.kernel_requires
is formatted as following (if the variable hasn't been set already):
.RS
.IP \(bu 3
if the
.I spec_file.kernel_version_min
configuration option contains a non-empty value, it is set to
.CS
Requires: kernel >= \fIspec_file.kernel_version_min\fR
.CE
.IP \(bu 3
otherwise, if the
.I spec_file.kernel_version_dep
configuration option contains a non-empty value, it is set to
.CS
Requires: kernel = \fIspec_file.kernel_version_dep\fR
.CE
.IP \(bu 3
otherwise, it is set to
.CS
Requires: kernel >= \fIkernel_version\fR-\fIkernel_release\fR.\fIkernel_dist\fR
Requires: kernel < \fIkernel_version\fR-\fI(kernel_release + 1)\fR.\fIkernel_dist\fR
.CE
if the
.I spec_file.kernel_version
configuration option contains a Y-stream kernel version, or
.CS
Requires: kernel = \fIkernel_version\fR-\fIkernel_release\fR.\fIkernel_dist\fR
.CE