#782156 grub-xen: unowned files after purge (policy 6.8, 10.8): /boot/grub/{locale, x86_64-xen}/* and some more

Package:
grub-xen
Source:
grub2
Description:
GRand Unified Bootloader, version 2 (Xen version)
Submitter:
Andreas Beckmann
Date:
2021-03-25 10:03:05 UTC
Severity:
important
#782156#5
Date:
2015-04-08 16:16:36 UTC
From:
To:
Hi,

during a test with piuparts I noticed your package left unowned files on
the system after purge, which is a violation of policy 6.8 (or 10.8):

https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#s-removedetails

Filing this as important as having a piuparts clean archive is a release
goal since lenny.

0m50.1s ERROR: FAIL: Package purging left files on system:
  /boot/grub/fonts/	 not owned
  /boot/grub/fonts/unicode.pf2	 not owned
  /boot/grub/grubenv	 not owned
  /boot/grub/locale/	 not owned
  /boot/grub/locale/ast.mo	 not owned
  /boot/grub/locale/ca.mo	 not owned
  /boot/grub/locale/da.mo	 not owned
  /boot/grub/locale/de.mo	 not owned
  /boot/grub/locale/de@hebrew.mo	 not owned
  /boot/grub/locale/de_CH.mo	 not owned
  /boot/grub/locale/en@arabic.mo	 not owned
  /boot/grub/locale/en@cyrillic.mo	 not owned
  /boot/grub/locale/en@greek.mo	 not owned
  /boot/grub/locale/en@hebrew.mo	 not owned
  /boot/grub/locale/en@piglatin.mo	 not owned
  /boot/grub/locale/en@quot.mo	 not owned
  /boot/grub/locale/eo.mo	 not owned
  /boot/grub/locale/es.mo	 not owned
  /boot/grub/locale/fi.mo	 not owned
  /boot/grub/locale/fr.mo	 not owned
  /boot/grub/locale/gl.mo	 not owned
  /boot/grub/locale/hu.mo	 not owned
  /boot/grub/locale/id.mo	 not owned
  /boot/grub/locale/it.mo	 not owned
  /boot/grub/locale/ja.mo	 not owned
  /boot/grub/locale/lt.mo	 not owned
  /boot/grub/locale/nl.mo	 not owned
  /boot/grub/locale/pa.mo	 not owned
  /boot/grub/locale/pl.mo	 not owned
  /boot/grub/locale/pt_BR.mo	 not owned
  /boot/grub/locale/ru.mo	 not owned
  /boot/grub/locale/sl.mo	 not owned
  /boot/grub/locale/sv.mo	 not owned
  /boot/grub/locale/tr.mo	 not owned
  /boot/grub/locale/uk.mo	 not owned
  /boot/grub/locale/vi.mo	 not owned
  /boot/grub/locale/zh_CN.mo	 not owned
  /boot/grub/locale/zh_TW.mo	 not owned
  /boot/grub/x86_64-xen/	 not owned
  /boot/grub/x86_64-xen/adler32.mod	 not owned
  /boot/grub/x86_64-xen/affs.mod	 not owned
  /boot/grub/x86_64-xen/afs.mod	 not owned
  /boot/grub/x86_64-xen/all_video.mod	 not owned
  /boot/grub/x86_64-xen/archelp.mod	 not owned
  /boot/grub/x86_64-xen/backtrace.mod	 not owned
  /boot/grub/x86_64-xen/bfs.mod	 not owned
  /boot/grub/x86_64-xen/bitmap.mod	 not owned
  /boot/grub/x86_64-xen/bitmap_scale.mod	 not owned
  /boot/grub/x86_64-xen/blocklist.mod	 not owned
  /boot/grub/x86_64-xen/btrfs.mod	 not owned
  /boot/grub/x86_64-xen/bufio.mod	 not owned
  /boot/grub/x86_64-xen/cat.mod	 not owned
  /boot/grub/x86_64-xen/cbfs.mod	 not owned
  /boot/grub/x86_64-xen/cmdline_cat_test.mod	 not owned
  /boot/grub/x86_64-xen/cmp.mod	 not owned
  /boot/grub/x86_64-xen/command.lst	 not owned
  /boot/grub/x86_64-xen/configfile.mod	 not owned
  /boot/grub/x86_64-xen/cpio.mod	 not owned
  /boot/grub/x86_64-xen/cpio_be.mod	 not owned
  /boot/grub/x86_64-xen/cpuid.mod	 not owned
  /boot/grub/x86_64-xen/crc64.mod	 not owned
  /boot/grub/x86_64-xen/crypto.lst	 not owned
  /boot/grub/x86_64-xen/crypto.mod	 not owned
  /boot/grub/x86_64-xen/cryptodisk.mod	 not owned
  /boot/grub/x86_64-xen/date.mod	 not owned
  /boot/grub/x86_64-xen/datehook.mod	 not owned
  /boot/grub/x86_64-xen/datetime.mod	 not owned
  /boot/grub/x86_64-xen/disk.mod	 not owned
  /boot/grub/x86_64-xen/diskfilter.mod	 not owned
  /boot/grub/x86_64-xen/div_test.mod	 not owned
  /boot/grub/x86_64-xen/dm_nv.mod	 not owned
  /boot/grub/x86_64-xen/echo.mod	 not owned
  /boot/grub/x86_64-xen/elf.mod	 not owned
  /boot/grub/x86_64-xen/eval.mod	 not owned
  /boot/grub/x86_64-xen/exfat.mod	 not owned
  /boot/grub/x86_64-xen/exfctest.mod	 not owned
  /boot/grub/x86_64-xen/ext2.mod	 not owned
  /boot/grub/x86_64-xen/fat.mod	 not owned
  /boot/grub/x86_64-xen/file.mod	 not owned
  /boot/grub/x86_64-xen/font.mod	 not owned
  /boot/grub/x86_64-xen/fs.lst	 not owned
  /boot/grub/x86_64-xen/fshelp.mod	 not owned
  /boot/grub/x86_64-xen/functional_test.mod	 not owned
  /boot/grub/x86_64-xen/gcry_arcfour.mod	 not owned
  /boot/grub/x86_64-xen/gcry_blowfish.mod	 not owned
  /boot/grub/x86_64-xen/gcry_camellia.mod	 not owned
  /boot/grub/x86_64-xen/gcry_cast5.mod	 not owned
  /boot/grub/x86_64-xen/gcry_crc.mod	 not owned
  /boot/grub/x86_64-xen/gcry_des.mod	 not owned
  /boot/grub/x86_64-xen/gcry_dsa.mod	 not owned
  /boot/grub/x86_64-xen/gcry_idea.mod	 not owned
  /boot/grub/x86_64-xen/gcry_md4.mod	 not owned
  /boot/grub/x86_64-xen/gcry_md5.mod	 not owned
  /boot/grub/x86_64-xen/gcry_rfc2268.mod	 not owned
  /boot/grub/x86_64-xen/gcry_rijndael.mod	 not owned
  /boot/grub/x86_64-xen/gcry_rmd160.mod	 not owned
  /boot/grub/x86_64-xen/gcry_rsa.mod	 not owned
  /boot/grub/x86_64-xen/gcry_seed.mod	 not owned
  /boot/grub/x86_64-xen/gcry_serpent.mod	 not owned
  /boot/grub/x86_64-xen/gcry_sha1.mod	 not owned
  /boot/grub/x86_64-xen/gcry_sha256.mod	 not owned
  /boot/grub/x86_64-xen/gcry_sha512.mod	 not owned
  /boot/grub/x86_64-xen/gcry_tiger.mod	 not owned
  /boot/grub/x86_64-xen/gcry_twofish.mod	 not owned
  /boot/grub/x86_64-xen/gcry_whirlpool.mod	 not owned
  /boot/grub/x86_64-xen/geli.mod	 not owned
  /boot/grub/x86_64-xen/gettext.mod	 not owned
  /boot/grub/x86_64-xen/gfxmenu.mod	 not owned
  /boot/grub/x86_64-xen/gfxterm.mod	 not owned
  /boot/grub/x86_64-xen/gfxterm_background.mod	 not owned
  /boot/grub/x86_64-xen/gfxterm_menu.mod	 not owned
  /boot/grub/x86_64-xen/gptsync.mod	 not owned
  /boot/grub/x86_64-xen/gzio.mod	 not owned
  /boot/grub/x86_64-xen/halt.mod	 not owned
  /boot/grub/x86_64-xen/hashsum.mod	 not owned
  /boot/grub/x86_64-xen/hello.mod	 not owned
  /boot/grub/x86_64-xen/help.mod	 not owned
  /boot/grub/x86_64-xen/hexdump.mod	 not owned
  /boot/grub/x86_64-xen/hfs.mod	 not owned
  /boot/grub/x86_64-xen/hfsplus.mod	 not owned
  /boot/grub/x86_64-xen/hfspluscomp.mod	 not owned
  /boot/grub/x86_64-xen/http.mod	 not owned
  /boot/grub/x86_64-xen/iso9660.mod	 not owned
  /boot/grub/x86_64-xen/jfs.mod	 not owned
  /boot/grub/x86_64-xen/jpeg.mod	 not owned
  /boot/grub/x86_64-xen/keystatus.mod	 not owned
  /boot/grub/x86_64-xen/ldm.mod	 not owned
  /boot/grub/x86_64-xen/legacy_password_test.mod	 not owned
  /boot/grub/x86_64-xen/legacycfg.mod	 not owned
  /boot/grub/x86_64-xen/linux.mod	 not owned
  /boot/grub/x86_64-xen/loadenv.mod	 not owned
  /boot/grub/x86_64-xen/loopback.mod	 not owned
  /boot/grub/x86_64-xen/ls.mod	 not owned
  /boot/grub/x86_64-xen/lsmmap.mod	 not owned
  /boot/grub/x86_64-xen/lsxen.mod	 not owned
  /boot/grub/x86_64-xen/luks.mod	 not owned
  /boot/grub/x86_64-xen/lvm.mod	 not owned
  /boot/grub/x86_64-xen/lzopio.mod	 not owned
  /boot/grub/x86_64-xen/macbless.mod	 not owned
  /boot/grub/x86_64-xen/macho.mod	 not owned
  /boot/grub/x86_64-xen/mdraid09.mod	 not owned
  /boot/grub/x86_64-xen/mdraid09_be.mod	 not owned
  /boot/grub/x86_64-xen/mdraid1x.mod	 not owned
  /boot/grub/x86_64-xen/memdisk.mod	 not owned
  /boot/grub/x86_64-xen/memrw.mod	 not owned
  /boot/grub/x86_64-xen/minicmd.mod	 not owned
  /boot/grub/x86_64-xen/minix.mod	 not owned
  /boot/grub/x86_64-xen/minix2.mod	 not owned
  /boot/grub/x86_64-xen/minix2_be.mod	 not owned
  /boot/grub/x86_64-xen/minix3.mod	 not owned
  /boot/grub/x86_64-xen/minix3_be.mod	 not owned
  /boot/grub/x86_64-xen/minix_be.mod	 not owned
  /boot/grub/x86_64-xen/moddep.lst	 not owned
  /boot/grub/x86_64-xen/modinfo.sh	 not owned
  /boot/grub/x86_64-xen/mpi.mod	 not owned
  /boot/grub/x86_64-xen/msdospart.mod	 not owned
  /boot/grub/x86_64-xen/net.mod	 not owned
  /boot/grub/x86_64-xen/newc.mod	 not owned
  /boot/grub/x86_64-xen/nilfs2.mod	 not owned
  /boot/grub/x86_64-xen/normal.mod	 not owned
  /boot/grub/x86_64-xen/ntfs.mod	 not owned
  /boot/grub/x86_64-xen/ntfscomp.mod	 not owned
  /boot/grub/x86_64-xen/odc.mod	 not owned
  /boot/grub/x86_64-xen/offsetio.mod	 not owned
  /boot/grub/x86_64-xen/part_acorn.mod	 not owned
  /boot/grub/x86_64-xen/part_amiga.mod	 not owned
  /boot/grub/x86_64-xen/part_apple.mod	 not owned
  /boot/grub/x86_64-xen/part_bsd.mod	 not owned
  /boot/grub/x86_64-xen/part_dfly.mod	 not owned
  /boot/grub/x86_64-xen/part_dvh.mod	 not owned
  /boot/grub/x86_64-xen/part_gpt.mod	 not owned
  /boot/grub/x86_64-xen/part_msdos.mod	 not owned
  /boot/grub/x86_64-xen/part_plan.mod	 not owned
  /boot/grub/x86_64-xen/part_sun.mod	 not owned
  /boot/grub/x86_64-xen/part_sunpc.mod	 not owned
  /boot/grub/x86_64-xen/partmap.lst	 not owned
  /boot/grub/x86_64-xen/parttool.lst	 not owned
  /boot/grub/x86_64-xen/parttool.mod	 not owned
  /boot/grub/x86_64-xen/password.mod	 not owned
  /boot/grub/x86_64-xen/password_pbkdf2.mod	 not owned
  /boot/grub/x86_64-xen/pbkdf2.mod	 not owned
  /boot/grub/x86_64-xen/pbkdf2_test.mod	 not owned
  /boot/grub/x86_64-xen/png.mod	 not owned
  /boot/grub/x86_64-xen/priority_queue.mod	 not owned
  /boot/grub/x86_64-xen/probe.mod	 not owned
  /boot/grub/x86_64-xen/procfs.mod	 not owned
  /boot/grub/x86_64-xen/progress.mod	 not owned
  /boot/grub/x86_64-xen/raid5rec.mod	 not owned
  /boot/grub/x86_64-xen/raid6rec.mod	 not owned
  /boot/grub/x86_64-xen/read.mod	 not owned
  /boot/grub/x86_64-xen/reboot.mod	 not owned
  /boot/grub/x86_64-xen/regexp.mod	 not owned
  /boot/grub/x86_64-xen/reiserfs.mod	 not owned
  /boot/grub/x86_64-xen/relocator.mod	 not owned
  /boot/grub/x86_64-xen/romfs.mod	 not owned
  /boot/grub/x86_64-xen/scsi.mod	 not owned
  /boot/grub/x86_64-xen/search.mod	 not owned
  /boot/grub/x86_64-xen/search_fs_file.mod	 not owned
  /boot/grub/x86_64-xen/search_fs_uuid.mod	 not owned
  /boot/grub/x86_64-xen/search_label.mod	 not owned
  /boot/grub/x86_64-xen/setjmp.mod	 not owned
  /boot/grub/x86_64-xen/setjmp_test.mod	 not owned
  /boot/grub/x86_64-xen/sfs.mod	 not owned
  /boot/grub/x86_64-xen/signature_test.mod	 not owned
  /boot/grub/x86_64-xen/sleep.mod	 not owned
  /boot/grub/x86_64-xen/sleep_test.mod	 not owned
  /boot/grub/x86_64-xen/squash4.mod	 not owned
  /boot/grub/x86_64-xen/syslinuxcfg.mod	 not owned
  /boot/grub/x86_64-xen/tar.mod	 not owned
  /boot/grub/x86_64-xen/terminal.lst	 not owned
  /boot/grub/x86_64-xen/terminal.mod	 not owned
  /boot/grub/x86_64-xen/test.mod	 not owned
  /boot/grub/x86_64-xen/test_blockarg.mod	 not owned
  /boot/grub/x86_64-xen/testload.mod	 not owned
  /boot/grub/x86_64-xen/testspeed.mod	 not owned
  /boot/grub/x86_64-xen/tftp.mod	 not owned
  /boot/grub/x86_64-xen/tga.mod	 not owned
  /boot/grub/x86_64-xen/time.mod	 not owned
  /boot/grub/x86_64-xen/tr.mod	 not owned
  /boot/grub/x86_64-xen/trig.mod	 not owned
  /boot/grub/x86_64-xen/true.mod	 not owned
  /boot/grub/x86_64-xen/udf.mod	 not owned
  /boot/grub/x86_64-xen/ufs1.mod	 not owned
  /boot/grub/x86_64-xen/ufs1_be.mod	 not owned
  /boot/grub/x86_64-xen/ufs2.mod	 not owned
  /boot/grub/x86_64-xen/verify.mod	 not owned
  /boot/grub/x86_64-xen/video.lst	 not owned
  /boot/grub/x86_64-xen/video.mod	 not owned
  /boot/grub/x86_64-xen/video_colors.mod	 not owned
  /boot/grub/x86_64-xen/video_fb.mod	 not owned
  /boot/grub/x86_64-xen/videoinfo.mod	 not owned
  /boot/grub/x86_64-xen/videotest.mod	 not owned
  /boot/grub/x86_64-xen/videotest_checksum.mod	 not owned
  /boot/grub/x86_64-xen/xfs.mod	 not owned
  /boot/grub/x86_64-xen/xnu_uuid.mod	 not owned
  /boot/grub/x86_64-xen/xnu_uuid_test.mod	 not owned
  /boot/grub/x86_64-xen/xzio.mod	 not owned
  /boot/grub/x86_64-xen/zfs.mod	 not owned
  /boot/grub/x86_64-xen/zfscrypt.mod	 not owned
  /boot/grub/x86_64-xen/zfsinfo.mod	 not owned
  /boot/xen/	 not owned

