Quote shell variables in scripts
svn path=/dists/trunk/linux-2.6/; revision=4592
This commit is contained in:
parent
24b936cb3a
commit
feedb9bc33
|
@ -3,7 +3,11 @@ linux-2.6 (2.6.13+2.6.14c5-0experimental.1) experimental; urgency=low
|
||||||
[ Sven Luther ]
|
[ Sven Luther ]
|
||||||
* Upgraded to 2.6.14-rc5.
|
* Upgraded to 2.6.14-rc5.
|
||||||
|
|
||||||
-- Sven Luther <luther@debian.org> Fri, 21 Oct 2005 18:40:40 +0000
|
[ Jonas Smedegaard ]
|
||||||
|
* Quote variables in debian/rules.real and postinstall (making it
|
||||||
|
safer to run with weird characters in path of build environment).
|
||||||
|
|
||||||
|
-- Jonas Smedegaard <dr@jones.dk> Fri, 21 Oct 2005 21:01:12 +0200
|
||||||
|
|
||||||
linux-2.6 (2.6.13+2.6.14-rc4-0experimental.1) experimental; urgency=low
|
linux-2.6 (2.6.13+2.6.14-rc4-0experimental.1) experimental; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
# variable. It will also be passed a list of source files
|
# variable. It will also be passed a list of source files
|
||||||
#
|
#
|
||||||
SHELL := sh -e
|
SHELL := sh -e
|
||||||
DEB_HOST_ARCH := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_ARCH)
|
DEB_HOST_ARCH := $(shell dpkg-architecture -a'$(ARCH)' -qDEB_HOST_ARCH)
|
||||||
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_GNU_TYPE)
|
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -a'$(ARCH)' -qDEB_HOST_GNU_TYPE)
|
||||||
DEB_BUILD_ARCH := $(shell dpkg-architecture -a$(ARCH) -qDEB_BUILD_ARCH)
|
DEB_BUILD_ARCH := $(shell dpkg-architecture -a'$(ARCH)' -qDEB_BUILD_ARCH)
|
||||||
#
|
#
|
||||||
# Build the list of common config files to be included
|
# Build the list of common config files to be included
|
||||||
#
|
#
|
||||||
|
@ -38,27 +38,27 @@ include debian/rules.defs
|
||||||
# replaced by the flavour for which the command is run.
|
# replaced by the flavour for which the command is run.
|
||||||
#
|
#
|
||||||
kpkg_header := HEADER_CLEAN_HOOK='$(CURDIR)/$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)'
|
kpkg_header := HEADER_CLEAN_HOOK='$(CURDIR)/$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)'
|
||||||
kpkg_header += make-kpkg --append-to-version "$(KPKG_ABINAME)"
|
kpkg_header += make-kpkg --append-to-version '$(KPKG_ABINAME)'
|
||||||
kpkg_header += --arch $(ARCH)
|
kpkg_header += --arch '$(ARCH)'
|
||||||
kpkg_header += --stem linux
|
kpkg_header += --stem linux
|
||||||
kpkg_header += --config defconfig
|
kpkg_header += --config defconfig
|
||||||
kpkg_image := make-kpkg --append-to-version "$(KPKG_ABINAME)-$(FLAVOUR)"
|
kpkg_image := make-kpkg --append-to-version '$(KPKG_ABINAME)-$(FLAVOUR)'
|
||||||
kpkg_image += --arch $(ARCH)
|
kpkg_image += --arch '$(ARCH)'
|
||||||
kpkg_image += --stem linux
|
kpkg_image += --stem linux
|
||||||
kpkg_image += --initrd
|
kpkg_image += --initrd
|
||||||
ifdef KPKG_SUBARCH
|
ifdef KPKG_SUBARCH
|
||||||
kpkg_image += --subarch $(KPKG_SUBARCH)
|
kpkg_image += --subarch '$(KPKG_SUBARCH)'
|
||||||
kpkg_header += --subarch $(KPKG_SUBARCH)
|
kpkg_header += --subarch '$(KPKG_SUBARCH)'
|
||||||
endif
|
endif
|
||||||
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
|
||||||
kpkg_header += --cross-compile=$(DEB_HOST_GNU_TYPE)
|
kpkg_header += --cross-compile='$(DEB_HOST_GNU_TYPE)'
|
||||||
kpkg_image += --cross-compile=$(DEB_HOST_GNU_TYPE)
|
kpkg_image += --cross-compile='$(DEB_HOST_GNU_TYPE)'
|
||||||
endif
|
endif
|
||||||
setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION
|
setup_env := env -u ABINAME -u ARCH -u SUBARCH -u FLAVOUR -u VERSION
|
||||||
setup_env += DEBIAN_ABINAME=$(ABINAME) DEBIAN_FLAVOUR=$(FLAVOUR) DEBIAN_VERSION=$(VERSION)
|
setup_env += DEBIAN_ABINAME='$(ABINAME)' DEBIAN_FLAVOUR='$(FLAVOUR)' DEBIAN_VERSION='$(VERSION)'
|
||||||
setup_makeflags =
|
setup_makeflags =
|
||||||
ifdef COMPILER
|
ifdef COMPILER
|
||||||
setup_makeflags += CC=$$$$(CROSS_COMPILE)$(COMPILER)
|
setup_makeflags += CC="$$$$(CROSS_COMPILE)$(COMPILER)"
|
||||||
endif
|
endif
|
||||||
setup_env += MAKEFLAGS='$(setup_makeflags)'
|
setup_env += MAKEFLAGS='$(setup_makeflags)'
|
||||||
ifndef headers_dirs
|
ifndef headers_dirs
|
||||||
|
@ -80,8 +80,8 @@ setup-subarch: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)
|
||||||
setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
|
|
||||||
$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH): $(TEMPLATES_DIR)/header-install.in
|
$(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH): $(TEMPLATES_DIR)/header-install.in
|
||||||
sed -e 's,@headers_dirs@,$(headers_dirs),g' $< > $@
|
sed -e 's,@headers_dirs@,$(headers_dirs),g' '$<' > '$@'
|
||||||
chmod u+x $@
|
chmod u+x '$@'
|
||||||
#
|
#
|
||||||
# The way to make the correct package names is to make a
|
# The way to make the correct package names is to make a
|
||||||
# subarch-specific post-install script...
|
# subarch-specific post-install script...
|
||||||
|
@ -95,7 +95,7 @@ $(BUILD_DIR)/post-install-$(ARCH)-$(SUBARCH): $(TEMPLATES_DIR)/post-install.in
|
||||||
sed -e 's,@initrd_modules@,$(initrd_modules),' \
|
sed -e 's,@initrd_modules@,$(initrd_modules),' \
|
||||||
-e 's,@extra_postinstall_command@,$(extra_command),' \
|
-e 's,@extra_postinstall_command@,$(extra_command),' \
|
||||||
-e 's,@headers_dirs@,$(headers_dirs),g' \
|
-e 's,@headers_dirs@,$(headers_dirs),g' \
|
||||||
$< > $@
|
'$<' > '$@'
|
||||||
#
|
#
|
||||||
# Generates the kernel config file for a subarch by merging
|
# Generates the kernel config file for a subarch by merging
|
||||||
# the arch-independent config file (arch/config),
|
# the arch-independent config file (arch/config),
|
||||||
|
@ -111,37 +111,37 @@ ifneq ($(SUBARCH),none)
|
||||||
endif
|
endif
|
||||||
$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(basedir)/config.$(FLAVOUR) $(config_common)
|
$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(basedir)/config.$(FLAVOUR) $(config_common)
|
||||||
@echo "Generating configuration file $@:"
|
@echo "Generating configuration file $@:"
|
||||||
rm -f $@
|
rm -f '$@'
|
||||||
for i in $(config_common); do \
|
for i in $(config_common); do \
|
||||||
if [ -f $${i} ]; then \
|
if [ -f "$${i}" ]; then \
|
||||||
cat $${i} >> $@; \
|
cat "$${i}" >> '$@'; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
# Flavour config file must be present
|
# Flavour config file must be present
|
||||||
cat $(basedir)/config.$(FLAVOUR) >> $@
|
cat '$(basedir)/config.$(FLAVOUR)' >> '$@'
|
||||||
|
|
||||||
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
|
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
|
||||||
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION)
|
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION)
|
||||||
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: $(STAMPS_DIR)/source
|
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: $(STAMPS_DIR)/source
|
||||||
rm -rf $@ $(DIR)
|
rm -rf '$@' '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
chmod -R u+rw,go=rX $(DIR)
|
chmod -R u+rw,go=rX '$(DIR)'
|
||||||
cd $(BUILD_DIR); tar -cjf linux-source-$(UPSTREAM_VERSION).tar.bz2 linux-source-$(UPSTREAM_VERSION)
|
cd '$(BUILD_DIR)'; tar -cjf 'linux-source-$(UPSTREAM_VERSION).tar.bz2' 'linux-source-$(UPSTREAM_VERSION)'
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
|
|
||||||
srcfiles := $(filter-out debian, $(wildcard *))
|
srcfiles := $(filter-out debian, $(wildcard *))
|
||||||
$(STAMPS_DIR)/source: DIR=$(BUILD_DIR)/source
|
$(STAMPS_DIR)/source: DIR=$(BUILD_DIR)/source
|
||||||
$(STAMPS_DIR)/source: debian/bin/apply
|
$(STAMPS_DIR)/source: debian/bin/apply
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
mkdir -p $(DIR)
|
mkdir -p '$(DIR)'
|
||||||
cp -al $(srcfiles) $(DIR)
|
cp -al $(srcfiles) '$(DIR)'
|
||||||
cd $(DIR); override_version="$(SOURCE_VERSION)" override_revisions="$(REVISIONS)" home=$(CURDIR)/debian/patches-debian sh $(CURDIR)/debian/bin/apply
|
cd '$(DIR)'; override_version='$(SOURCE_VERSION)' override_revisions='$(REVISIONS)' home='$(CURDIR)/debian/patches-debian' sh '$(CURDIR)/debian/bin/apply'
|
||||||
#make-kpkg does this when building kernel-source.
|
#make-kpkg does this when building kernel-source.
|
||||||
mv $(DIR)/scripts/package/Makefile $(DIR)/scripts/package/Makefile.dist
|
mv '$(DIR)/scripts/package/Makefile' '$(DIR)/scripts/package/Makefile.dist'
|
||||||
mv $(DIR)/scripts/package/builddeb $(DIR)/scripts/package/builddeb.dist
|
mv '$(DIR)/scripts/package/builddeb' '$(DIR)/scripts/package/builddeb.dist'
|
||||||
echo "# Dummy Makefile" > $(DIR)/scripts/package/Makefile
|
echo "# Dummy Makefile" > '$(DIR)/scripts/package/Makefile'
|
||||||
echo "all:" >> $(DIR)/scripts/package/Makefile
|
echo "all:" >> '$(DIR)/scripts/package/Makefile'
|
||||||
touch $@
|
touch '$@'
|
||||||
|
|
||||||
patches := $(wildcard debian/patches-arch/$(SUBARCH).*)
|
patches := $(wildcard debian/patches-arch/$(SUBARCH).*)
|
||||||
patches += $(wildcard debian/patches-arch/$(SUBARCH)_*)
|
patches += $(wildcard debian/patches-arch/$(SUBARCH)_*)
|
||||||
|
@ -151,19 +151,21 @@ patches := $(strip $(patches))
|
||||||
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source
|
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source
|
||||||
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(BUILD_DIR)/post-install-$(ARCH)-$(SUBARCH) $(STAMPS_DIR)/source
|
$(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(BUILD_DIR)/post-install-$(ARCH)-$(SUBARCH) $(STAMPS_DIR)/source
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
mkdir -p $(DIR)/debian
|
mkdir -p '$(DIR)/debian'
|
||||||
cp debian/changelog $(DIR)/debian
|
cp debian/changelog '$(DIR)/debian'
|
||||||
cp debian/copyright $(DIR)/debian
|
cp debian/copyright '$(DIR)/debian'
|
||||||
cp debian/control $(DIR)/debian/control
|
cp debian/control '$(DIR)/debian/control'
|
||||||
touch $(DIR)/debian/official
|
touch '$(DIR)/debian/official'
|
||||||
if [ -n '$(patches)' ]; then \
|
if [ -n '$(patches)' ]; then \
|
||||||
cd $(DIR); \
|
cd '$(DIR)'; \
|
||||||
for patch in $(patches); do cat "$(CURDIR)/$$patch" | patch -p1; done; \
|
for patch in $(patches); do \
|
||||||
|
cat "$(CURDIR)/$$patch" | patch -p1; \
|
||||||
|
done; \
|
||||||
fi
|
fi
|
||||||
install $< $(DIR)/debian/post-install
|
install '$<' '$(DIR)/debian/post-install'
|
||||||
touch $@
|
touch '$@'
|
||||||
#
|
#
|
||||||
# This target performs a build for a particular flavour. Note
|
# This target performs a build for a particular flavour. Note
|
||||||
# that in this file it should be always placed *before* the
|
# that in this file it should be always placed *before* the
|
||||||
|
@ -171,29 +173,29 @@ $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH): $(BUILD_DIR)/post-install-$(ARCH)-$(SUB
|
||||||
#
|
#
|
||||||
$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
$(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
ln -fs $$(command -v touch) debian/build/touch.orig
|
ln -fs "$$(command -v touch)" debian/build/touch.orig
|
||||||
cd $(DIR); $(setup_env) PATH=$(CURDIR)/build:$(CURDIR)/bin:$(PATH) $(kpkg_image) build
|
cd '$(DIR)'; $(setup_env) PATH='$(CURDIR)/build:$(CURDIR)/bin:$(PATH)' $(kpkg_image) build
|
||||||
ifdef image_postproc
|
ifdef image_postproc
|
||||||
cd $(DIR); $(image_postproc)
|
cd '$(DIR)'; $(image_postproc)
|
||||||
endif
|
endif
|
||||||
touch $@
|
touch '$@'
|
||||||
|
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR) $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
cp $< $(DIR)/.config
|
cp '$<' '$(DIR)/.config'
|
||||||
cd $(DIR); $(setup_env) $(kpkg_image) configure
|
cd '$(DIR)'; $(setup_env) $(kpkg_image) configure
|
||||||
touch $@
|
touch '$@'
|
||||||
|
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
|
||||||
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
$(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
cd $(DIR); $(setup_env) $(kpkg_header) configure
|
cd '$(DIR)'; $(setup_env) $(kpkg_header) configure
|
||||||
touch $@
|
touch '$@'
|
||||||
|
|
||||||
install-base:
|
install-base:
|
||||||
dh_compress
|
dh_compress
|
||||||
|
@ -206,19 +208,22 @@ install-base:
|
||||||
install-doc: SOURCE_DIR=$(BUILD_DIR)/source
|
install-doc: SOURCE_DIR=$(BUILD_DIR)/source
|
||||||
install-doc: DIR=$(BUILD_DIR)/$@
|
install-doc: DIR=$(BUILD_DIR)/$@
|
||||||
install-doc: $(STAMPS_DIR)/source
|
install-doc: $(STAMPS_DIR)/source
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
mkdir -p $(DIR)/debian
|
mkdir -p '$(DIR)/debian'
|
||||||
cp debian/changelog $(DIR)/debian
|
cp debian/changelog '$(DIR)/debian'
|
||||||
cp debian/copyright $(DIR)/debian
|
cp debian/copyright '$(DIR)/debian'
|
||||||
cp debian/control $(DIR)/debian/control
|
cp debian/control '$(DIR)/debian/control'
|
||||||
touch $(DIR)/debian/official
|
touch '$(DIR)/debian/official'
|
||||||
rm $(DIR)/Makefile
|
rm '$(DIR)/Makefile'
|
||||||
sed -e 's,^EXTRAVERSION.*$$,EXTRAVERSION =,' < $(SOURCE_DIR)/Makefile > $(DIR)/Makefile
|
sed -e 's,^EXTRAVERSION.*$$,EXTRAVERSION =,' < '$(SOURCE_DIR)/Makefile' > '$(DIR)/Makefile'
|
||||||
cd $(DIR) && $(setup_env) make-kpkg --stem linux kernel-manual
|
cd '$(DIR)' && $(setup_env) make-kpkg --stem linux kernel-manual
|
||||||
cat $(DIR)/debian/files >> debian/files
|
cat '$(DIR)/debian/files' >> debian/files
|
||||||
@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $(BUILD_DIR)/$$i ..; mv $(BUILD_DIR)/$$i ..; done
|
@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \
|
||||||
rm -rf $(DIR)
|
echo "mv \"$(BUILD_DIR)/$$i\" .."; \
|
||||||
|
mv "$(BUILD_DIR)/$$i" ..; \
|
||||||
|
done
|
||||||
|
rm -rf '$(DIR)'
|
||||||
|
|
||||||
install-dummy:
|
install-dummy:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
|
@ -231,31 +236,37 @@ install-dummy:
|
||||||
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/$@
|
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DIR=$(BUILD_DIR)/$@
|
||||||
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
cd $(DIR); $(setup_env) $(kpkg_image) kernel-image
|
cd '$(DIR)'; $(setup_env) $(kpkg_image) kernel-image
|
||||||
cat $(DIR)/debian/files >> debian/files
|
cat '$(DIR)/debian/files' >> debian/files
|
||||||
@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $(BUILD_DIR)/$$i ..; mv $(BUILD_DIR)/$$i ..; done
|
@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \
|
||||||
rm -rf $(DIR)
|
echo "mv \"$(BUILD_DIR)/$$i\" .."; \
|
||||||
|
mv "$(BUILD_DIR)/$$i" ..; \
|
||||||
|
done
|
||||||
|
rm -rf '$(DIR)'
|
||||||
|
|
||||||
install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
|
install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)
|
||||||
install-header-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/$@
|
install-header-$(ARCH)-$(SUBARCH): DIR=$(BUILD_DIR)/$@
|
||||||
install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH) $(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)
|
install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH) $(BUILD_DIR)/header-install-$(ARCH)-$(SUBARCH)
|
||||||
rm -rf $(DIR)
|
rm -rf '$(DIR)'
|
||||||
cp -al $(SOURCE_DIR) $(DIR)
|
cp -al '$(SOURCE_DIR)' '$(DIR)'
|
||||||
cd $(DIR); $(setup_env) $(kpkg_header) kernel-headers
|
cd '$(DIR)'; $(setup_env) $(kpkg_header) kernel-headers
|
||||||
cat $(DIR)/debian/files >> debian/files
|
cat '$(DIR)/debian/files' >> debian/files
|
||||||
@for i in $$(awk '{ print $$1; }' $(DIR)/debian/files); do echo mv $(BUILD_DIR)/$$i ..; mv $(BUILD_DIR)/$$i ..; done
|
@for i in $$(awk '{ print $$1; }' '$(DIR)/debian/files'); do \
|
||||||
rm -rf $(DIR)
|
echo "mv \"$(BUILD_DIR)/$$i\" .."; \
|
||||||
|
mv "$(BUILD_DIR)/$$i" ..; \
|
||||||
|
done
|
||||||
|
rm -rf '$(DIR)'
|
||||||
|
|
||||||
install-headers-all: DH_OPTIONS = -plinux-headers-$(VERSION)
|
install-headers-all: DH_OPTIONS = -plinux-headers-$(VERSION)
|
||||||
install-headers-all:
|
install-headers-all:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_install $(DH_OPTIONS) debian/arch /usr/src/linux-headers-$(VERSION)/debian
|
dh_install $(DH_OPTIONS) debian/arch '/usr/src/linux-headers-$(VERSION)/debian'
|
||||||
dh_installdocs $(DH_OPTIONS)
|
dh_installdocs $(DH_OPTIONS)
|
||||||
dh_installchangelogs $(DH_OPTIONS)
|
dh_installchangelogs $(DH_OPTIONS)
|
||||||
$(MAKE) -f debian/rules.real install-base DH_OPTIONS=$(DH_OPTIONS)
|
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
|
||||||
|
|
||||||
install-patch: PACKAGE = linux-patch-debian-$(VERSION)
|
install-patch: PACKAGE = linux-patch-debian-$(VERSION)
|
||||||
install-patch: pbase := /usr/src/kernel-patches/all/$(SOURCE_UPSTREAM)
|
install-patch: pbase := /usr/src/kernel-patches/all/$(SOURCE_UPSTREAM)
|
||||||
|
@ -266,43 +277,43 @@ install-patch:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_clean -d -k $(DH_OPTIONS)
|
dh_clean -d -k $(DH_OPTIONS)
|
||||||
dh_installdirs $(DH_OPTIONS) $(pbase)/apply $(pbase)/debian $(pbase)/unpatch
|
dh_installdirs $(DH_OPTIONS) '$(pbase)/apply' '$(pbase)/debian' '$(pbase)/unpatch'
|
||||||
dh_install $(DH_OPTIONS) debian/patches-debian/* $(pbase)/debian
|
dh_install $(DH_OPTIONS) debian/patches-debian/* '$(pbase)/debian'
|
||||||
# Install the debian patches
|
# Install the debian patches
|
||||||
sed -e 's/@version@/$(SOURCE_VERSION)/g' -e 's/@revisions@/$(REVISIONS)/' debian/bin/apply > $(pfull)/apply/debian
|
sed -e 's/@version@/$(SOURCE_VERSION)/g' -e 's/@revisions@/$(REVISIONS)/' debian/bin/apply > '$(pfull)/apply/debian'
|
||||||
sed -e 's/@upstream@/$(SOURCE_UPSTREAM)/g' debian/bin/unpatch > $(pfull)/unpatch/debian
|
sed -e 's/@upstream@/$(SOURCE_UPSTREAM)/g' debian/bin/unpatch > '$(pfull)/unpatch/debian'
|
||||||
chmod 755 $(pfull)/apply/debian $(pfull)/unpatch/debian
|
chmod 755 '$(pfull)/apply/debian' '$(pfull)/unpatch/debian'
|
||||||
chmod 644 $(pfull)/debian/*.patch
|
chmod 644 '$(pfull)/debian/'*.patch
|
||||||
bzip2 -9 $(pfull)/debian/*.patch
|
bzip2 -9 '$(pfull)/debian/'*.patch
|
||||||
# Now the arch/subarch-specific patches
|
# Now the arch/subarch-specific patches
|
||||||
for i in $(ptchs); do \
|
for i in $(ptchs); do \
|
||||||
arch=$${i%%.*}; \
|
arch="$${i%%.*}"; \
|
||||||
( \
|
( \
|
||||||
echo "Patch-name: $${arch}"; \
|
echo "Patch-name: $${arch}"; \
|
||||||
echo "Patch-id: $${arch}_$(subst .,_,$(VERSION))"; \
|
echo "Patch-id: $${arch}_$(subst .,_,$(VERSION))"; \
|
||||||
echo "Path-strip-level: 1"; \
|
echo "Path-strip-level: 1"; \
|
||||||
echo; \
|
echo; \
|
||||||
echo "Patch-file: debian/patches-arch/$${i}"; \
|
echo "Patch-file: debian/patches-arch/$${i}"; \
|
||||||
echo "Architecture: $${arch}"; \
|
echo "Architecture: $${arch}"; \
|
||||||
echo "Kernel-version: $(VERSION)"; \
|
echo "Kernel-version: $(VERSION)"; \
|
||||||
echo; \
|
echo; \
|
||||||
) > debian/$(PACKAGE).kpatches.arch; \
|
) > 'debian/$(PACKAGE).kpatches.arch'; \
|
||||||
dh_installkpatches $(DH_OPTIONS); \
|
dh_installkpatches $(DH_OPTIONS); \
|
||||||
done
|
done
|
||||||
dh_installdocs $(DH_OPTIONS)
|
dh_installdocs $(DH_OPTIONS)
|
||||||
dh_installchangelogs $(DH_OPTIONS)
|
dh_installchangelogs $(DH_OPTIONS)
|
||||||
$(MAKE) -f debian/rules.real install-base DH_OPTIONS=$(DH_OPTIONS)
|
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
|
||||||
|
|
||||||
install-source: DH_OPTIONS = -plinux-source-$(VERSION)
|
install-source: DH_OPTIONS = -plinux-source-$(VERSION)
|
||||||
install-source: $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2
|
install-source: $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_install $(DH_OPTIONS) $< /usr/src
|
dh_install $(DH_OPTIONS) '$<' /usr/src
|
||||||
dh_installdocs $(DH_OPTIONS) README
|
dh_installdocs $(DH_OPTIONS) README
|
||||||
dh_installchangelogs $(DH_OPTIONS)
|
dh_installchangelogs $(DH_OPTIONS)
|
||||||
$(MAKE) -f debian/rules.real install-base DH_OPTIONS=$(DH_OPTIONS)
|
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
|
||||||
|
|
||||||
install-tree: DH_OPTIONS = -plinux-tree-$(VERSION)
|
install-tree: DH_OPTIONS = -plinux-tree-$(VERSION)
|
||||||
install-tree:
|
install-tree:
|
||||||
$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS=$(DH_OPTIONS)
|
$(MAKE) -f debian/rules.real install-dummy DH_OPTIONS='$(DH_OPTIONS)'
|
||||||
|
|
||||||
|
|
|
@ -32,10 +32,10 @@ debhelper_post() {
|
||||||
# to linux-headers-$(subarch)-$(version)-$(abiname),
|
# to linux-headers-$(subarch)-$(version)-$(abiname),
|
||||||
# not just linux-headers-$(version)-$(abiname).
|
# not just linux-headers-$(version)-$(abiname).
|
||||||
#
|
#
|
||||||
prefix=$DEBIAN_VERSION-$DEBIAN_ABINAME
|
prefix="$DEBIAN_VERSION-$DEBIAN_ABINAME"
|
||||||
pkg=linux-headers-$prefix-$DEBIAN_FLAVOUR
|
pkg="linux-headers-$prefix-$DEBIAN_FLAVOUR"
|
||||||
top=$PWD/debian/$pkg
|
top="$PWD/debian/$pkg"
|
||||||
dir=$top/usr/src/$pkg
|
dir="$top/usr/src/$pkg"
|
||||||
#
|
#
|
||||||
# Here we need to find the kernel architecture which
|
# Here we need to find the kernel architecture which
|
||||||
# is appropriate for the current flavour. It is available
|
# is appropriate for the current flavour. It is available
|
||||||
|
@ -45,23 +45,23 @@ dir=$top/usr/src/$pkg
|
||||||
# Currently we just use the fact that in the build directory
|
# Currently we just use the fact that in the build directory
|
||||||
# the symlink include/asm must point to include/asm-${arch}
|
# the symlink include/asm must point to include/asm-${arch}
|
||||||
#
|
#
|
||||||
arch=$(readlink include/asm)
|
arch="$(readlink include/asm)"
|
||||||
arch=$(basename "${arch}")
|
arch="$(basename "${arch}")"
|
||||||
arch="${arch#asm-}"
|
arch="${arch#asm-}"
|
||||||
|
|
||||||
debhelper_pre $pkg
|
debhelper_pre "$pkg"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Stuff below is ugly as hell, but does the trick so I'm not
|
# Stuff below is ugly as hell, but does the trick so I'm not
|
||||||
# touching it until we can invent something better.
|
# touching it until we can invent something better.
|
||||||
#
|
#
|
||||||
mkdir -p $dir/arch/$arch/kernel
|
mkdir -p "$dir/arch/$arch/kernel"
|
||||||
mkdir -p $dir/include/asm-$arch
|
mkdir -p "$dir/include/asm-$arch"
|
||||||
mkdir -p $dir/include/linux
|
mkdir -p "$dir/include/linux"
|
||||||
cp -a .config $dir
|
cp -a .config "$dir"
|
||||||
echo $DEBIAN_VERSION-$DEBIAN_ABINAME-$DEBIAN_FLAVOUR > $dir/.extraversion
|
echo "$DEBIAN_VERSION-$DEBIAN_ABINAME-$DEBIAN_FLAVOUR" > "$dir/.extraversion"
|
||||||
|
|
||||||
cp -a Module.symvers $dir
|
cp -a Module.symvers "$dir"
|
||||||
|
|
||||||
find . -mindepth 1 -maxdepth 1 \
|
find . -mindepth 1 -maxdepth 1 \
|
||||||
! -name debian -a ! -name Documentation -a ! -name include -a \
|
! -name debian -a ! -name Documentation -a ! -name include -a \
|
||||||
|
@ -70,33 +70,33 @@ find . -mindepth 1 -maxdepth 1 \
|
||||||
-printf "../linux-headers-$prefix/%f\n" |
|
-printf "../linux-headers-$prefix/%f\n" |
|
||||||
xargs ln -s --target-directory="$dir"
|
xargs ln -s --target-directory="$dir"
|
||||||
|
|
||||||
find arch/$arch -mindepth 1 -maxdepth 1 \( \
|
find "arch/$arch" -mindepth 1 -maxdepth 1 \( \
|
||||||
-type d -a ! -name kernel -o \
|
-type d -a ! -name kernel -o \
|
||||||
-type f -a \( -name 'Makefile*' -o -name 'Kconfig*' \) \) \
|
-type f -a \( -name 'Makefile*' -o -name 'Kconfig*' \) \) \
|
||||||
-printf "../../../linux-headers-$prefix/%p\n" |
|
-printf "../../../linux-headers-$prefix/%p\n" |
|
||||||
xargs ln -s --target-directory=$dir/arch/$arch
|
xargs ln -s --target-directory="$dir/arch/$arch"
|
||||||
[ -f arch/$arch/kernel/asm-offsets.s ] && ln -f arch/$arch/kernel/asm-offsets.s $dir/arch/$arch/kernel
|
[ -f "arch/$arch/kernel/asm-offsets.s" ] && ln -f "arch/$arch/kernel/asm-offsets.s" "$dir/arch/$arch/kernel"
|
||||||
ln -s ../../../../linux-headers-$prefix/arch/$arch/kernel/Makefile $dir/arch/$arch/kernel
|
ln -s "../../../../linux-headers-$prefix/arch/$arch/kernel/Makefile" "$dir/arch/$arch/kernel"
|
||||||
find include -mindepth 1 -maxdepth 1 \
|
find include -mindepth 1 -maxdepth 1 \
|
||||||
! -name config -a ! -name linux -a ! -name 'asm-*' \
|
! -name config -a ! -name linux -a ! -name 'asm-*' \
|
||||||
-printf "../../linux-headers-$prefix/%p\n" |
|
-printf "../../linux-headers-$prefix/%p\n" |
|
||||||
xargs ln -s --target-directory=$dir/include
|
xargs ln -s --target-directory="$dir/include"
|
||||||
cp -a include/config $dir/include
|
cp -a include/config "$dir/include"
|
||||||
ln -sf asm-${arch} $dir/include/asm
|
ln -sf "asm-${arch}" "$dir/include/asm"
|
||||||
find include/asm-$arch -mindepth 1 -maxdepth 1 \
|
find "include/asm-$arch" -mindepth 1 -maxdepth 1 \
|
||||||
\( -type f -a ! -links 2 -o ! -type f \) \
|
\( -type f -a ! -links 2 -o ! -type f \) \
|
||||||
-printf "../../../linux-headers-$prefix/%p\n" |
|
-printf "../../../linux-headers-$prefix/%p\n" |
|
||||||
xargs --no-run-if-empty ln -s --target-directory=$dir/include/asm-$arch
|
xargs --no-run-if-empty ln -s --target-directory="$dir/include/asm-$arch"
|
||||||
find include/asm-$arch -mindepth 1 -maxdepth 1 \
|
find "include/asm-$arch" -mindepth 1 -maxdepth 1 \
|
||||||
-type f -links 2 |
|
-type f -links 2 |
|
||||||
xargs --no-run-if-empty ln -f --target-directory=$dir/include/asm-$arch
|
xargs --no-run-if-empty ln -f --target-directory="$dir/include/asm-$arch"
|
||||||
for i in include/asm-*
|
for i in include/asm-*
|
||||||
do
|
do
|
||||||
case ${i#include/asm-} in
|
case ${i#include/asm-} in
|
||||||
$arch)
|
$arch)
|
||||||
;;
|
;;
|
||||||
generic | @headers_dirs@)
|
generic | @headers_dirs@)
|
||||||
ln -s ../../linux-headers-$prefix/$i $dir/$i
|
ln -s "../../linux-headers-$prefix/$i" "$dir/$i"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
|
@ -105,27 +105,27 @@ done
|
||||||
find include/linux -mindepth 1 -maxdepth 1 \
|
find include/linux -mindepth 1 -maxdepth 1 \
|
||||||
! -name autoconf.h -a ! -name compile.h -a ! -name version.h \
|
! -name autoconf.h -a ! -name compile.h -a ! -name version.h \
|
||||||
-printf "../../../linux-headers-$prefix/%p\n" |
|
-printf "../../../linux-headers-$prefix/%p\n" |
|
||||||
xargs ln -s --target-directory=$dir/include/linux
|
xargs ln -s --target-directory="$dir/include/linux"
|
||||||
cp -a include/linux/autoconf.h include/linux/compile.h \
|
cp -a include/linux/autoconf.h include/linux/compile.h \
|
||||||
include/linux/version.h $dir/include/linux
|
include/linux/version.h "$dir/include/linux"
|
||||||
|
|
||||||
mkdir -p $top/lib/modules/$version
|
mkdir -p "$top/lib/modules/$version"
|
||||||
ln -s /usr/src/linux-headers-$version $top/lib/modules/$version/build
|
ln -s "/usr/src/linux-headers-$version" "$top/lib/modules/$version/build"
|
||||||
|
|
||||||
mkdir -p $dir/scripts
|
mkdir -p "$dir/scripts"
|
||||||
cp scripts/Makefile* $dir/scripts
|
cp scripts/Makefile* "$dir/scripts"
|
||||||
for i in $(find scripts -type f -perm +111 -o -name "*.sh" -o -name "*.pl"); do
|
for i in $(find scripts -type f -perm +111 -o -name "*.sh" -o -name "*.pl"); do
|
||||||
mkdir -p $dir/$(dirname $i)
|
mkdir -p "$dir/$(dirname $i)"
|
||||||
cp $i $dir/$i
|
cp "$i" "$dir/$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
debhelper_post $pkg
|
debhelper_post "$pkg"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check whether we should force any modules to be available
|
# Check whether we should force any modules to be available
|
||||||
# on the initrd.
|
# on the initrd.
|
||||||
#
|
#
|
||||||
cd ${IMAGE_TOP}/lib/modules/${version}
|
cd "${IMAGE_TOP}/lib/modules/${version}"
|
||||||
modules='@initrd_modules@'
|
modules='@initrd_modules@'
|
||||||
if [ -n "${modules}" ]; then
|
if [ -n "${modules}" ]; then
|
||||||
mkdir initrd
|
mkdir initrd
|
||||||
|
|
Loading…
Reference in New Issue