diff options
author | Xavier Boudet <x-boudet@ti.com> | 2012-07-17 13:51:26 +0200 |
---|---|---|
committer | Xavier Boudet <x-boudet@ti.com> | 2012-09-10 14:50:30 +0200 |
commit | 1ace75013cfe1b083b206f9849f9c495e2a5f606 (patch) | |
tree | 3c5c359dbb99a9c186f3713d7ff9678460db0941 /debian | |
parent | 760f1012f403e0c60cb4004a1661cab2a7714388 (diff) |
UBUNTU: Debianization update
Signed-off-by: Xavier Boudet <x-boudet@ti.com>
Diffstat (limited to 'debian')
-rw-r--r-- | debian/control-scripts/postinst | 24 | ||||
-rwxr-xr-x | debian/rules | 3 | ||||
-rw-r--r-- | debian/rules.d/0-common-vars.mk | 9 | ||||
-rw-r--r-- | debian/rules.d/2-binary-arch.mk | 48 | ||||
-rw-r--r-- | debian/rules.d/3-binary-indep.mk | 4 | ||||
-rwxr-xr-x | debian/scripts/misc/getabis | 7 |
6 files changed, 66 insertions, 29 deletions
diff --git a/debian/control-scripts/postinst b/debian/control-scripts/postinst index ce5ae569a090..b6ed9f845cc5 100644 --- a/debian/control-scripts/postinst +++ b/debian/control-scripts/postinst @@ -332,7 +332,7 @@ sub really_move_image { " $target"); if ($ret) { die("Failed to move " . $src_dir . "$target to " - . $dest_dir . "$target.\n"); + . $dest_dir . "$target"); } # Ok, now we may clobber the previous .old files if (-e "$target.$$") { @@ -367,13 +367,13 @@ sub really_reverse_link { if ($use_hard_links =~ m/YES/i) { link($Old . "$link_name", $src_dir . "$link_name") || die("Failed to link " . $dest_dir . "$link_name to " . $src_dir . - "$link_name .\n"); + "$link_name:$!"); warn "ln " . $Old . "$link_name " . $src_dir . "$link_name" if $DEBUG; } else { symlink($Old . "$link_name", $src_dir . "$link_name") || die("Failed to symbolic-link " . $dest_dir . "$link_name to " . $src_dir - . "$link_name : $!\n"); + . "$link_name:$!"); warn "ln -s " . $Old . "$link_name " . $src_dir . "$link_name" if $DEBUG; } } @@ -512,7 +512,7 @@ sub really_move_link { if (! link("${Old}${image_name}", "$kimage")) { rename("$kimage.$$", "$kimage"); die("Failed to link ${Old}${image_name} to " . - "${image_dest}${kimage}.\n"); + "${image_dest}${kimage}:$!"); } } else { @@ -520,7 +520,7 @@ sub really_move_link { if (! symlink("${Old}${image_name}", "$kimage")) { rename("$kimage.$$", "$kimage"); die("Failed to symbolic-link ${Old}${image_name} to " . - "${image_dest}${kimage}: $!\n"); + "${image_dest}${kimage}:$!"); } } @@ -555,7 +555,7 @@ sub handle_missing_link { "$image_name " . " $kimage"); if ($ret) { die("Failed to copy " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } } elsif ($reverse_symlink) { @@ -564,7 +564,7 @@ sub handle_missing_link { . "$kimage"); if ($ret) { die("Failed to move " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } } else { @@ -612,7 +612,7 @@ sub handle_missing_link { $Old ="" if $rel_path =~ m/^\s*$/o; symlink($Old . "$Name", "$Link_Dest") || - die("Failed to symbolic-link ${Old}$Name to $Link_Dest: $!\n"); + die("Failed to symbolic-link ${Old}$Name to $Link_Dest:$!"); warn "ln -s ${Old}$Name $Link_Dest" if $DEBUG; } @@ -647,7 +647,7 @@ sub handle_non_symlinks { warn "mv $kimage.$$ $kimage" if $DEBUG; } die("Failed to copy " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } } ##,#### @@ -663,7 +663,7 @@ sub handle_non_symlinks { warn "mv $kimage.$$ $kimage" if $DEBUG; } die("Failed to move " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } my $Old = $image_dest; if (test_relative ('Old Dir' => $Old, 'New Dir' => $realimageloc, @@ -711,7 +711,7 @@ sub handle_non_symlinks { warn "mv $kimage.$$ $kimage" if $DEBUG; rename("$kimage.$$", "$kimage"); die("Failed to link " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } } ##,#### @@ -728,7 +728,7 @@ sub handle_non_symlinks { rename("$kimage.$$", "$kimage"); } die("Failed to copy " . $realimageloc . "$image_name to " - . $image_dest . "$kimage .\n"); + . $image_dest . "$kimage"); } } # Ok, now we may clobber the previous .old file diff --git a/debian/rules b/debian/rules index 92ec033af3ed..c348f3acb310 100755 --- a/debian/rules +++ b/debian/rules @@ -82,6 +82,7 @@ include $(DROOT)/rules.d/3-binary-indep.mk include $(DROOT)/rules.d/4-checks.mk # Misc stuff +.PHONY: $(DEBIAN)/control.stub $(DEBIAN)/control.stub: $(DEBIAN)/d-i/kernel-versions.in \ $(DROOT)/scripts/control-create \ $(DEBIAN)/control.stub.in \ @@ -92,6 +93,7 @@ $(DEBIAN)/control.stub: $(DEBIAN)/d-i/kernel-versions.in \ cat $$i | sed -e 's/PKGVER/$(release)/g' \ -e 's/ABINUM/$(abinum)/g' \ -e 's/SRCPKGNAME/$(src_pkg_name)/g' \ + -e 's/=HUMAN=/$(human_arch)/g' \ > $$new; \ done flavours="$(wildcard $(DEBIAN)/control.d/vars.* $(DEBIAN)/sub-flavours/*.vars)";\ @@ -100,6 +102,7 @@ $(DEBIAN)/control.stub: $(DEBIAN)/d-i/kernel-versions.in \ sed -e 's/PKGVER/$(release)/g' \ -e 's/ABINUM/$(abinum)/g' \ -e 's/SRCPKGNAME/$(src_pkg_name)/g' \ + -e 's/=HUMAN=/$(human_arch)/g' \ >> $(DEBIAN)/control.stub; \ done cp $(DEBIAN)/control.stub $(DEBIAN)/control diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk index 422ea7e8f71f..b32ef445c1c5 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -166,9 +166,14 @@ do_full_source=false # build tools ifneq ($(wildcard $(CURDIR)/tools),) -do_tools?=true + ifeq ($(do_tools),) + ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + do_tools=false + endif + endif + do_tools?=true else -do_tools?=false + do_tools?=false endif tools_pkg_name=$(src_pkg_name)-tools-$(abi_release) tools_common_pkg_name=$(src_pkg_name)-tools-common diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index e696d7bac267..e65cbe06e045 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -29,6 +29,9 @@ $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(arc # Used by developers as a shortcut to prepare a tree for compilation. prepare-%: $(stampdir)/stamp-prepare-% @echo Prepared $* for $(arch) +# Used by developers to allow efficient pre-building without fakeroot. +build-%: $(stampdir)/stamp-build-% + @echo Built $* for $(arch) # Do the actual build, including image and modules $(stampdir)/stamp-build-%: target_flavour = $* @@ -164,6 +167,15 @@ ifneq ($(skipdbg),true) $(dbgpkgdir)/usr/lib/debug/boot/vmlinux-$(abi_release)-$* $(build_cd) $(kmake) $(build_O) modules_install \ INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug + # Add .gnu_debuglink sections to each stripped .ko + # pointing to unstripped verson + find $(pkgdir) -name '*.ko' | sed 's|$(pkgdir)||'| while read module ; do \ + if [[ -f "$(dbgpkgdir)/usr/lib/debug/$$module" ]] ; then \ + $(CROSS_COMPILE)objcopy \ + --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \ + $(pkgdir)/$$module; \ + fi; \ + done rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/build rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/source rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/modules.* @@ -181,6 +193,9 @@ endif # We'll symlink this stuff rm -f $(hdrdir)/Makefile rm -rf $(hdrdir)/include2 + # Copy over the compilation version. + cp "$(builddir)/build-$*/include/generated/compile.h" \ + "$(hdrdir)/include/generated/compile.h" # powerpc seems to need some .o files for external module linking. Add them in. ifeq ($(arch),powerpc) mkdir -p $(hdrdir)/arch/powerpc/lib @@ -188,9 +203,6 @@ ifeq ($(arch),powerpc) endif # Script to symlink everything up $(SHELL) $(DROOT)/scripts/link-headers "$(hdrdir)" "$(basepkg)" "$*" - # Setup the proper asm symlink - rm -f $(hdrdir)/include/asm - ln -s asm-$(asm_link) $(hdrdir)/include/asm # The build symlink install -d debian/$(basepkg)-$*/lib/modules/$(abi_release)-$* ln -s /usr/src/$(basepkg)-$* \ @@ -386,24 +398,27 @@ endif # # per-architecture packages # +builddirpa = $(builddir)/tools-perarch + $(stampdir)/stamp-prepare-perarch: @echo "Preparing perarch ..." ifeq ($(do_tools),true) - rm -rf $(builddir)/tools - install -d $(builddir)/tools - for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools/; done - rm $(builddir)/tools/tools - rsync -a tools/ $(builddir)/tools/tools/ + rm -rf $(builddirpa)/tools + install -d $(builddirpa)/tools + for i in *; do ln -s $(CURDIR)/$$i $(builddirpa)/tools/; done + rm $(builddirpa)/tools/tools + rsync -a tools/ $(builddirpa)/tools/tools/ endif touch $@ $(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch ifeq ($(do_tools),true) - cd $(builddir)/tools/tools/perf && \ - make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) $(conc_level) + cd $(builddirpa)/tools/tools/perf && \ + make HAVE_CPLUS_DEMANGLE=1 CROSS_COMPILE=$(CROSS_COMPILE) $(conc_level) if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \ - cd $(builddir)/tools/tools/power/x86/x86_energy_perf_policy && make $(CROSS_COMPILE); \ - cd $(builddir)/tools/tools/power/x86/turbostat && make $(CROSS_COMPILE); \ + cd $(builddirpa)/tools/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE); \ + cd $(builddirpa)/tools/tools/power/x86/turbostat && make CROSS_COMPILE=$(CROSS_COMPILE); \ + cd $(builddirpa)/tools/tools/hv && make CROSS_COMPILE=$(CROSS_COMPILE) CFLAGS=-I../../include; \ fi endif @touch $@ @@ -413,13 +428,16 @@ install-perarch: $(stampdir)/stamp-build-perarch # Add the tools. ifeq ($(do_tools),true) install -d $(toolspkgdir)/usr/bin - install -s -m755 $(builddir)/tools/tools/perf/perf \ + install -s -m755 $(builddirpa)/tools/tools/perf/perf \ $(toolspkgdir)/usr/bin/perf_$(abi_release) if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \ - install -s -m755 $(builddir)/tools/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \ + install -s -m755 $(builddirpa)/tools/tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy \ $(toolspkgdir)/usr/bin/x86_energy_perf_policy_$(abi_release); \ - install -s -m755 $(builddir)/tools/tools/power/x86/turbostat/turbostat \ + install -s -m755 $(builddirpa)/tools/tools/power/x86/turbostat/turbostat \ $(toolspkgdir)/usr/bin/turbostat_$(abi_release); \ + install -d $(toolspkgdir)/usr/sbin; \ + install -s -m755 $(builddirpa)/tools/tools/hv/hv_kvp_daemon \ + $(toolspkgdir)/usr/sbin/hv_kvp_daemon_$(abi_release); \ fi endif diff --git a/debian/rules.d/3-binary-indep.mk b/debian/rules.d/3-binary-indep.mk index 2e731472db19..aa93184fb9d8 100644 --- a/debian/rules.d/3-binary-indep.mk +++ b/debian/rules.d/3-binary-indep.mk @@ -82,6 +82,7 @@ endif install-tools: toolspkg = $(tools_common_pkg_name) install-tools: toolsbin = $(CURDIR)/debian/$(toolspkg)/usr/bin +install-tools: toolssbin = $(CURDIR)/debian/$(toolspkg)/usr/sbin install-tools: toolsman = $(CURDIR)/debian/$(toolspkg)/usr/share/man install-tools: install-source ifeq ($(do_tools),true) @@ -96,6 +97,8 @@ ifeq ($(do_tools),true) if [ "$(arch)" = "amd64" ] || [ "$(arch)" = "i386" ]; then \ install -m755 debian/tools/x86_energy_perf_policy $(toolsbin)/x86_energy_perf_policy; \ install -m755 debian/tools/turbostat $(toolsbin)/turbostat; \ + install -d $(toolssbin) ; \ + install -m755 debian/tools/generic $(toolssbin)/hv_kvp_daemon; \ fi rm -rf $(builddir)/tools @@ -111,6 +114,7 @@ ifeq ($(do_tools),true) install -d $(toolsman)/man8; \ install -m644 $(CURDIR)/tools/power/x86/x86_energy_perf_policy/*.8 $(toolsman)/man8; \ install -m644 $(CURDIR)/tools/power/x86/turbostat/*.8 $(toolsman)/man8; \ + install -m644 $(CURDIR)/tools/hv/*.8 $(toolsman)/man8; \ fi endif diff --git a/debian/scripts/misc/getabis b/debian/scripts/misc/getabis index 0556f8ee2dcc..708b7b26a551 100755 --- a/debian/scripts/misc/getabis +++ b/debian/scripts/misc/getabis @@ -19,6 +19,7 @@ WGET="wget --quiet -c" abidir="`pwd`/$DEBIAN/abi/$verfull" tmpdir="`pwd`/abi-tmp-$verfull" origdir="`pwd`" +fwinfo=$abidir/fwinfo test -d $tmpdir || mkdir $tmpdir @@ -45,6 +46,9 @@ getall() { if [ "$?" = "0" ]; then echo -n "extracting..." dpkg-deb --extract $filename tmp + find tmp -name "*.ko" | while read f; do + modinfo $f | grep ^firmware >> $fwinfo + done if [ -f tmp/boot/abi-* ]; then mv tmp/boot/abi-* $abidir/$arch/$sub else @@ -92,4 +96,7 @@ if [ "$compilers" != 1 ]; then echo "WARNING: inconsistant compiler versions detected" 1>&2 fi +sort < $fwinfo | uniq > fwinfo.tmp +mv fwinfo.tmp $fwinfo + rmdir $tmpdir |