This seems to be the only grub-* package leaving (lots of) stuff around after purge.


cheers,

Andreas

#782156#10
Date:
2015-05-02 15:47:10 UTC
From:
To:
On Wed, 2015-04-08 at 18:16 +0200, Andreas Beckmann wrote:
[...]

Looking at the postinst/postrm code it seems that actually the inverse
is true, only grub-pc is cleaning up after itself (and then only
conditionally based on debconf).

Most of the other grub-* are either !x86 (which I think piuparts doesn't
test yet) or do not actually install any grub binaries for some reason
(e.g. the postinst for grub-efi-* checks for existence
of /boot/efi/EFI/debian, which I bet doesn't exist in the piuparts
chroot).

Actually grub-efi-ia32|grub-efi-amd64 do partially clean up, but only
the /boot/grub/unicode.pf2 which is installed by the postinst outside
the /boot/efi/EFI/debian check.

Anyway, IIRC when I was doing the grub-xen packaging stuff Colin
indicated that it was considered a feature not a bug that stuff was left
in /boot on purge, essentially because removing them might render the
system unbootable.

IMHO either /boot/grub/* should be whitelisted for piuparts (based on
the above argument regarding making systems unbootable) or the existing
debconf template and postrm code for grub-pc should be applied to all
grub-* and not just extended to cover grub-xen.

BTW, the grub-pc debconf question grub-pc/postrm_purge_boot_grub
defaults to false, meaning it shouldn't be cleaning up after itself. I'm
not sure then why it apparently passes piuparts...

Ian.

#782156#15
Date:
2015-05-04 15:31:06 UTC
From:
To:
Depends on whether leaving stuff raises an error (only on a few tests)
or ignored (usually).

piuparts can preseed such "extended cleanup modes" that are disabled by
default for a good reason. But usually someone needs to tell me that
there is one :-)

If I find some time I'll revisit the piuparts handling of grub-*.


Andreas

#782156#26
Date:
2015-09-13 07:57:21 UTC
From:
To:
    people/ianc/bug782156-purge
in the grub package repository. It turns the existing grub
-pc/postrm_purge_boot_grub debconf question into
 grub2/postrm_purge_boot_grub for each grub flavour and tries to
cleanup the right common stuff. I lack systems to check for per-variant
things though.

It's definitely incomplete as it doesn't clean up:
    /boot/grub/fonts/
    /boot/grub/grubenv
    /boot/grub/locale/

This is because I think they are common to all grub-* variants, so
removing them when you purge grub-variantA to install grub-variantB
would be incorrect. Perhaps grub-common or grub2-common ought to take
care of those. Or perhaps because grub2/postrm_purge_boot_grub is a
pretty special use case we should just nuke them from each package.

Note that I retained the historical behaviour of grub-pc, which
included purging these files. The grub-pc historical case also removes
all sorts of other things which no longer appear to exist or where it
looks to me that the path is wrong (omits the i386-pc part of the path,
but maybe that's a legacy/historical thing).

I've attached grub2.piu.tar which contains some helpful wrappers and
some piuparts scripts to preseed the cleanup debconf question (which
should be deployed on piuparts.d.o I think) and to dump some additional
info after things are done.

I've also attached grub2.2.02~beta2-28.piuparts.tar.xz and
 grub2.2.02~beta2-29.piuparts.tar.xz which are a full set of logs with
those scripts for 2.02~beta2-28 (released) and the WIP ~2.02~beta2-29
in my branch above.

Note that piuparts appears clean in both versions for many of the grub
packages when actually they are detecting the lack of whichever
environment they are for (EFI, OpenFirmware, etc) and not populating
/boot at all. Only grub-xen lacks this behaviour AFAICT.


Note that piuparts appears clean in both versions for many of the grub
packages when actually they are detecting the lack of whichever
environment they are for (EFI, OpenFirmware, etc) and not populating
/boot at all. Only grub-xen lacks this behaviour AFAICT.


Note that piuparts appears clean in both versions for many of the grub
packages when actually they are detecting the lack of whichever
environment they are for (EFI, OpenFirmware, etc) and not populating
/boot at all. Only grub-xen lacks this detection AFAICT hence this bug
because it unconditionally installs things (I believe that is correct
for the -xen package).

Ian.