Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bootconfig: Support O=<builddir> option

Support O=<builddir> option to build bootconfig tool in
the other directory. As same as other tools, if you specify
O=<builddir>, bootconfig command is build under <builddir>.

Link: http://lkml.kernel.org/r/158323468033.10560.14661631369326294355.stgit@devnote2

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Masami Hiramatsu and committed by
Steven Rostedt (VMware)
306b69dc 5412e0b7

+27 -14
+17 -10
tools/bootconfig/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for bootconfig command 3 + include ../scripts/Makefile.include 3 4 4 5 bindir ?= /usr/bin 5 6 6 - HEADER = include/linux/bootconfig.h 7 - CFLAGS = -Wall -g -I./include 7 + ifeq ($(srctree),) 8 + srctree := $(patsubst %/,%,$(dir $(CURDIR))) 9 + srctree := $(patsubst %/,%,$(dir $(srctree))) 10 + endif 8 11 9 - PROGS = bootconfig 12 + LIBSRC = $(srctree)/lib/bootconfig.c $(srctree)/include/linux/bootconfig.h 13 + CFLAGS = -Wall -g -I$(CURDIR)/include 10 14 11 - all: $(PROGS) 15 + ALL_TARGETS := bootconfig 16 + ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS)) 12 17 13 - bootconfig: ../../lib/bootconfig.c main.c $(HEADER) 18 + all: $(ALL_PROGRAMS) 19 + 20 + $(OUTPUT)bootconfig: main.c $(LIBSRC) 14 21 $(CC) $(filter %.c,$^) $(CFLAGS) -o $@ 15 22 16 - install: $(PROGS) 17 - install bootconfig $(DESTDIR)$(bindir) 23 + test: $(ALL_PROGRAMS) test-bootconfig.sh 24 + ./test-bootconfig.sh $(OUTPUT) 18 25 19 - test: bootconfig 20 - ./test-bootconfig.sh 26 + install: $(ALL_PROGRAMS) 27 + install $(OUTPUT)bootconfig $(DESTDIR)$(bindir) 21 28 22 29 clean: 23 - $(RM) -f *.o bootconfig 30 + $(RM) -f $(OUTPUT)*.o $(ALL_PROGRAMS)
+10 -4
tools/bootconfig/test-bootconfig.sh
··· 3 3 4 4 echo "Boot config test script" 5 5 6 - BOOTCONF=./bootconfig 7 - INITRD=`mktemp initrd-XXXX` 8 - TEMPCONF=`mktemp temp-XXXX.bconf` 6 + if [ -d "$1" ]; then 7 + TESTDIR=$1 8 + else 9 + TESTDIR=. 10 + fi 11 + BOOTCONF=${TESTDIR}/bootconfig 12 + 13 + INITRD=`mktemp ${TESTDIR}/initrd-XXXX` 14 + TEMPCONF=`mktemp ${TESTDIR}/temp-XXXX.bconf` 15 + OUTFILE=`mktemp ${TESTDIR}/tempout-XXXX` 9 16 NG=0 10 17 11 18 cleanup() { ··· 72 65 xpass test $new_size -eq $initrd_size 73 66 74 67 echo "No error messge while applying" 75 - OUTFILE=`mktemp tempout-XXXX` 76 68 dd if=/dev/zero of=$INITRD bs=4096 count=1 77 69 printf " \0\0\0 \0\0\0" >> $INITRD 78 70 $BOOTCONF -a $TEMPCONF $INITRD > $OUTFILE 2>&1