summaryrefslogtreecommitdiff
path: root/tools/bootconfig/include
AgeCommit message (Collapse)AuthorFilesLines
2021-10-11bootconfig: Cleanup dummy headers in tools/bootconfigMasami Hiramatsu7-84/+44
Cleanup dummy headers in tools/bootconfig/include except for tools/bootconfig/include/linux/bootconfig.h. For this change, I use __KERNEL__ macro to split kernel header #include and introduce xbc_alloc_mem() and xbc_free_mem(). Link: https://lkml.kernel.org/r/163187299574.2366983.18371329724128746091.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-10-11bootconfig: Replace u16 and u32 with uint16_t and uint32_tMasami Hiramatsu1-3/+1
Replace u16 and u32 with uint16_t and uint32_t so that the tools/bootconfig only needs <stdint.h>. Link: https://lkml.kernel.org/r/163187298835.2366983.9838262576854319669.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-10-11tools/bootconfig: Print all error message in stderrMasami Hiramatsu2-16/+0
Print all error message in stderr. This also removes unneeded tools/bootconfig/include/linux/printk.h. Link: https://lkml.kernel.org/r/163187298106.2366983.15210300267326257397.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-09-15tools/bootconfig: Define memblock_free_ptr() to fix build errorMasami Hiramatsu1-2/+1
The lib/bootconfig.c file is shared with the 'bootconfig' tooling, and as a result, the changes incommit 77e02cf57b6c ("memblock: introduce saner 'memblock_free_ptr()' interface") need to also be reflected in the tooling header file. So define the new memblock_free_ptr() wrapper, and remove unused __pa() and memblock_free(). Fixes: 77e02cf57b6c ("memblock: introduce saner 'memblock_free_ptr()' interface") Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-08tools/bootconfig: Fix a build error accroding to undefined fallthroughMasami Hiramatsu1-0/+4
Since the "fallthrough" is defined only in the kernel, building lib/bootconfig.c as a part of user-space tools causes a build error. Add a dummy fallthrough to avoid the build error. Link: https://lkml.kernel.org/r/162087519356.442660.11385099982318160180.stgit@devnote2 Cc: Ingo Molnar <mingo@kernel.org> Cc: stable@vger.kernel.org Fixes: 4c1ca831adb1 ("Revert "lib: Revert use of fallthrough pseudo-keyword in lib/"") Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-21tools/bootconfig: Remove unneeded error message silencerMasami Hiramatsu1-4/+1
Remove error message silent knob, we don't need it anymore because we can check if there is a bootconfig by checking the magic word. If there is a magic word, but failed to load a bootconfig from initrd, there is a real problem. Link: http://lkml.kernel.org/r/158220113256.26565.14264598654427773104.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-11bootconfig: Allocate xbc_nodes array dynamicallyMasami Hiramatsu1-0/+12
To reduce the large static array from kernel data, allocate xbc_nodes array dynamically only if the kernel loads a bootconfig. Note that this also add dummy memblock.h for user-spacae bootconfig tool. Link: http://lkml.kernel.org/r/158108569699.3187.6512834527603883707.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-10tools/bootconfig: Fix wrong __VA_ARGS__ usageMasami Hiramatsu1-1/+1
Since printk() wrapper macro uses __VA_ARGS__ without "##" prefix, it causes a build error if there is no variable arguments (e.g. only fmt is specified.) To fix this error, use ##__VA_ARGS__ instead of __VAR_ARGS__. Link: http://lkml.kernel.org/r/158108370130.2758.10893830923800978011.stgit@devnote2 Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command") Reported-by: Michael Ellerman <mpe@ellerman.id.au> Tested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-01-13tools: bootconfig: Add bootconfig commandMasami Hiramatsu7-0/+100
Add "bootconfig" command which operates the bootconfig config-data on initrd image. User can add/delete/verify the boot config on initrd image using this command. e.g. Add a boot config to initrd image # bootconfig -a myboot.conf /boot/initrd.img Remove it. # bootconfig -d /boot/initrd.img Or verify (and show) it. # bootconfig /boot/initrd.img Link: http://lkml.kernel.org/r/157867223582.17873.14342161849213219982.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> [ Removed extra blank line at end of bootconfig.c ] Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>