2 # Filename: ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/96-apt-listbugs
3 # Purpose: retreive list of bugreports of installed packages inside chroot
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ################################################################################
12 if [ -r $target/etc/apt/apt.conf.d/10apt-listbugs ] ; then
13 if [ -x $target/usr/sbin/apt-listbugs ] ; then
14 sed -i 's#//DPkg::#DPkg::#' $target/etc/apt/apt.conf.d/10apt-listbugs
19 if ifclass RELEASE ; then
22 [ -r /etc/grml/grml-live.conf ] && . /etc/grml/grml-live.conf
23 [ -r /etc/grml/grml-live.local ] && . /etc/grml/grml-live.local
24 [ -n "$HOSTNAME" ] || HOSTNAME=grml
26 if [ -r /etc/resolv.conf ] ; then
27 if [ -d $target/etc/resolvconf/run ] ; then # resolvconf without /run
28 # sanity check to avoid "input file is output file",
29 # see http://bts.grml.org/grml/issue984
30 if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
31 cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
33 echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
34 echo " Looks like something is wrong, please fix manually." >&2
37 elif [ -L $target/etc/resolvconf/run ] ; then # resolvconf with /run
38 # /etc/resolvconf/run symlinks to /run/resolvconf
39 mkdir -p $target/run/resolvconf
40 cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
41 else # no resolvconf installed in chroot
42 if ! [ -L $target/etc/resolv.conf ] ; then
43 cat /etc/resolv.conf >> $target/etc/resolv.conf
45 echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
51 if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
52 [ -x $target/etc/apt/grml/listbugs ] ; then
53 for severity in critical grave serious ; do
54 SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
55 /var/log/fai/$HOSTNAME/last/bugs.${severity} || true # make sure it does not fail
61 ## END OF FILE #################################################################
62 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2