Add reportbug scripts.

* debian/rules.real: Install bug files.
* debian/templates/image.plain.bug: Add.

svn path=/dists/trunk/linux-2.6/; revision=8352
This commit is contained in:
Bastian Blank 2007-03-11 13:25:35 +00:00
parent 75dd795c71
commit 19a2e4c99b
7 changed files with 101 additions and 0 deletions

9
debian/rules.real vendored
View File

@ -412,6 +412,9 @@ endif
$(MAKE) -f debian/rules.real \
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_templates \
PACKAGE_DIR='$(PACKAGE_DIR)' REAL_VERSION='$(REAL_VERSION)'
$(MAKE) -f debian/rules.real \
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_bug \
PACKAGE_DIR='$(PACKAGE_DIR)' PACKAGE_NAME='$(PACKAGE_NAME)' REAL_VERSION='$(REAL_VERSION)'
$(MAKE) -f debian/rules.real install-base
install-image-amd64-$(SUBARCH)-$(FLAVOUR)-plain_image \
@ -456,6 +459,12 @@ install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_templates:
chmod 755 '$(PACKAGE_DIR)'/DEBIAN/{config,{pre,post}*}
chmod 644 '$(PACKAGE_DIR)'/DEBIAN/templates
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain_bug:
dh_installdirs usr/share/bug/$(PACKAGE_NAME)
dh_install debian/templates/image.plain.bug/* usr/share/bug/$(PACKAGE_NAME)
chmod 755 '$(PACKAGE_DIR)'/usr/share/bug/$(PACKAGE_NAME)/script
echo "RELEASE='$(REAL_VERSION)'" > '$(PACKAGE_DIR)'/usr/share/bug/$(PACKAGE_NAME)/info
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain-s390-tape:
dh_testdir
dh_testroot

View File

@ -0,0 +1,9 @@
add_0version() {
echo -n '** Version: ' >&3
cat /proc/version >&3
echo >&3
}
ask_0version() {
true
}

View File

@ -0,0 +1,28 @@
TAINT_PROPRIETARY_MODULE=1
TAINT_FORCED_MODULE=2
TAINT_UNSAFE_SMP=4
TAINT_FORCED_RMMOD=8
TAINT_MACHINE_CHECK=16
TAINT_BAD_PAGE=32
add_1tainted() {
tainted=$(cat /proc/sys/kernel/tainted)
if [ "$tainted" -gt 0 ]; then
local s
[ $(($tainted & $TAINT_PROPRIETARY_MODULE)) ] && s="P" || s="G"
[ $(($tainted & $TAINT_FORCED_MODULE)) ] && s="${s}F"
[ $(($tainted & $TAINT_UNSAFE_SMP)) ] && s="${s}S"
[ $(($tainted & $TAINT_FORCED_RMMOD)) ] && s="${s}R"
[ $(($tainted & $TAINT_MACHINE_CHECK)) ] && s="${s}M"
[ $(($tainted & $TAINT_BAD_PAGE)) ] && s="${s}B"
echo '** Tainted:' $s >&3
echo >&3
else
echo '** Not tainted' >&3
echo >&3
fi
}
ask_1tainted() {
true
}

View File

@ -0,0 +1,9 @@
add_dmesg() {
echo '** Kernel log:' >&3
dmesg | tail -n 100 >&3
echo >&3
}
ask_dmesg() {
true
}

View File

@ -0,0 +1,10 @@
add_modules() {
echo '** Loaded modules:' >&3
lsmod >&3
echo >&3
}
ask_modules() {
true
}

View File

@ -0,0 +1,14 @@
add_pci() {
echo '** PCI devices:' >&3
if command -v lspci > /dev/null; then
lspci -nnvv >&3
else
echo 'not available' >&3
fi
echo >&3
}
ask_pci() {
true
}

22
debian/templates/image.plain.bug/script vendored Normal file
View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
dir="$(dirname $0)"
. "$dir"/info
for file in "$dir"/include-*; do
name="$(echo $file | sed -e 's,^.*/include-,,')"
hooks+=($name)
. "$file"
done
if [ "$RELEASE" == "$(uname -r)" ]; then
for hook in ${hooks[@]}; do
add_$hook
done
else
for hook in ${hooks[@]}; do
ask_$hook
done
fi