runtime-cleanup.tmpl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. ## lorax template file: cleanup for the ramdisk (runtime image)
  2. <%page args="libdir, branding, root"/>
  3. ## remove the sources
  4. remove usr/share/i18n
  5. ## not required packages installed as dependencies
  6. ## perl is needed on s390x
  7. ## perl needed for powerpc-utils on PPC
  8. ## perl is needed by /usr/bin/rxe_cfg from libibverbs
  9. ## no sound support, thanks
  10. removepkg flac gstreamer-tools libsndfile pulseaudio* sound-theme-freedesktop
  11. ## we don't create new initramfs/bootloader conf inside anaconda
  12. ## (that happens inside the target system after we install dracut/grubby)
  13. removepkg dracut-network grubby anaconda-dracut
  14. ## In order to execute the /usr move on upgrades we need convertfs from dracut
  15. ## We also need dracut-shutdown.service and dracut-initramfs-restore to reboot
  16. removefrom dracut --allbut /usr/lib/dracut/modules.d/30convertfs/convertfs.sh \
  17. /usr/lib/dracut/modules.d/99base/dracut-lib.sh \
  18. /usr/lib/systemd/* /usr/lib/dracut/modules.d/98dracut-systemd/*.service \
  19. /usr/lib/dracut/dracut-initramfs-restore
  20. ## we don't run SELinux (not in enforcing, anyway)
  21. removepkg checkpolicy selinux-policy libselinux-utils
  22. ## selinux checks for the /etc/selinux/config file's existance
  23. ## The removepkg above removes it, create an empty one. See rhbz#1243168
  24. append etc/selinux/config ""
  25. ## anaconda has its own repo files
  26. removefrom fedora-release --allbut /etc/os-release /usr/lib/os-release \
  27. /usr/lib/os.release.d/*
  28. removepkg fedora-release-rawhide
  29. ## keep enough of shadow-utils to create accounts
  30. removefrom shadow-utils --allbut /usr/bin/chage /usr/sbin/chpasswd \
  31. /usr/sbin/groupadd /usr/sbin/useradd \
  32. /etc/default/useradd
  33. ## remove other account management tools
  34. removepkg usermode usermode-gtk passwd
  35. ## no services to turn on/off (keep the /etc/init.d link though)
  36. removefrom chkconfig --allbut /etc/init.d
  37. ## Miscellanous unnecessary gpg program
  38. removepkg pinentry
  39. ## no storage device monitoring
  40. removepkg device-mapper-event dmraid-events sgpio
  41. ## no notifications in anaconda
  42. removepkg notification-daemon
  43. ## logrotate isn't useful in anaconda
  44. removepkg logrotate
  45. remove /etc/logrotate.d
  46. ## anaconda needs this to do media check
  47. removefrom isomd5sum --allbut /usr/bin/checkisomd5
  48. ## systemd-nspawn isn't very useful and doesn't link anyway without iptables,
  49. ## and there's no need for a bunch of zsh files without zsh
  50. removefrom systemd /usr/bin/systemd-nspawn /usr/share/zsh
  51. ## various other things we remove to save space
  52. removepkg avahi-autoipd coreutils-libs dash db4-utils diffutils file
  53. removepkg info iptables
  54. removepkg jasper-libs libXxf86misc
  55. removepkg libasyncns libhbaapi libhbalinux
  56. removepkg libtiff linux-atm-libs
  57. removepkg lvm2-libs m4 mailx makebootfat
  58. removepkg mingetty mobile-broadband-provider-info pkgconfig ppp pth
  59. removepkg rmt rpcbind squashfs-tools system-config-firewall-base
  60. removepkg tigervnc-license ttmkfdir xml-common xorg-x11-font-utils
  61. removepkg xorg-x11-server-common yum-utils firewalld
  62. ## other removals
  63. remove /home /media /opt /srv /tmp/*
  64. remove /usr/etc /usr/games /usr/local /usr/tmp
  65. remove /usr/share/doc /usr/share/info /usr/share/man /usr/share/gnome
  66. remove /usr/share/mime/application /usr/share/mime/audio /usr/share/mime/image
  67. remove /usr/share/mime/inode /usr/share/mime/message /usr/share/mime/model
  68. remove /usr/share/mime/multipart /usr/share/mime/packages /usr/share/mime/text
  69. remove /usr/share/mime/video /usr/share/mime/x-content /usr/share/mime/x-epoc
  70. remove /var/db /var/games /var/tmp /var/yp /var/nis /var/opt /var/local
  71. remove /var/mail /var/spool /var/preserve /var/report
  72. remove /var/lib/rpm/* /var/lib/yum /var/lib/dnf
  73. ## clean up the files created by various '> /dev/null's
  74. remove /dev/*
  75. ## icons cache
  76. remove /usr/share/icons/*/icon-theme.cache
  77. ## clean up kernel modules
  78. removekmod sound drivers/media drivers/hwmon \
  79. net/atm net/bluetooth net/sched net/sctp \
  80. net/rds net/l2tp net/decnet net/netfilter net/ipv4 net/ipv6 \
  81. drivers/watchdog drivers/rtc drivers/input/joystick \
  82. drivers/bluetooth drivers/edac drivers/staging \
  83. drivers/usb/serial drivers/usb/host drivers/usb/misc \
  84. fs/ocfs2 fs/ceph fs/nfsd fs/ubifs fs/nilfs2 \
  85. arch/x86/kvm
  86. ## Need to keep virtio_console.ko and ipmi stuff in drivers/char
  87. ## Also keep virtio-rng so that the installer can get sufficient randomness for
  88. ## LUKS setup.
  89. removekmod drivers/char --allbut virtio_console hw_random \
  90. virtio-rng ipmi hmcdrv nvram
  91. removekmod drivers/hid --allbut hid-logitech-dj hid-logitech-hidpp hid-multitouch
  92. removekmod drivers/video --allbut hyperv_fb syscopyarea sysfillrect sysimgblt fb_sys_fops
  93. remove lib/modules/*/{build,source,*.map}
  94. ## NOTE: depmod gets re-run after cleanup finishes
  95. ## remove unused themes, theme engines, icons, etc.
  96. removefrom gtk2 /usr/${libdir}/gtk-2.0/*/{engines,printbackends}/*
  97. removefrom gtk2 /usr/share/themes/*
  98. ## clearlooks is the theme we use for gtk2
  99. removefrom gtk2-engines --allbut /usr/${libdir}/*/libclearlooks.so \
  100. /usr/share/themes/Clearlooks/*
  101. removefrom gtk3 /usr/${libdir}/gtk-3.0/*/printbackends/*
  102. removefrom gtk3 /usr/share/themes/*
  103. ## filesystem tools
  104. removefrom e2fsprogs /usr/share/locale/*
  105. removefrom xfsprogs /usr/share/locale/* /usr/share/doc/* /usr/share/man/*
  106. removefrom xfsdump --allbut /usr/sbin/*
  107. ## other package specific removals
  108. removefrom GConf2 /etc/rpm/* /etc/xdg/* /usr/bin/*
  109. removefrom GConf2 /usr/${libdir}/GConf/2/libgconfbackend-{evoldap,oldxml}*
  110. removefrom GConf2 /usr/${libdir}/gio/modules/*
  111. removefrom GConf2 /usr/libexec/gconf-defaults-mechanism /usr/share/GConf/*
  112. removefrom GConf2 /usr/share/locale/* /usr/share/sgml/*
  113. removefrom NetworkManager /usr/share/NetworkManager/*
  114. removefrom NetworkManager /usr/share/locale/*/NetworkManager.mo
  115. removefrom nm-connection-editor /usr/${libdir}/*
  116. removefrom nm-connection-editor /usr/share/applications/*
  117. removefrom anaconda /etc/* /usr/share/applications/* /usr/share/icons/*
  118. removefrom atk /usr/share/locale/*
  119. removefrom audit /etc/* /sbin/audispd /sbin/auditctl /sbin/aureport
  120. removefrom audit /sbin/ausearch /sbin/autrace /usr/bin/*
  121. removefrom audit-libs /etc/* /${libdir}/libauparse*
  122. removefrom authconfig /usr/sbin/* /usr/share/*
  123. removefrom bash /etc/* /usr/bin/bashbug* /usr/share/*
  124. removefrom bind-utils /usr/bin/dig /usr/bin/host /usr/bin/nsupdate
  125. removefrom bitmap-fangsongti-fonts /usr/share/fonts/*
  126. removefrom ca-certificates /etc/pki/java/*
  127. removefrom ca-certificates /etc/pki/tls/certs/ca-bundle.trust.crt /etc/ssl/*
  128. removefrom cairo /usr/${libdir}/libcairo-script* /usr/bin/cairo-sphinx
  129. removefrom coreutils /etc/* /usr/bin/link /usr/bin/nice /usr/bin/stty /usr/bin/su /usr/bin/unlink
  130. removefrom coreutils /usr/sbin/runuser /usr/bin/[ /usr/bin/base64 /usr/bin/chcon
  131. removefrom coreutils /usr/bin/cksum /usr/bin/comm /usr/bin/csplit
  132. removefrom coreutils /usr/bin/dir /usr/bin/dircolors
  133. removefrom coreutils /usr/bin/expand /usr/bin/factor
  134. removefrom coreutils /usr/bin/fold /usr/bin/groups /usr/bin/hostid
  135. removefrom coreutils /usr/bin/install /usr/bin/join /usr/bin/logname
  136. removefrom coreutils /usr/bin/mkfifo /usr/bin/nl /usr/bin/nohup /usr/bin/nproc
  137. removefrom coreutils /usr/bin/pathchk
  138. removefrom coreutils /usr/bin/pinky /usr/bin/pr /usr/bin/printenv
  139. removefrom coreutils /usr/bin/printf /usr/bin/ptx /usr/bin/runcon
  140. removefrom coreutils /usr/bin/sha224sum /usr/bin/sha384sum
  141. removefrom coreutils /usr/bin/sha512sum /usr/bin/shuf /usr/bin/stat
  142. removefrom coreutils /usr/bin/stdbuf /usr/bin/sum /usr/bin/test
  143. removefrom coreutils /usr/bin/timeout /usr/bin/truncate /usr/bin/tsort
  144. removefrom coreutils /usr/bin/unexpand /usr/bin/users /usr/bin/vdir
  145. removefrom coreutils /usr/bin/who /usr/bin/whoami /usr/bin/yes /usr/share/*
  146. removefrom cpio /usr/share/*
  147. removefrom cracklib /usr/sbin/*
  148. removefrom cracklib-dicts /usr/${libdir}/* /usr/sbin/*
  149. removefrom cryptsetup-luks /usr/share/*
  150. removefrom cyrus-sasl-lib /usr/sbin/*
  151. removefrom db4 /usr/*
  152. removefrom dbus-glib /usr/bin/*
  153. removefrom dbus-x11 /etc/X11/*
  154. removefrom dejavu-sans-fonts --allbut *.conf */DejaVuSans{,-Bold}.ttf
  155. removefrom dejavu-sans-mono-fonts --allbut *.conf */DejaVuSansMono.ttf
  156. removefrom dhclient /usr/lib/* /usr/share/*
  157. removefrom dnsmasq /etc/rc.d/* /usr/sbin/*
  158. removefrom elfutils-libelf /usr/share/locale/*
  159. removefrom expat /usr/bin/*
  160. removefrom fcoe-utils /etc/rc.d/* /usr/libexec/fcoe/dcbcheck.sh
  161. removefrom fcoe-utils /usr/libexec/fcoe/fcc.sh /usr/libexec/fcoe/fcoe-setup.sh
  162. removefrom fcoe-utils /usr/libexec/fcoe/fcoedump.sh /usr/sbin/fcnsq
  163. removefrom fcoe-utils /usr/sbin/fcoeadm /usr/sbin/fcping /usr/sbin/fcrls
  164. removefrom file-libs /usr/share/*
  165. removefrom findutils /usr/bin/oldfind /usr/share/*
  166. removefrom fontconfig /usr/bin/*
  167. removefrom gawk /usr/bin/{igawk,pgawk} /usr/libexec/* /usr/share/*
  168. removefrom gdb /usr/share/* /usr/include/* /etc/gdbinit*
  169. removefrom gdisk /usr/share/*
  170. removefrom gdk-pixbuf2 /usr/share/locale*
  171. removefrom glib2 /etc/* /usr/bin/* /usr/share/locale/*
  172. removefrom glibc /etc/gai.conf /etc/localtime /etc/rpc
  173. removefrom glibc /lib/*/nosegneg/* /${libdir}/libBrokenLocale*
  174. removefrom glibc /${libdir}/libSegFault* /${libdir}/libanl*
  175. removefrom glibc /${libdir}/libcidn* /${libdir}/libnss_compat*
  176. removefrom glibc /${libdir}/libnss_hesiod* /${libdir}/libnss_nis*
  177. # python-pyudev uses ctypes.util.find_library, which uses /sbin/ldconfig
  178. removefrom glibc /${libdir}/rtkaio* /sbin/sln
  179. removefrom glibc /usr/libexec/* /usr/sbin/*
  180. removefrom glibc-common /etc/* /usr/bin/catchsegv /usr/bin/gencat
  181. removefrom glibc-common /usr/bin/getent
  182. removefrom glibc-common /usr/bin/locale /usr/bin/rpcgen /usr/bin/sprof
  183. # NB: we keep /usr/bin/localedef so anaconda can inspect payload locale info
  184. removefrom glibc-common /usr/bin/tzselect
  185. removefrom glibc-common /usr/libexec/* /usr/sbin/*
  186. removefrom gmp /usr/${libdir}/libgmpxx.* /usr/${libdir}/libmp.*
  187. removefrom gnome-bluetooth-libs /usr/${libdir}/libgnome-bluetooth*
  188. removefrom gnome-bluetooth-libs /usr/share/*
  189. removefrom gnutls /usr/share/locale/*
  190. removefrom google-noto-sans-cjk-ttc-fonts /usr/share/fonts/google-noto-cjk/NotoSansCJK-{Black,Bold,*Light,Medium,Thin}.ttc
  191. removefrom grep /etc/* /usr/share/locale/*
  192. removefrom gstreamer /usr/bin/* /usr/${libdir}/gstreamer-0.10/*
  193. removefrom gstreamer /usr/${libdir}/libgst* /usr/libexec/* /usr/share/locale/*
  194. removefrom gtk2 /usr/bin/update-gtk-immodules
  195. removefrom gtk3 /usr/${libdir}/gtk-3.0/*
  196. removefrom gzip /usr/bin/{gzexe,zcmp,zdiff,zegrep,zfgrep,zforce,zgrep,zless,zmore,znew}
  197. removefrom hwdata /etc/* /usr/share/hwdata/oui.txt /usr/share/hwdata/pnp.ids
  198. removefrom hwdata /usr/share/hwdata/upgradelist
  199. removefrom initscripts /etc/ppp/* /usr/sbin/* /usr/share/locale/*
  200. removefrom iproute --allbut /usr/sbin/{ip,routef,routel,rtpr}
  201. removefrom iscsi-initiator-utils /etc/rc.d/*
  202. removefrom kbd --allbut */bin/{dumpkeys,kbd_mode,loadkeys,setfont,unicode_*,chvt}
  203. removefrom less /etc/*
  204. removefrom libX11-common /usr/share/X11/XErrorDB
  205. removefrom libbonobo /etc/* /usr/bin/* /usr/sbin/* /usr/share/locale/*
  206. removefrom libbonobo /usr/${libdir}/bonobo/monikers/*
  207. removefrom libbonobo /usr/${libdir}/orbit-2.0/Bonobo_module.so
  208. removefrom libcanberra /usr/${libdir}/libcanberra-*
  209. removefrom libcanberra-gtk2 /usr/${libdir}/gtk-2.0/*
  210. removefrom libcanberra-gtk3 /usr/bin/*
  211. removefrom libcap /usr/sbin/*
  212. removefrom libconfig /usr/${libdir}/libconfig++*
  213. removefrom libcroco /usr/bin/*
  214. removefrom libgnome-keyring /usr/share/locale/*
  215. removefrom libgnomecanvas /usr/share/locale/*
  216. removefrom libgpg-error /usr/bin/* /usr/share/locale/*
  217. removefrom libgssglue /etc/*
  218. removefrom libidn /usr/bin/* /usr/share/locale/*
  219. removefrom libmlx4 /etc/rdma/* /usr/${libdir}/*
  220. removefrom libnotify /usr/bin/*
  221. removefrom librsvg2 /usr/bin/*
  222. removefrom libselinux /usr/sbin/*
  223. removefrom libsemanage /etc/selinux/*
  224. removefrom libstdc++ /usr/share/*
  225. removefrom libuser /usr/bin/* /usr/sbin/* /usr/share/locale/*
  226. removefrom libvorbis /usr/${libdir}/libvorbisenc.*
  227. removefrom libxml2 /usr/bin/*
  228. removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.a
  229. removefrom libxml2-python /usr/${libdir}/python?.?/site-packages/libxml2mod.la
  230. removefrom lldpad /etc/*
  231. removefrom lua /usr/bin/*
  232. removefrom madan-fonts /usr/share/fonts/madan/*
  233. removefrom mdadm /etc/*
  234. removefrom module-init-tools /etc/* /usr/sbin/insmod.static /usr/sbin/weak-modules
  235. removefrom mt-st /etc/* /usr/sbin/*
  236. removefrom mtools /etc/*
  237. removefrom ncurses /usr/bin/captoinfo /usr/bin/infocmp /usr/bin/infotocap
  238. removefrom ncurses /usr/bin/reset /usr/bin/tabs /usr/bin/tic /usr/bin/toe
  239. removefrom ncurses /usr/bin/tput /usr/bin/tset
  240. removefrom ncurses-libs /usr/${libdir}/libform*
  241. ## libmenu.so is needed by lp_diag binary from ppc64-diag which is a PowerPc specific package
  242. %if basearch not in ("ppc", "ppc64", "ppc64le"):
  243. removefrom ncurses-libs /usr/${libdir}/libmenu*
  244. %endif
  245. removefrom ncurses-libs /usr/${libdir}/libpanel.* /usr/${libdir}/libtic*
  246. removefrom net-tools */bin/netstat */sbin/ether-wake */sbin/ipmaddr
  247. removefrom net-tools */sbin/iptunnel */sbin/mii-diag */sbin/mii-tool
  248. removefrom net-tools */sbin/nameif */sbin/plipconfig */sbin/slattach
  249. removefrom net-tools /usr/share/locale/*
  250. removefrom newt /usr/share/locale/*
  251. removefrom nfs-utils /etc/nfsmount.conf
  252. removefrom nfs-utils /etc/rc.d/init.d/* /lib/systemd/system/*
  253. removefrom nfs-utils /etc/sysconfig/nfs /sbin/rpc.statd /usr/sbin/exportfs
  254. removefrom nfs-utils /usr/sbin/gss_clnt_send_err /usr/sbin/gss_destroy_creds
  255. removefrom nfs-utils /usr/sbin/mountstats /usr/sbin/nfsiostat
  256. removefrom nfs-utils /usr/sbin/nfsstat /usr/sbin/rpc.gssd /usr/sbin/rpc.idmapd
  257. removefrom nfs-utils /usr/sbin/rpc.mountd /usr/sbin/rpc.nfsd
  258. removefrom nfs-utils /usr/sbin/rpc.svcgssd /usr/sbin/rpcdebug
  259. removefrom nfs-utils /usr/sbin/showmount /usr/sbin/sm-notify
  260. removefrom nfs-utils /usr/sbin/start-statd /var/lib/nfs/etab
  261. removefrom nfs-utils /var/lib/nfs/rmtab /var/lib/nfs/state /var/lib/nfs/xtab
  262. removefrom nss-softokn /usr/${libdir}/nss/*
  263. removefrom openldap /etc/openldap/*
  264. removefrom openssh /usr/libexec/*
  265. removefrom openssh-clients /etc/ssh/* /usr/bin/ssh-*
  266. removefrom openssh-clients /usr/libexec/*
  267. removefrom openssh-server /etc/ssh/* /usr/libexec/openssh/sftp-server
  268. removefrom openssl /etc/pki/* /usr/bin/* /usr/${libdir}/openssl/*
  269. removefrom pam /usr/sbin/* /usr/share/locale/*
  270. removefrom policycoreutils /etc/* /usr/bin/* /usr/share/locale/*
  271. removefrom polkit /usr/bin/*
  272. removefrom polkit-desktop-policy /var/lib/*
  273. removefrom popt /usr/share/locale/*
  274. removefrom procps /usr/bin/free /usr/bin/pgrep /usr/bin/pkill
  275. removefrom procps /usr/bin/pmap /usr/bin/pwdx /usr/bin/skill /usr/bin/slabtop
  276. removefrom procps /usr/bin/snice /usr/bin/tload /usr/bin/uptime
  277. removefrom procps /usr/bin/vmstat /usr/bin/w /usr/bin/watch
  278. removefrom psmisc /usr/share/locale/*
  279. removefrom pygtk2 /usr/bin/* /usr/${libdir}/pygtk/*
  280. removefrom pykickstart /usr/bin/* /usr/share/locale/*
  281. removefrom readline /usr/${libdir}/libhistory*
  282. removefrom libreport /usr/bin/* /usr/share/locale/*
  283. removefrom rpm /usr/share/locale/*
  284. removefrom rsync /etc/*
  285. removefrom sed /usr/share/locale/*
  286. removefrom smartmontools /etc/* /usr/sbin/smartd
  287. removefrom smartmontools /usr/sbin/update-smart-drivedb
  288. removefrom smartmontools /usr/share/smartmontools/*
  289. removefrom sqlite /usr/bin/*
  290. removefrom system-config-date /etc/* /usr/bin/* /usr/share/icons/*
  291. removefrom system-config-keyboard /etc/* /usr/bin/* /usr/share/icons/*
  292. removefrom sysvinit-tools /usr/bin/*
  293. removefrom tar /usr/share/locale/*
  294. removefrom usbutils /usr/bin/*
  295. removefrom util-linux --allbut \
  296. /usr/bin/{dmesg,eject,getopt,kill,login,lsblk,more,mount,umount,mountpoint,findmnt} \
  297. /etc/mtab /etc/pam.d/login /etc/pam.d/remote \
  298. /usr/sbin/{agetty,blkid,blockdev,clock,fdisk,fsck,fstrim,hwclock,losetup} \
  299. /usr/sbin/{mkswap,swaplabel,nologin,sfdisk,swapoff,swapon,wipefs,partx,fsfreeze} \
  300. /usr/bin/{logger,hexdump,flock,lscpu,chmem,lsmem,setpriv}
  301. removefrom volume_key-libs /usr/share/locale/*
  302. removefrom wget /etc/* /usr/share/locale/*
  303. removefrom xorg-x11-drv-intel /usr/${libdir}/libI*
  304. removefrom xorg-x11-drv-openchrome /usr/${libdir}/libchrome*
  305. removefrom xorg-x11-drv-synaptics /usr/bin/*
  306. removefrom xorg-x11-drv-wacom /usr/bin/*
  307. removefrom xorg-x11-fonts-misc --allbut /usr/share/X11/fonts/misc/{6x13,encodings,fonts,*cursor}*
  308. removefrom xorg-x11-server-utils --allbut /usr/bin/xrandr /usr/share/X11/rgb.txt /usr/bin/xrdb
  309. removefrom yum /etc/* /usr/share/locale/* /usr/share/yum-cli/*
  310. %if branding.release:
  311. removefrom ${branding.logos} /usr/share/plymouth/*
  312. removefrom ${branding.logos} /etc/*
  313. removefrom ${branding.logos} /usr/share/icons/{Bluecurve,oxygen}/*
  314. removefrom ${branding.logos} /usr/share/{firstboot,gnome-screensaver,kde4,pixmaps}/*
  315. %endif
  316. ## cleanup_python_files()
  317. runcmd find ${root} -name "*.pyo" -type f -delete
  318. runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \;
  319. ## cleanup /boot/ leaving vmlinuz, and .*hmac files
  320. runcmd chroot ${root} find /boot \! -name "vmlinuz*" \
  321. -and \! -name ".vmlinuz*" \
  322. -and \! -name boot -delete
  323. ## remove any broken links in /etc or /usr
  324. ## (broken systemd service links lead to confusing noise at boot)
  325. ## NOTE: not checking /var because we want to keep /var/run
  326. ## NOTE: Excluding /etc/mtab which links to /proc/self/mounts for systemd
  327. runcmd chroot ${root} find -L /etc /usr -xdev -type l -and \! -name "mtab" \
  328. -printf "removing broken symbolic link %p -> %l\n" -delete
  329. ## Clean up some of the mess pulled in by webkitgtk via yelp
  330. ## libwebkit2gtk links to a handful of libraries in gstreamer and
  331. ## gstreamer-plugins-base. Remove the rest of them.
  332. removefrom gstreamer1 --allbut /usr/${libdir}/libgstbase-1.0.* \
  333. /usr/${libdir}/libgstreamer-1.0.*
  334. removefrom gstreamer1-plugins-base --allbut \
  335. /usr/${libdir}/libgst{allocators,app,audio,badallocators,fft,gl,pbutils,tag,video}-1.0.*
  336. ## We have enough geoip libraries, thanks
  337. removepkg geoclue2
  338. ## And remove the packages that those extra libraries pulled in
  339. removepkg opus libtheora libvisual flac-libs gsm avahi-glib avahi-libs \
  340. ModemManager-glib
  341. ## gnome-kiosk dependencies require libvorbis and libvorbisfile, but enc/dec are no longer needed
  342. removefrom libvorbis --allbut /usr/${libdir}/libvorbisfile.* /usr/${libdir}/libvorbis.*