Skip to content

Commit 9ead649

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes: kbuild: remove unused -r option for module-init-tool depmod kbuild: fix 'make rpm' when CONFIG_LOCALVERSION_AUTO=y and using SCM tree kbuild: fix mkspec to cleanup RPM_BUILD_ROOT kbuild: fix C libary confusion in unifdef.c due to getline()
2 parents 0b80e3a + 75bccd8 commit 9ead649

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -904,12 +904,18 @@ localver = $(subst $(space),, $(string) \
904904
# and if the SCM is know a tag from the SCM is appended.
905905
# The appended tag is determined by the SCM used.
906906
#
907-
# Currently, only git is supported.
908-
# Other SCMs can edit scripts/setlocalversion and add the appropriate
909-
# checks as needed.
907+
# .scmversion is used when generating rpm packages so we do not loose
908+
# the version information from the SCM when we do the build of the kernel
909+
# from the copied source
910910
ifdef CONFIG_LOCALVERSION_AUTO
911-
_localver-auto = $(shell $(CONFIG_SHELL) \
912-
$(srctree)/scripts/setlocalversion $(srctree))
911+
912+
ifeq ($(wildcard .scmversion),)
913+
_localver-auto = $(shell $(CONFIG_SHELL) \
914+
$(srctree)/scripts/setlocalversion $(srctree))
915+
else
916+
_localver-auto = $(shell cat .scmversion 2> /dev/null)
917+
endif
918+
913919
localver-auto = $(LOCALVERSION)$(_localver-auto)
914920
endif
915921

@@ -1537,7 +1543,7 @@ quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
15371543
cmd_depmod = \
15381544
if [ -r System.map -a -x $(DEPMOD) ]; then \
15391545
$(DEPMOD) -ae -F System.map \
1540-
$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) -r) \
1546+
$(if $(strip $(INSTALL_MOD_PATH)), -b $(INSTALL_MOD_PATH) ) \
15411547
$(KERNELRELEASE); \
15421548
fi
15431549

scripts/package/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
3535
rpm-pkg rpm: $(objtree)/kernel.spec FORCE
3636
$(MAKE) clean
3737
$(PREV) ln -sf $(srctree) $(KERNELPATH)
38+
$(CONFIG_SHELL) $(srctree)/scripts/setlocalversion > $(objtree)/.scmversion
3839
$(PREV) tar -cz $(RCS_TAR_IGNORE) -f $(KERNELPATH).tar.gz $(KERNELPATH)/.
3940
$(PREV) rm $(KERNELPATH)
40-
41+
rm -f $(objtree)/.scmversion
4142
set -e; \
4243
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
4344
set -e; \

scripts/package/mkspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ echo "%endif"
9696

9797
echo ""
9898
echo "%clean"
99-
echo '#echo -rf $RPM_BUILD_ROOT'
99+
echo 'rm -rf $RPM_BUILD_ROOT'
100100
echo ""
101101
echo "%files"
102102
echo '%defattr (-, root, root)'

scripts/unifdef.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void done(void);
206206
static void error(const char *);
207207
static int findsym(const char *);
208208
static void flushline(bool);
209-
static Linetype getline(void);
209+
static Linetype get_line(void);
210210
static Linetype ifeval(const char **);
211211
static void ignoreoff(void);
212212
static void ignoreon(void);
@@ -512,7 +512,7 @@ process(void)
512512

513513
for (;;) {
514514
linenum++;
515-
lineval = getline();
515+
lineval = get_line();
516516
trans_table[ifstate[depth]][lineval]();
517517
debug("process %s -> %s depth %d",
518518
linetype_name[lineval],
@@ -526,7 +526,7 @@ process(void)
526526
* help from skipcomment().
527527
*/
528528
static Linetype
529-
getline(void)
529+
get_line(void)
530530
{
531531
const char *cp;
532532
int cursym;

0 commit comments

Comments
 (0)