mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-25 15:03:55 +01:00
linux-rpm.mk: Some fixes related to major.minor.extraversion-style kernel packages
This commit is contained in:
parent
bcc6322dea
commit
92ae57a788
1 changed files with 39 additions and 34 deletions
|
|
@ -18,12 +18,21 @@ define EXTRAVERSION
|
||||||
$(shell sed '/^ *EXTRAVERSION *=/ !d; s/^ *EXTRAVERSION *= *-*//; s/ *$$//' linux-$(KERNEL_VERSION)/Makefile 2>/dev/null)
|
$(shell sed '/^ *EXTRAVERSION *=/ !d; s/^ *EXTRAVERSION *= *-*//; s/ *$$//' linux-$(KERNEL_VERSION)/Makefile 2>/dev/null)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
KERNEL_MINOR := $(shell echo $(KERNEL_VERSION) | cut -d\. -f2)
|
KERNEL_MAJOR = $(shell echo $(KERNEL_VERSION) | cut -d\. -f1)
|
||||||
|
KERNEL_MINOR = $(shell echo $(KERNEL_VERSION) | cut -d\. -f2)
|
||||||
|
KERNEL_PKG_BASE = /home/samba/dat/share/exe/linux/os/$(KERNEL_MAJOR).$(KERNEL_MINOR)/linux-$(KERNEL_VERSION).tar
|
||||||
|
ifneq ($(wildcard $(KERNEL_PKG_BASE).gz),)
|
||||||
|
KERNEL_PKG = $(KERNEL_PKG_BASE).gz
|
||||||
|
KERNEL_SRC_DIR = $(shell tar -tzf $(KERNEL_DIR)/$(KERNEL_PKG) | head -1)
|
||||||
|
endif
|
||||||
|
ifneq ($(wildcard $(KERNEL_PKG_BASE).bz2),)
|
||||||
|
KERNEL_PKG = $(KERNEL_PKG_BASE).bz2
|
||||||
|
KERNEL_SRC_DIR = $(shell tar -tjf $(KERNEL_DIR)/$(KERNEL_PKG) | head -1)
|
||||||
|
endif
|
||||||
#HOST = $(shell cd ../..; pwd | xargs basename)
|
#HOST = $(shell cd ../..; pwd | xargs basename)
|
||||||
WD := $(shell pwd)
|
WD := $(shell pwd)
|
||||||
KERNEL_SRC_DIR = $(shell tar -tzf $(KERNEL_DIR)/$(KERNEL_PKG) | head -1)
|
|
||||||
TMP_INSTALL = $(KERNEL_BASE)-$(KERNEL_VERSION)-$(EXTRAVERSION)
|
TMP_INSTALL = $(KERNEL_BASE)-$(KERNEL_VERSION)-$(EXTRAVERSION)
|
||||||
TAG = $(shell echo V_$(KERNEL_VERSION)_$(KERNEL_RELEASE) | sed 's/\./_/g')
|
TAG = $(shell echo V_$(KERNEL_VERSION)_$(RPM_RELEASE) | sed 's/\./_/g')
|
||||||
ARCH = $(shell $(RPMBUILD) --showrc | sed '/build arch / !d; s/.*build arch *://; s/ //g')
|
ARCH = $(shell $(RPMBUILD) --showrc | sed '/build arch / !d; s/.*build arch *://; s/ //g')
|
||||||
|
|
||||||
RPMBUILD = $(shell which rpmbuild 2>/dev/null)
|
RPMBUILD = $(shell which rpmbuild 2>/dev/null)
|
||||||
|
|
@ -31,16 +40,16 @@ ifeq ($(RPMBUILD),)
|
||||||
RPMBUILD = $(shell which rpm 2>/dev/null)
|
RPMBUILD = $(shell which rpm 2>/dev/null)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(wildcard RELEASE-$(KERNEL_VERSION)),)
|
#ifeq ($(wildcard RELEASE-$(KERNEL_VERSION)),)
|
||||||
KERNEL_RELEASE := $(shell make newrelease; exit 1)
|
#RPM_RELEASE := $(shell make newrelease; exit 1)
|
||||||
else
|
#else
|
||||||
KERNEL_RELEASE_NUM := $(strip $(shell grep Id: RELEASE-$(KERNEL_VERSION) | sed "s/.*RELEASE-$(KERNEL_VERSION),v[ ]*[0-9]*\.\([0-9]*\)[^0-9]*.*/\1/"))
|
#RPM_RELEASE_NUM := $(strip $(shell grep Id: RELEASE-$(KERNEL_VERSION) | sed "s/.*RELEASE-$(KERNEL_VERSION),v[ ]*[0-9]*\.\([0-9]*\)[^0-9]*.*/\1/"))
|
||||||
ifeq ($(UNAME_SUFFIX),)
|
#ifeq ($(UNAME_SUFFIX),)
|
||||||
KERNEL_RELEASE = $(KERNEL_RELEASE_NUM)
|
#RPM_RELEASE = $(RPM_RELEASE_NUM)
|
||||||
else
|
#else
|
||||||
KERNEL_RELEASE = $(UNAME_SUFFIX)$(KERNEL_RELEASE_NUM)
|
#RPM_RELEASE = $(UNAME_SUFFIX)$(RPM_RELEASE_NUM)
|
||||||
endif
|
#endif
|
||||||
endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
ifeq ($(BOOT_LABEL),)
|
ifeq ($(BOOT_LABEL),)
|
||||||
|
|
@ -58,12 +67,7 @@ F_SPM = $(BASE).src.rpm
|
||||||
F_RPM_RUN = $(BASE_RUN).$(ARCH).rpm
|
F_RPM_RUN = $(BASE_RUN).$(ARCH).rpm
|
||||||
F_RPM_DEVEL = $(BASE_DEVEL).$(ARCH).rpm
|
F_RPM_DEVEL = $(BASE_DEVEL).$(ARCH).rpm
|
||||||
F_RPMS = $(F_RPM_RUN) $(F_RPM_DEVEL)
|
F_RPMS = $(F_RPM_RUN) $(F_RPM_DEVEL)
|
||||||
blah:
|
|
||||||
echo $(EXTRAVERSION)
|
|
||||||
|
|
||||||
F_BOOTFILES = $(addsuffix -$(KERNEL_VERSION)-$(EXTRAVERSION),$(addprefix $(TMP_INSTALL)/boot/,vmlinuz config System.map))
|
F_BOOTFILES = $(addsuffix -$(KERNEL_VERSION)-$(EXTRAVERSION),$(addprefix $(TMP_INSTALL)/boot/,vmlinuz config System.map))
|
||||||
blub:
|
|
||||||
echo $(F_BOOTFILES)
|
|
||||||
F_CURRENT = $(addprefix CURRENT_, SRC RPM_SRC RPM_RUN_I386 RPM_DEVEL_I386)
|
F_CURRENT = $(addprefix CURRENT_, SRC RPM_SRC RPM_RUN_I386 RPM_DEVEL_I386)
|
||||||
F_ULDONE = $(addsuffix .uldone,$(F_RPMS) $(F_TGZ) $(F_SPM) current)
|
F_ULDONE = $(addsuffix .uldone,$(F_RPMS) $(F_TGZ) $(F_SPM) current)
|
||||||
# note that order matters for F_ULDONE and F_RPMS (remote directory attributes)
|
# note that order matters for F_ULDONE and F_RPMS (remote directory attributes)
|
||||||
|
|
@ -98,18 +102,22 @@ $(KERNEL_PKG):
|
||||||
install -m 664 $(KERNEL_TGZ) $@
|
install -m 664 $(KERNEL_TGZ) $@
|
||||||
|
|
||||||
config-$(KERNEL_VERSION):
|
config-$(KERNEL_VERSION):
|
||||||
cp $(shell ls config-$(basename $(KERNEL_VERSION)).* | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]\)$$/\1.\2.0\3/' | sort -g | sed 's/\.0/./; $$ !d') $@
|
cp $(shell ls config-$(KERNEL_MAJOR).$(KERNEL_MINOR).* | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]\)[.$$]./\1.\2.0\3/; s/\.\([0-9]\)$$/.0\1/' | sort -g | sed 's/\.0/./g; $$ !d') $@
|
||||||
cvs add $@
|
cvs add $@
|
||||||
cvs commit
|
cvs commit $@
|
||||||
|
|
||||||
# if ($$0 ~ "^ *EXTRAVERSION *= [0-9]*.[0-9]*.[0-9]") { \
|
# if ($$0 ~ "^ *EXTRAVERSION *= [0-9]*.[0-9]*.[0-9]") { \
|
||||||
|
|
||||||
toplevel-makefile: patches.done
|
toplevel-makefile: patches.done
|
||||||
awk -v release=$(KERNEL_RELEASE) '{ \
|
awk -v release=$(RPM_RELEASE) '{ \
|
||||||
if ($$0 ~ /EXTRAVERSION *= *-/) { \
|
if ($$0 ~ /EXTRAVERSION *= *-/) { \
|
||||||
oldextra=$$3; \
|
oldextra=$$3; \
|
||||||
gsub(/-/,_,oldextra); \
|
gsub(/-/,_,oldextra); \
|
||||||
printf "EXTRAVERSION = -%s_%s\n", release, oldextra \
|
printf "EXTRAVERSION = -%s_%s\n", release, oldextra \
|
||||||
|
} else if ($$0 ~ /EXTRAVERSION *= *\./) { \
|
||||||
|
oldextra=$$3; \
|
||||||
|
gsub(/-/,_,oldextra); \
|
||||||
|
printf "EXTRAVERSION = %s-%s\n",oldextra, release \
|
||||||
} else if ($$0 ~ /EXTRAVERSION *= *$$/) { \
|
} else if ($$0 ~ /EXTRAVERSION *= *$$/) { \
|
||||||
printf "EXTRAVERSION = -%s\n",release \
|
printf "EXTRAVERSION = -%s\n",release \
|
||||||
} else { \
|
} else { \
|
||||||
|
|
@ -117,7 +125,7 @@ toplevel-makefile: patches.done
|
||||||
} \
|
} \
|
||||||
}' linux-$(KERNEL_VERSION)/Makefile >$@
|
}' linux-$(KERNEL_VERSION)/Makefile >$@
|
||||||
|
|
||||||
# sed "s/\(^ *EXTRAVERSION *= *[^ ]*\) *$$/\\1$(shell echo _$(KERNEL_RELEASE) | sed 's/^_/-/')/" \
|
# sed "s/\(^ *EXTRAVERSION *= *[^ ]*\) *$$/\\1$(shell echo _$(RPM_RELEASE) | sed 's/^_/-/')/" \
|
||||||
|
|
||||||
linux-$(KERNEL_VERSION)/Makefile: toplevel-makefile
|
linux-$(KERNEL_VERSION)/Makefile: toplevel-makefile
|
||||||
cp $< $@
|
cp $< $@
|
||||||
|
|
@ -137,18 +145,15 @@ endif
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
$(TMP_INSTALL)/$(F_SPEC): linux-$(KERNEL_VERSION)/Makefile $(MKSPEC) Makefile
|
$(TMP_INSTALL)/$(F_SPEC): linux-$(KERNEL_VERSION)/Makefile $(MKSPEC) Makefile
|
||||||
$(MKSPEC) -d $(TMP_INSTALL) -b $(KERNEL_BASE) -v $(KERNEL_VERSION) -r $(EXTRAVERSION) \
|
$(MKSPEC) -d $(TMP_INSTALL) -b $(KERNEL_BASE) -v $(KERNEL_VERSION) -r $(EXTRAVERSION) -a $(ARCH) -l $(BOOT_LABEL) > $@
|
||||||
-a $(ARCH) -l $(BOOT_LABEL) > $@
|
|
||||||
|
|
||||||
# -r $(shell sed '/^ *EXTRAVERSION *=/ !d; s/^ *EXTRAVERSION *= *-*//; s/ *$$//' $<) \
|
$(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)-$(RPM_RELEASE): build.lxdone $(LOCAL_AFTER_KERNEL_BUILD)
|
||||||
|
|
||||||
$(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)-$(KERNEL_RELEASE): build.lxdone $(LOCAL_AFTER_KERNEL_BUILD)
|
|
||||||
@echo -n
|
@echo -n
|
||||||
|
|
||||||
.PRECIOUS: $(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)
|
.PRECIOUS: $(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)
|
||||||
|
|
||||||
#$(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)-$(KERNEL_RELEASE): $(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)
|
$(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)-$(RPM_RELEASE): $(TMP_INSTALL)/boot/%-$(KERNEL_VERSION)
|
||||||
# cp $< $@
|
cp $< $@
|
||||||
|
|
||||||
$(F_TGZ): Makefile build.lxdone $(F_BOOTFILES) $(TMP_INSTALL)/$(F_SPEC)
|
$(F_TGZ): Makefile build.lxdone $(F_BOOTFILES) $(TMP_INSTALL)/$(F_SPEC)
|
||||||
tar -czf $@ \
|
tar -czf $@ \
|
||||||
|
|
@ -268,8 +273,8 @@ clean:
|
||||||
rm -rf linux linux-$(KERNEL_VERSION) CURRENT_*
|
rm -rf linux linux-$(KERNEL_VERSION) CURRENT_*
|
||||||
rm -f toplevel-makefile
|
rm -f toplevel-makefile
|
||||||
|
|
||||||
newrelease:
|
#newrelease:
|
||||||
echo '# $$Id$$' > RELEASE-$(KERNEL_VERSION); \
|
# echo '# $$Id$$' > RELEASE-$(KERNEL_VERSION); \
|
||||||
cvs add RELEASE-$(KERNEL_VERSION); \
|
# cvs add RELEASE-$(KERNEL_VERSION); \
|
||||||
cvs commit -m "initial checkin" RELEASE-$(KERNEL_VERSION)
|
# cvs commit -m "initial checkin" RELEASE-$(KERNEL_VERSION)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue