clean-squashfs-sort-file 1.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -eu
set -x

perl -ni \
     -E 'chomp;
         last if m{\Ausr/local/lib/kill-boot-profile\s}xms;
         say unless m{(?:
              [.]pyc\s+\d+\z
           | \Aboot-profile[.]pid\s
           | \Alib/firmware/
           | \Alib/live/mount/medium/live/(?:filesystem[.]squashfs|initrd[.]img)\s
           | \Alib/live/mount/overlay/rw/etc/fstab\s
           | \Alib/live/mount/overlay/rw/etc/console-setup/cached_\S+[.](?:gz|sh)\s
           | \Alib/live/mount/overlay/rw/etc/machine-id\s
           | \Alib/live/mount/overlay/rw/etc/network/interfaces\s
           | \Alib/live/mount/overlay/rw/var/log/wtmp\s
           | \A(?:lib/live/mount/overlay/rw/)?etc/apparmor[.]d/cache/[.]features\s
           | \A(?:lib/live/mount/overlay/rw/)?etc/(?:group|gshadow|passwd|shadow)-\s
           | \A(?:lib/live/mount/overlay/rw/)?etc/resolv-over-clearnet[.]conf\s
           | \A(?:lib/live/mount/overlay/rw/)?etc/skel/[.]config/autostart/end-profile[.]desktop\s
23
24
           | \Alib/modules/.*/kernel/drivers/(?:cpufreq|net|thermal)/
           | \Alib/modules/.*/kernel/net/
25
           | \Ausr/share/pulseaudio/alsa-mixer/
26
27
28
29
30
31
           | \Arun/
           | \Avar/lib/AccountsService/users/Debian-gdm\s
           | \Avar/lib/gdm3/[#]\d+\s
           | \Avar/log/live/config[.]pipe\s
         )}xms' \
     "$1"