Permalink
Cannot retrieve contributors at this time
70 lines (59 sloc)
3.41 KB
| source "${SRC}/fragments/hack/hack-armbian-packages.sh" # Common hacks with package lists. | |
| ### Hooks | |
| # Remove packages that dont belong in a cloud image. | |
| # Wifi, Chrony, etc. | |
| user_config__remove_uncloudlike_packages() { | |
| display_alert "Removing" "uncloudlike packages: wifi, chrony, etc." | |
| # crda is needed for linux-modules-extra which is essential albeit the name | |
| # crda in turn depends on iw, wireless-regdb | |
| remove_packages_everywhere chrony unattended-upgrades wpasupplicant rng-tools networkd-dispatcher hping3 selinux-policy-default dkms vnstat packagekit policykit-1 | |
| remove_packages_everywhere armbian-config # super heavy and very unlikely to be used from a cloud image. if needed just install from repo | |
| export PACKAGE_LIST_BOARD="${PACKAGE_LIST_BOARD} systemd-timesyncd" # chrony does not play well with systemd / qemu-agent. | |
| } | |
| # Tweak the BSP, removing a bunch of stuff that's great for interactive end-users and memory-deprived systems, | |
| # but not so much for something is is provisioned like a cloud instance. | |
| # @TODO: terrible way, just delete stuff, most stuff will error out at runtime. rethink. | |
| post_family_tweaks_bsp__be_more_like_ubuntu_cloud() { | |
| #display_alert "Starting files at BSP at ${destination}" "more-like-ubuntu-cloud" "info" | |
| #find "$destination" -type f | |
| display_alert "Removing stuff from BSP at ${destination}" "more-like-ubuntu-cloud" "info" | |
| # Lets obliterate stuff in mass. | |
| find "$destination" -type f | grep \ | |
| -e "polkit" \ | |
| -e "bootsplash" \ | |
| -e "autologin" \ | |
| -e "firstrun" \ | |
| -e "journald" \ | |
| -e "armbian-config" \ | |
| -e "resize" \ | |
| -e "zram" \ | |
| -e "periodic" \ | |
| -e "interfaces\.default" \ | |
| -e "NetworkManager" \ | |
| -e "profile-sync-daemon" \ | |
| -e "logrotate" \ | |
| -e "ramlog" | xargs rm | |
| display_alert "Hacking at the BSP at ${destination}" "more-like-ubuntu-cloud" "info" | |
| # remove a bunch of stuff from bsp so it behaves more like regular ubuntu | |
| RM_OPTIONS="-f" | |
| rm ${RM_OPTIONS} "$destination"/etc/apt/apt.conf.d/02-armbian-compress-indexes | |
| rm ${RM_OPTIONS} "$destination"/etc/cron.d/armbian-truncate-logs | |
| rm ${RM_OPTIONS} "$destination"/etc/cron.d/armbian-updates | |
| rm ${RM_OPTIONS} "$destination"/etc/cron.daily/armbian-ram-logging | |
| rm ${RM_OPTIONS} "$destination"/etc/default/armbian-ramlog.dpkg-dist | |
| rm ${RM_OPTIONS} "$destination"/etc/default/armbian-zram-config.dpkg-dist | |
| rm ${RM_OPTIONS} "$destination"/etc/profile.d/armbian-check-first-login.sh | |
| rm ${RM_OPTIONS} "$destination"/etc/lib/systemd/system/systemd-journald.service.d/override.conf | |
| rm ${RM_OPTIONS} "$destination"/etc/lib/systemd/system/armbian-firstrun.service | |
| rm ${RM_OPTIONS} "$destination"/etc/lib/systemd/system/armbian-ramlog.service | |
| rm ${RM_OPTIONS} "$destination"/etc/lib/systemd/system/armbian-resize-filesystem.service | |
| rm ${RM_OPTIONS} "$destination"/etc/lib/systemd/system/armbian-zram-config.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-firstrun-config.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-firstrun.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-resize-filesystem.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-zram-config.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-disable-autologin.service | |
| rm ${RM_OPTIONS} "$destination"/lib/systemd/system/armbian-ramlog.service | |
| #display_alert "Remaining files at BSP at ${destination}" "more-like-ubuntu-cloud" "info" | |
| #find "$destination" -type f | |
| } |