From c4165ac02ef91d7f83acf27cb89ecb34f08ed4a7 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 12 Jun 2016 18:31:30 +0300 Subject: [PATCH] added logrotate support --- board/common/cleanups.sh | 15 ++++++++++++++- board/common/overlay/etc/logrotate.conf | 9 +++++++++ configs/bananapi_defconfig | 1 + configs/cubietruck_defconfig | 1 + configs/odroidc1_defconfig | 1 + configs/odroidxu4_defconfig | 1 + configs/raspberrypi2_defconfig | 1 + configs/raspberrypi3_defconfig | 1 + configs/raspberrypi_defconfig | 1 + 9 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 board/common/overlay/etc/logrotate.conf diff --git a/board/common/cleanups.sh b/board/common/cleanups.sh index 4a07abbb65..a491ba22e5 100755 --- a/board/common/cleanups.sh +++ b/board/common/cleanups.sh @@ -18,6 +18,7 @@ rm -rf $TARGET/etc/sudoers.d/ rm -rf $TARGET/etc/ssl/man rm -rf $TARGET/etc/ssl/misc rm -rf $TARGET/etc/ssl/private +rm -rf $TARGET/etc/logrotate.d rm -f $TARGET/etc/rc_maps.cfg rm -f $TARGET/etc/udev/hwdb.d/20-pci-vendor-model.hwdb @@ -107,7 +108,19 @@ rm -f $TARGET/usr/sbin/fdformat rm -f $TARGET/usr/bin/linux32 rm -f $TARGET/usr/bin/linux64 rm -f $TARGET/usr/bin/uname26 - +rm -f $TARGET/bin/zcat +rm -f $TARGET/bin/zcmp +rm -f $TARGET/bin/zdiff +rm -f $TARGET/bin/zegrep +rm -f $TARGET/bin/zfgrep +rm -f $TARGET/bin/zforce +rm -f $TARGET/bin/zgrep +rm -f $TARGET/bin/zless +rm -f $TARGET/bin/zmore +rm -f $TARGET/bin/znew +rm -f $TARGET/bin/gzexe +rm -f $TARGET/bin/uncompress +rm -f $TARGET/usr/bin/v4l2-compliance rm -f $TARGET/usr/bin/slogin rm -f $TARGET/usr/bin/ssh-keyscan rm -f $TARGET/usr/bin/ssh-add diff --git a/board/common/overlay/etc/logrotate.conf b/board/common/overlay/etc/logrotate.conf new file mode 100644 index 0000000000..f2adab19e0 --- /dev/null +++ b/board/common/overlay/etc/logrotate.conf @@ -0,0 +1,9 @@ +/var/log/*.log /var/log/messages /var/log/samba/*.* { + rotate 9 + compress + copytruncate + size 10M + missingok + nomail +} + diff --git a/configs/bananapi_defconfig b/configs/bananapi_defconfig index 7636f9a765..9b25236a7c 100644 --- a/configs/bananapi_defconfig +++ b/configs/bananapi_defconfig @@ -110,6 +110,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/cubietruck_defconfig b/configs/cubietruck_defconfig index 72e6c80d60..a0ae01f9f9 100644 --- a/configs/cubietruck_defconfig +++ b/configs/cubietruck_defconfig @@ -108,6 +108,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/odroidc1_defconfig b/configs/odroidc1_defconfig index 13eed3e35c..8084d8baa9 100644 --- a/configs/odroidc1_defconfig +++ b/configs/odroidc1_defconfig @@ -108,6 +108,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/odroidxu4_defconfig b/configs/odroidxu4_defconfig index d8402b066f..c63b460871 100644 --- a/configs/odroidxu4_defconfig +++ b/configs/odroidxu4_defconfig @@ -99,6 +99,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig index a26a38b1d8..b4c65f427b 100644 --- a/configs/raspberrypi2_defconfig +++ b/configs/raspberrypi2_defconfig @@ -112,6 +112,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig index 71ff34c499..b7c86521ed 100644 --- a/configs/raspberrypi3_defconfig +++ b/configs/raspberrypi3_defconfig @@ -112,6 +112,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index 6a3008f10f..4a59fae6b9 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -113,6 +113,7 @@ BR2_PACKAGE_WPA_SUPPLICANT=y BR2_PACKAGE_WPA_SUPPLICANT_EAP=y BR2_PACKAGE_WPA_SUPPLICANT_CLI=y BR2_PACKAGE_BASH=y +BR2_PACKAGE_LOGROTATE=y BR2_PACKAGE_TAR=y BR2_PACKAGE_UTIL_LINUX_BINARIES=y BR2_PACKAGE_UTIL_LINUX_PARTX=y