Commit 62401684 authored by Steve French's avatar Steve French

Merge bk://linux.bkbits.net/linux-2.5

into hostme.bitkeeper.com:/repos/c/cifs/linux-2.5cifs
parents 34c044fa ed158dc1
...@@ -23,7 +23,7 @@ with changes in the build system the most portable way to compile a ...@@ -23,7 +23,7 @@ with changes in the build system the most portable way to compile a
module outside the kernel is to use the kernel build system, module outside the kernel is to use the kernel build system,
kbuild. Use the following command-line: kbuild. Use the following command-line:
make -C path/to/kernel/src SUBDIRS=$PWD modules make -C path/to/kernel/src M=$PWD modules
This requires that a makefile exits made in accordance to This requires that a makefile exits made in accordance to
Documentation/kbuild/makefiles.txt. Read that file for more details on Documentation/kbuild/makefiles.txt. Read that file for more details on
...@@ -65,4 +65,4 @@ yourmodule-objs := file1.o file2.o file3.o ...@@ -65,4 +65,4 @@ yourmodule-objs := file1.o file2.o file3.o
# Invokes the kernel build system to come back to the current # Invokes the kernel build system to come back to the current
# directory and build yourmodule.ko. # directory and build yourmodule.ko.
default: default:
make -C ${KERNEL_SOURCE} SUBDIRS=`pwd` modules make -C ${KERNEL_SOURCE} M=`pwd` modules
...@@ -53,7 +53,7 @@ ifndef KBUILD_CHECKSRC ...@@ -53,7 +53,7 @@ ifndef KBUILD_CHECKSRC
KBUILD_CHECKSRC = 0 KBUILD_CHECKSRC = 0
endif endif
# Use make M=dir to specify direcotry of external module to build # Use make M=dir to specify directory of external module to build
# Old syntax make ... SUBDIRS=$PWD is still supported # Old syntax make ... SUBDIRS=$PWD is still supported
# Setting the environment variable KBUILD_EXTMOD take precedence # Setting the environment variable KBUILD_EXTMOD take precedence
ifdef SUBDIRS ifdef SUBDIRS
...@@ -130,16 +130,6 @@ else ...@@ -130,16 +130,6 @@ else
_all: modules _all: modules
endif endif
# Make sure we're not wasting cpu-cycles doing locale handling, yet do make
# sure error messages appear in the user-desired language
ifdef LC_ALL
LANG := $(LC_ALL)
LC_ALL :=
endif
LC_COLLATE := C
LC_CTYPE := C
export LANG LC_ALL LC_COLLATE LC_CTYPE
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
TOPDIR := $(srctree) TOPDIR := $(srctree)
# FIXME - TOPDIR is obsolete, use srctree/objtree # FIXME - TOPDIR is obsolete, use srctree/objtree
...@@ -622,24 +612,43 @@ vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ...@@ -622,24 +612,43 @@ vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE
$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; $(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ;
# Handle descending into subdirectories listed in $(vmlinux-dirs) # Handle descending into subdirectories listed in $(vmlinux-dirs)
# Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running
# make menuconfig etc.
# Error messages still appears in the original language
.PHONY: $(vmlinux-dirs) .PHONY: $(vmlinux-dirs)
$(vmlinux-dirs): prepare-all scripts $(vmlinux-dirs): prepare-all scripts
$(Q)$(MAKE) $(build)=$@ $(Q)if [ ! -z $$LC_ALL ]; then \
export LANG=$$LC_ALL; \
export LC_ALL= ; \
fi; \
export LC_COLLATE=C; export LC_CTYPE=C; \
$(MAKE) $(build)=$@
# Things we need to do before we recursively start building the kernel # Things we need to do before we recursively start building the kernel
# or the modules are listed in "prepare-all". # or the modules are listed in "prepare-all".
# A multi level approach is used. prepare1 is updated first, then prepare0. # A multi level approach is used. prepare1 is updated first, then prepare0.
# prepare-all is the collection point for the prepare targets. # prepare-all is the collection point for the prepare targets.
.PHONY: prepare-all prepare prepare0 prepare1 .PHONY: prepare-all prepare prepare0 prepare1 prepare2
# prepare 2 generate Makefile to be placed in output directory, if
# using a seperate output directory. This allows convinient use
# of make in output directory
prepare2:
$(Q)if [ ! $(srctree) -ef $(objtree) ]; then \
$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \
> $(objtree)/Makefile; \
fi
# prepare1 is used to check if we are building in a separate output directory, # prepare1 is used to check if we are building in a separate output directory,
# and if so do: # and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree) # 1) Check that make has not been executed in the kernel src $(srctree)
# 2) Create the include2 directory, used for the second asm symlink # 2) Create the include2 directory, used for the second asm symlink
prepare1: prepare1: prepare2
ifneq ($(KBUILD_SRC),) ifneq ($(KBUILD_SRC),)
@echo ' Using $(srctree) as source for kernel' @echo ' Using $(srctree) as source for kernel'
$(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \ $(Q)if [ -h $(srctree)/include/asm -o -f $(srctree)/.config ]; then \
...@@ -760,9 +769,13 @@ _modinst_: ...@@ -760,9 +769,13 @@ _modinst_:
sleep 1; \ sleep 1; \
fi fi
@rm -rf $(MODLIB)/kernel @rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/build @rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel @mkdir -p $(MODLIB)/kernel
@ln -s $(TOPDIR) $(MODLIB)/build @ln -s $(srctree) $(MODLIB)/source
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
rm -f $(MODLIB)/build ; \
ln -s $(objtree) $(MODLIB)/build ; \
fi
$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst $(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
# If System.map exists, run depmod. This deliberately does not have a # If System.map exists, run depmod. This deliberately does not have a
...@@ -1009,19 +1022,19 @@ endif # KBUILD_EXTMOD ...@@ -1009,19 +1022,19 @@ endif # KBUILD_EXTMOD
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
define all-sources define all-sources
( find . $(RCS_FIND_IGNORE) \ ( find $(srctree) $(RCS_FIND_IGNORE) \
\( -name include -o -name arch \) -prune -o \ \( -name include -o -name arch \) -prune -o \
-name '*.[chS]' -print; \ -name '*.[chS]' -print; \
find arch/$(ARCH) $(RCS_FIND_IGNORE) \ find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \ -name '*.[chS]' -print; \
find security/selinux/include $(RCS_FIND_IGNORE) \ find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \ -name '*.[chS]' -print; \
find include $(RCS_FIND_IGNORE) \ find $(srctree)/include $(RCS_FIND_IGNORE) \
\( -name config -o -name 'asm-*' \) -prune \ \( -name config -o -name 'asm-*' \) -prune \
-o -name '*.[chS]' -print; \ -o -name '*.[chS]' -print; \
find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \ find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print; \ -name '*.[chS]' -print; \
find include/asm-generic $(RCS_FIND_IGNORE) \ find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
-name '*.[chS]' -print ) -name '*.[chS]' -print )
endef endef
......
...@@ -22,7 +22,7 @@ endif ...@@ -22,7 +22,7 @@ endif
LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS += -Iarch/$(ARCH) CPPFLAGS += -Iarch/$(ARCH)
AFLAGS += -Iarch/$(ARCH) aflags-y += -Iarch/$(ARCH)
cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \ cflags-y += -Iarch/$(ARCH) -msoft-float -pipe \
-ffixed-r2 -Wno-uninitialized -mmultiple -ffixed-r2 -Wno-uninitialized -mmultiple
CPP = $(CC) -E $(CFLAGS) CPP = $(CC) -E $(CFLAGS)
...@@ -33,10 +33,16 @@ ifndef CONFIG_E500 ...@@ -33,10 +33,16 @@ ifndef CONFIG_E500
cflags-y += -mstring cflags-y += -mstring
endif endif
aflags-$(CONFIG_4xx) += -m405
cflags-$(CONFIG_4xx) += -Wa,-m405 cflags-$(CONFIG_4xx) += -Wa,-m405
aflags-$(CONFIG_6xx) += -maltivec
cflags-$(CONFIG_6xx) += -Wa,-maltivec
aflags-$(CONFIG_E500) += -me500
cflags-$(CONFIG_E500) += -Wa,-me500 cflags-$(CONFIG_E500) += -Wa,-me500
aflags-$(CONFIG_PPC64BRIDGE) += -mppc64bridge
cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge cflags-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
AFLAGS += $(aflags-y)
CFLAGS += $(cflags-y) CFLAGS += $(cflags-y)
head-y := arch/ppc/kernel/head.o head-y := arch/ppc/kernel/head.o
......
menu "Generic Driver Options" menu "Generic Driver Options"
config STANDALONE
bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
default y
help
Select this option if you don't have magic firmware for drivers that
need it.
If unsure, say Y.
config PREVENT_FIRMWARE_BUILD config PREVENT_FIRMWARE_BUILD
bool "Prevent firmware from being built" bool "Prevent firmware from being built"
default y default y
......
...@@ -706,8 +706,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma) ...@@ -706,8 +706,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr); extern struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr);
extern unsigned int nr_used_zone_pages(void);
extern struct page * vmalloc_to_page(void *addr); extern struct page * vmalloc_to_page(void *addr);
extern struct page * follow_page(struct mm_struct *mm, unsigned long address, extern struct page * follow_page(struct mm_struct *mm, unsigned long address,
int write); int write);
......
...@@ -41,15 +41,6 @@ config CLEAN_COMPILE ...@@ -41,15 +41,6 @@ config CLEAN_COMPILE
If unsure, say Y If unsure, say Y
config STANDALONE
bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
default y
help
Select this option if you don't have magic firmware for drivers that
need it.
If unsure, say Y.
config BROKEN config BROKEN
bool bool
depends on !CLEAN_COMPILE depends on !CLEAN_COMPILE
......
...@@ -825,17 +825,6 @@ unsigned int nr_free_pages(void) ...@@ -825,17 +825,6 @@ unsigned int nr_free_pages(void)
EXPORT_SYMBOL(nr_free_pages); EXPORT_SYMBOL(nr_free_pages);
unsigned int nr_used_zone_pages(void)
{
unsigned int pages = 0;
struct zone *zone;
for_each_zone(zone)
pages += zone->nr_active + zone->nr_inactive;
return pages;
}
#ifdef CONFIG_NUMA #ifdef CONFIG_NUMA
unsigned int nr_free_pages_pgdat(pg_data_t *pgdat) unsigned int nr_free_pages_pgdat(pg_data_t *pgdat)
{ {
......
...@@ -169,22 +169,25 @@ EXPORT_SYMBOL(remove_shrinker); ...@@ -169,22 +169,25 @@ EXPORT_SYMBOL(remove_shrinker);
* slab to avoid swapping. * slab to avoid swapping.
* *
* We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits. * We do weird things to avoid (scanned*seeks*entries) overflowing 32 bits.
*
* `lru_pages' represents the number of on-LRU pages in all the zones which
* are eligible for the caller's allocation attempt. It is used for balancing
* slab reclaim versus page reclaim.
*/ */
static int shrink_slab(unsigned long scanned, unsigned int gfp_mask) static int shrink_slab(unsigned long scanned, unsigned int gfp_mask,
unsigned long lru_pages)
{ {
struct shrinker *shrinker; struct shrinker *shrinker;
long pages;
if (down_trylock(&shrinker_sem)) if (down_trylock(&shrinker_sem))
return 0; return 0;
pages = nr_used_zone_pages();
list_for_each_entry(shrinker, &shrinker_list, list) { list_for_each_entry(shrinker, &shrinker_list, list) {
unsigned long long delta; unsigned long long delta;
delta = (4 * scanned) / shrinker->seeks; delta = (4 * scanned) / shrinker->seeks;
delta *= (*shrinker->shrinker)(0, gfp_mask); delta *= (*shrinker->shrinker)(0, gfp_mask);
do_div(delta, pages + 1); do_div(delta, lru_pages + 1);
shrinker->nr += delta; shrinker->nr += delta;
if (shrinker->nr < 0) if (shrinker->nr < 0)
shrinker->nr = LONG_MAX; /* It wrapped! */ shrinker->nr = LONG_MAX; /* It wrapped! */
...@@ -896,6 +899,7 @@ int try_to_free_pages(struct zone **zones, ...@@ -896,6 +899,7 @@ int try_to_free_pages(struct zone **zones,
int total_scanned = 0, total_reclaimed = 0; int total_scanned = 0, total_reclaimed = 0;
struct reclaim_state *reclaim_state = current->reclaim_state; struct reclaim_state *reclaim_state = current->reclaim_state;
struct scan_control sc; struct scan_control sc;
unsigned long lru_pages = 0;
int i; int i;
sc.gfp_mask = gfp_mask; sc.gfp_mask = gfp_mask;
...@@ -903,8 +907,12 @@ int try_to_free_pages(struct zone **zones, ...@@ -903,8 +907,12 @@ int try_to_free_pages(struct zone **zones,
inc_page_state(allocstall); inc_page_state(allocstall);
for (i = 0; zones[i] != 0; i++) for (i = 0; zones[i] != NULL; i++) {
zones[i]->temp_priority = DEF_PRIORITY; struct zone *zone = zones[i];
zone->temp_priority = DEF_PRIORITY;
lru_pages += zone->nr_active + zone->nr_inactive;
}
for (priority = DEF_PRIORITY; priority >= 0; priority--) { for (priority = DEF_PRIORITY; priority >= 0; priority--) {
sc.nr_mapped = read_page_state(nr_mapped); sc.nr_mapped = read_page_state(nr_mapped);
...@@ -912,7 +920,7 @@ int try_to_free_pages(struct zone **zones, ...@@ -912,7 +920,7 @@ int try_to_free_pages(struct zone **zones,
sc.nr_reclaimed = 0; sc.nr_reclaimed = 0;
sc.priority = priority; sc.priority = priority;
shrink_caches(zones, &sc); shrink_caches(zones, &sc);
shrink_slab(sc.nr_scanned, gfp_mask); shrink_slab(sc.nr_scanned, gfp_mask, lru_pages);
if (reclaim_state) { if (reclaim_state) {
sc.nr_reclaimed += reclaim_state->reclaimed_slab; sc.nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0; reclaim_state->reclaimed_slab = 0;
...@@ -997,7 +1005,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) ...@@ -997,7 +1005,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
for (priority = DEF_PRIORITY; priority >= 0; priority--) { for (priority = DEF_PRIORITY; priority >= 0; priority--) {
int all_zones_ok = 1; int all_zones_ok = 1;
int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */ int end_zone = 0; /* Inclusive. 0 = ZONE_DMA */
unsigned long lru_pages = 0;
if (nr_pages == 0) { if (nr_pages == 0) {
/* /*
...@@ -1021,6 +1029,12 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) ...@@ -1021,6 +1029,12 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
end_zone = pgdat->nr_zones - 1; end_zone = pgdat->nr_zones - 1;
} }
scan: scan:
for (i = 0; i <= end_zone; i++) {
struct zone *zone = pgdat->node_zones + i;
lru_pages += zone->nr_active + zone->nr_inactive;
}
/* /*
* Now scan the zone in the dma->highmem direction, stopping * Now scan the zone in the dma->highmem direction, stopping
* at the last zone which needs scanning. * at the last zone which needs scanning.
...@@ -1048,7 +1062,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages) ...@@ -1048,7 +1062,7 @@ static int balance_pgdat(pg_data_t *pgdat, int nr_pages)
sc.priority = priority; sc.priority = priority;
shrink_zone(zone, &sc); shrink_zone(zone, &sc);
reclaim_state->reclaimed_slab = 0; reclaim_state->reclaimed_slab = 0;
shrink_slab(sc.nr_scanned, GFP_KERNEL); shrink_slab(sc.nr_scanned, GFP_KERNEL, lru_pages);
sc.nr_reclaimed += reclaim_state->reclaimed_slab; sc.nr_reclaimed += reclaim_state->reclaimed_slab;
total_reclaimed += sc.nr_reclaimed; total_reclaimed += sc.nr_reclaimed;
if (zone->all_unreclaimable) if (zone->all_unreclaimable)
......
...@@ -5,24 +5,11 @@ ...@@ -5,24 +5,11 @@
# docproc: Preprocess .tmpl file in order to generate .sgml docs # docproc: Preprocess .tmpl file in order to generate .sgml docs
# conmakehash: Create arrays for initializing the kernel console tables # conmakehash: Create arrays for initializing the kernel console tables
host-progs := conmakehash kallsyms modpost mk_elfconfig pnmtologo bin2c host-progs := conmakehash kallsyms pnmtologo bin2c
always := $(host-progs) empty.o always := $(host-progs)
modpost-objs := modpost.o file2alias.o sumversion.o
subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_MODVERSIONS) += genksyms
subdir-y += mod
# Let clean descend into subdirs # Let clean descend into subdirs
subdir- += basic lxdialog kconfig package subdir- += basic lxdialog kconfig package
# dependencies on generated files need to be listed explicitly
$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h
quiet_cmd_elfconfig = MKELF $@
cmd_elfconfig = $(obj)/mk_elfconfig $(ARCH) < $< > $@
$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
$(call if_changed,elfconfig)
targets += elfconfig.h
...@@ -50,7 +50,7 @@ _modpost: $(modules) ...@@ -50,7 +50,7 @@ _modpost: $(modules)
# Step 2), invoke modpost # Step 2), invoke modpost
# Includes step 3,4 # Includes step 3,4
quiet_cmd_modpost = MODPOST quiet_cmd_modpost = MODPOST
cmd_modpost = scripts/modpost \ cmd_modpost = scripts/mod/modpost \
$(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \ $(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \
$(filter-out FORCE,$^) $(filter-out FORCE,$^)
......
This diff is collapsed.
#!/bin/sh
# Generates a small Makefile used in the root of the output
# directory, to allow make to be started from there.
# The Makefile also allow for more convinient build of external modules
# Usage
# $1 - Kernel src directory
# $2 - Output directory
# $3 - version
# $4 - patchlevel
cat << EOF
# Automatically generated by $0: don't edit
VERSION = $3
PATCHLEVEL = $4
KERNELSRC := $1
KERNELOUTPUT := $2
MAKEFLAGS += --no-print-directory
all:
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT)
%::
\$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
EOF
host-progs := modpost mk_elfconfig
always := $(host-progs) empty.o
modpost-objs := modpost.o file2alias.o sumversion.o
# dependencies on generated files need to be listed explicitly
$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h
quiet_cmd_elfconfig = MKELF $@
cmd_elfconfig = $(obj)/mk_elfconfig $(ARCH) < $< > $@
$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE
$(call if_changed,elfconfig)
targets += elfconfig.h
...@@ -27,7 +27,7 @@ typedef unsigned char __u8; ...@@ -27,7 +27,7 @@ typedef unsigned char __u8;
/* Big exception to the "don't include kernel headers into userspace, which /* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since * even potentially has different endianness and word sizes, since
* we handle those differences explicitly below */ * we handle those differences explicitly below */
#include "../include/linux/mod_devicetable.h" #include "../../include/linux/mod_devicetable.h"
#define ADD(str, sep, cond, field) \ #define ADD(str, sep, cond, field) \
do { \ do { \
......
...@@ -31,9 +31,10 @@ KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE)) ...@@ -31,9 +31,10 @@ KERNELPATH := kernel-$(subst -,,$(KERNELRELEASE))
MKSPEC := $(srctree)/scripts/package/mkspec MKSPEC := $(srctree)/scripts/package/mkspec
PREV := set -e; cd ..; PREV := set -e; cd ..;
# rpm-pkg
.PHONY: rpm-pkg rpm .PHONY: rpm-pkg rpm
$(objtree)/kernel.spec: $(MKSPEC) $(objtree)/kernel.spec: $(MKSPEC) $(srctree)/Makefile
$(CONFIG_SHELL) $(MKSPEC) > $@ $(CONFIG_SHELL) $(MKSPEC) > $@
rpm-pkg rpm: $(objtree)/kernel.spec rpm-pkg rpm: $(objtree)/kernel.spec
...@@ -52,6 +53,22 @@ rpm-pkg rpm: $(objtree)/kernel.spec ...@@ -52,6 +53,22 @@ rpm-pkg rpm: $(objtree)/kernel.spec
clean-rule += rm -f $(objtree)/kernel.spec clean-rule += rm -f $(objtree)/kernel.spec
# binrpm-pkg
.PHONY: binrpm-pkg
$(objtree)/binkernel.spec: $(MKSPEC) $(srctree)/Makefile
$(CONFIG_SHELL) $(MKSPEC) prebuilt > $@
binrpm-pkg: $(objtree)/binkernel.spec
$(MAKE)
set -e; \
$(CONFIG_SHELL) $(srctree)/scripts/mkversion > $(objtree)/.tmp_version
set -e; \
mv -f $(objtree)/.tmp_version $(objtree)/.version
$(RPM) --define "_builddir $(srctree)" --target $(UTS_MACHINE) -bb $<
clean-rule += rm -f $(objtree)/binkernel.spec
# Deb target # Deb target
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# #
...@@ -67,5 +84,6 @@ clean-rule += && rm -rf $(objtree)/debian/ ...@@ -67,5 +84,6 @@ clean-rule += && rm -rf $(objtree)/debian/
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
help: help:
@echo ' rpm-pkg - Build the kernel as an RPM package' @echo ' rpm-pkg - Build the kernel as an RPM package'
@echo ' binrpm-pkg - Build an rpm package containing the compiled kernel & modules'
@echo ' deb-pkg - Build the kernel as an deb package' @echo ' deb-pkg - Build the kernel as an deb package'
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
# Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net>
# #
# how we were called determines which rpms we build and how we build them
if [ "$1" = "prebuilt" ]; then
PREBUILT=true
else
PREBUILT=false
fi
# starting to output the spec # starting to output the spec
if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then if [ "`grep CONFIG_DRM=y .config | cut -f2 -d\=`" = "y" ]; then
PROVIDES=kernel-drm PROVIDES=kernel-drm
...@@ -26,8 +33,12 @@ echo "License: GPL" ...@@ -26,8 +33,12 @@ echo "License: GPL"
echo "Group: System Environment/Kernel" echo "Group: System Environment/Kernel"
echo "Vendor: The Linux Community" echo "Vendor: The Linux Community"
echo "URL: http://www.kernel.org" echo "URL: http://www.kernel.org"
if ! $PREBUILT; then
echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL" echo -n "Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL"
echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g" echo "$EXTRAVERSION.tar.gz" | sed -e "s/-//g"
fi
echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root" echo "BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root"
echo "Provides: $PROVIDES" echo "Provides: $PROVIDES"
echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :" echo "%define __spec_install_post /usr/lib/rpm/brp-compress || :"
...@@ -36,12 +47,20 @@ echo "" ...@@ -36,12 +47,20 @@ echo ""
echo "%description" echo "%description"
echo "The Linux Kernel, the operating system core itself" echo "The Linux Kernel, the operating system core itself"
echo "" echo ""
if ! $PREBUILT; then
echo "%prep" echo "%prep"
echo "%setup -q" echo "%setup -q"
echo "" echo ""
fi
echo "%build" echo "%build"
if ! $PREBUILT; then
echo "make clean && make" echo "make clean && make"
echo "" echo ""
fi
echo "%install" echo "%install"
echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules' echo 'mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment