Commit 950313eb authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt (VMware)
Browse files

tools: bootconfig: Add bootconfig command

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: default avatarMasami Hiramatsu <mhiramat@kernel.org>
[ Removed extra blank line at end of bootconfig.c ]
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 7684b858
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15775,6 +15775,7 @@ M: Masami Hiramatsu <mhiramat@kernel.org>
S:	Maintained
F:	lib/bootconfig.c
F:	include/linux/bootconfig.h
F:	tools/bootconfig/*
SUN3/3X
M:	Sam Creasey <sammy@sammy.net>
+6 −5
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ help:
	@echo '  pci                    - PCI tools'
	@echo '  perf                   - Linux performance measurement and analysis tool'
	@echo '  selftests              - various kernel selftests'
	@echo '  bootconfig             - boot config tool'
	@echo '  spi                    - spi tools'
	@echo '  tmon                   - thermal monitoring and tuning tool'
	@echo '  turbostat              - Intel CPU idle stats and freq reporting tool'
@@ -63,7 +64,7 @@ acpi: FORCE
cpupower: FORCE
	$(call descend,power/$@)

cgroup firewire hv guest spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging: FORCE
cgroup firewire hv guest bootconfig spi usb virtio vm bpf iio gpio objtool leds wmi pci firmware debugging: FORCE
	$(call descend,$@)

liblockdep: FORCE
@@ -96,7 +97,7 @@ kvm_stat: FORCE
	$(call descend,kvm/$@)

all: acpi cgroup cpupower gpio hv firewire liblockdep \
		perf selftests spi turbostat usb \
		perf selftests bootconfig spi turbostat usb \
		virtio vm bpf x86_energy_perf_policy \
		tmon freefall iio objtool kvm_stat wmi \
		pci debugging
@@ -107,7 +108,7 @@ acpi_install:
cpupower_install:
	$(call descend,power/$(@:_install=),install)

cgroup_install firewire_install gpio_install hv_install iio_install perf_install spi_install usb_install virtio_install vm_install bpf_install objtool_install wmi_install pci_install debugging_install:
cgroup_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install vm_install bpf_install objtool_install wmi_install pci_install debugging_install:
	$(call descend,$(@:_install=),install)

liblockdep_install:
@@ -141,7 +142,7 @@ acpi_clean:
cpupower_clean:
	$(call descend,power/cpupower,clean)

cgroup_clean hv_clean firewire_clean spi_clean usb_clean virtio_clean vm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean:
cgroup_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean vm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean:
	$(call descend,$(@:_clean=),clean)

liblockdep_clean:
@@ -176,7 +177,7 @@ build_clean:
	$(call descend,build,clean)

clean: acpi_clean cgroup_clean cpupower_clean hv_clean firewire_clean \
		perf_clean selftests_clean turbostat_clean spi_clean usb_clean virtio_clean \
		perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
		vm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
		freefall_clean build_clean libbpf_clean libsubcmd_clean liblockdep_clean \
		gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \
+1 −0
Original line number Diff line number Diff line
bootconfig
+20 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
# Makefile for bootconfig command

bindir ?= /usr/bin

HEADER = include/linux/bootconfig.h
CFLAGS = -Wall -g -I./include

PROGS = bootconfig

all: $(PROGS)

bootconfig: ../../lib/bootconfig.c main.c $(HEADER)
	$(CC) $(filter %.c,$^) $(CFLAGS) -o $@

install: $(PROGS)
	install bootconfig $(DESTDIR)$(bindir)

clean:
	$(RM) -f *.o bootconfig
+7 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BOOTCONFIG_LINUX_BOOTCONFIG_H
#define _BOOTCONFIG_LINUX_BOOTCONFIG_H

#include "../../../../include/linux/bootconfig.h"

#endif
Loading