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 case "$(readlink -f ${target}/etc/resolv.conf)" in
28 /run/*) # resolvconf with /run
29 mkdir -p $target/run/resolvconf
30 cat /etc/resolv.conf >> $target/run/resolvconf/resolv.conf
32 /lib/*) # resolvconf without /run
33 # sanity check to avoid "input file is output file",
34 # see http://bts.grml.org/grml/issue984
35 if ! [ -L $target/etc/resolvconf/run/resolv.conf ] ; then
36 cat /etc/resolv.conf >> $target/etc/resolvconf/run/resolv.conf
38 echo "Error: /etc/resolvconf/run/resolv.conf in chroot should not be a symlink." >&2
39 echo " Looks like something is wrong, please fix manually." >&2
44 if ! [ -L $target/etc/resolv.conf ] ; then
45 cat /etc/resolv.conf >> $target/etc/resolv.conf
47 echo "Error: /etc/resolv.conf in chroot should not be a symlink (resolvconf not installed)." >&2
54 if [ -x $target/usr/sbin/apt-listbugs -a -x $target/usr/bin/apt-show-source ] && \
55 [ -x $target/etc/apt/grml/listbugs ] ; then
56 for severity in critical grave serious ; do
57 SEVERITY=$severity $ROOTCMD /etc/apt/grml/listbugs > \
58 /var/log/fai/$HOSTNAME/last/bugs.${severity} || true # make sure it does not fail
64 ## END OF FILE #################################################################
65 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2