From f79f4dfe8827078280d6f87f556349ccfdb47096 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Tue, 8 Mar 2011 03:18:19 +0000 Subject: [PATCH] -Ajout repertoire fcron.d pour stocker les crontab -Ajout update-pciids et update-usbids a fcron --- stage1/create-directories | 1 + stage2/install-hv-utilities | 4 ++++ stage3/misc/update-pciids | 3 +++ stage3/misc/update-usbids | 3 +++ stage3/pkg/fcron | 21 +++++++++++---------- stage3/pkg/pciutils | 5 +++++ stage3/pkg/usbutils | 5 +++++ stage5/hv-install-1 | 14 ++++---------- stage5/packages-update | 8 ++------ stage5/post-install | 9 +++------ stage5/stage.def | 2 +- 11 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 stage3/misc/update-pciids create mode 100644 stage3/misc/update-usbids diff --git a/stage1/create-directories b/stage1/create-directories index 6e9e854..d3e1e43 100755 --- a/stage1/create-directories +++ b/stage1/create-directories @@ -22,6 +22,7 @@ for dir in ${LFS}/usr{,/local}; do done mkdir -pv ${LFS}/etc/{skel,sysconfig/network} +mkdir -pv ${LFS}/etc/fcron/fcron.d} mkdir -pv ${LFS}/usr/share/pixmaps mkdir -pv ${LFS}/usr/local/share/pixmaps diff --git a/stage2/install-hv-utilities b/stage2/install-hv-utilities index b043a7d..833fcc0 100755 --- a/stage2/install-hv-utilities +++ b/stage2/install-hv-utilities @@ -20,4 +20,8 @@ for program in ${BIN_UTILITIES}; do install -v ${SRCDIR}/${program} ${BINDIR} done +# Install fcrontab for rotatelogs +echo "# Rotate logs every day at 00:05" > /etc/fcron/fcron.d/rotatelogs +echo "&mail(false) 05 00 * * * ${BINDIR}/rotatelogs" >> /etc/fcron/fcron.d/rotatelogs + exit $? diff --git a/stage3/misc/update-pciids b/stage3/misc/update-pciids new file mode 100644 index 0000000..c297fd0 --- /dev/null +++ b/stage3/misc/update-pciids @@ -0,0 +1,3 @@ +# &options min hrs day-of-month month day-of-week command +# Update PCI IDs database every day at 4:05 +&mail(false) 05 04 * * * /usr/sbin/update-pciids diff --git a/stage3/misc/update-usbids b/stage3/misc/update-usbids new file mode 100644 index 0000000..2255d26 --- /dev/null +++ b/stage3/misc/update-usbids @@ -0,0 +1,3 @@ +# &options min hrs day-of-month month day-of-week command +# Update USB IDs database every day at 4:05 +&mail(false) 05 04 * * * /usr/sbin/update-usbids diff --git a/stage3/pkg/fcron b/stage3/pkg/fcron index 517298a..46bd07d 100644 --- a/stage3/pkg/fcron +++ b/stage3/pkg/fcron @@ -57,21 +57,22 @@ editor = /usr/bin/nano EOF chmod 640 /etc/fcron/fcron.conf - cat > /etc/fcron/fcrontab << "EOF" -# &options min hrs day-of-month month day-of-week command -# Run rotatelogs every day at 00:05 -#&mail(false) 05 00 * * * /usr/local/bin/rotatelogs -EOF - chmod 640 /etc/fcron/fcrontab - chown -R root.fcron /etc/fcron - install -d /var/spool/fcron chown fcron.fcron /var/spool/fcron cat > /etc/fcron/configure << "EOF" -#!/bin/sh +#!/bin/bash + +# Create empty file (or erase existing file) +> /etc/fcron/fcron.tab + +for f in /etc/fcron/fcron.d/*; do + cat $f >> /etc/fcron/fcron.tab +done + +chmod 640 /etc/fcron/fcron.tab -fcrontab -c /etc/fcron/fcron.conf /etc/fcron/fcrontab +fcrontab -c /etc/fcron/fcron.conf /etc/fcron/fcron.tab exit $? EOF diff --git a/stage3/pkg/pciutils b/stage3/pkg/pciutils index a63b8ac..d34ae77 100644 --- a/stage3/pkg/pciutils +++ b/stage3/pkg/pciutils @@ -12,3 +12,8 @@ hvbuild() # Some packages require the PCI static library: make PREFIX=/usr install-lib } + +hvbuild_post() +{ + install -m644 ${SCRDIR}/misc/update-pciids /etc/fcron/fcron.d +} diff --git a/stage3/pkg/usbutils b/stage3/pkg/usbutils index c20f9b0..6ff7383 100644 --- a/stage3/pkg/usbutils +++ b/stage3/pkg/usbutils @@ -18,3 +18,8 @@ hvbuild_post() # Update database /usr/sbin/update-usbids } + +hvbuild_post() +{ + install -m644 ${SCRDIR}/misc/update-usbids /etc/fcron/fcron.d +} diff --git a/stage5/hv-install-1 b/stage5/hv-install-1 index 494716b..85bc799 100755 --- a/stage5/hv-install-1 +++ b/stage5/hv-install-1 @@ -1,16 +1,10 @@ -#!/bin/sh - -LFS_STAGE=stage5 - -export LFS_PKG_DIR="$(dirname $(pwd))/packages/${LFS_STAGE}" -export LFS_LOG_DIR=/var/log/hvlinux-install/${LFS_STAGE} -export LFS_LOG_FILE=${LFS_LOG_DIR}/install.log -export LFS_TMP=/tmp +#!/bin/bash # Reading system configuration informations, functions and package versions. -source ../sysinfos +source ../config/sysinfos source ../functions -source ../packages-list +hvtrap_setup +source ../config/packages-list source /etc/profile if [ "x${USER}" != "xroot" ]; then diff --git a/stage5/packages-update b/stage5/packages-update index ec570d4..08b8883 100755 --- a/stage5/packages-update +++ b/stage5/packages-update @@ -5,14 +5,10 @@ USE_BLFS_PATCHES=1 USE_HV_PATCHES=1 # Reading system configuration informations, functions and package versions. -source ../sysinfos +source ../config/sysinfos source ../functions source ../functions-fpkg -source ../packages-list - -# Execute a return statement instead of exit, to be able to continue with -# downloading other packages -export RCMD_NO_EXIT=1 +source ../config/packages-list update_packages_init diff --git a/stage5/post-install b/stage5/post-install index e76a0a7..92fa4b4 100755 --- a/stage5/post-install +++ b/stage5/post-install @@ -1,12 +1,9 @@ -#!/bin/sh -set -o errexit - -# First argument of this script is the package name. +#!/bin/bash # Reading system configuration informations, functions and package versions. -source ../sysinfos +source ../config/sysinfos source ../functions -source ../packages-list +source ../config/packages-list if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then diff --git a/stage5/stage.def b/stage5/stage.def index cf17b3f..5e939c1 100644 --- a/stage5/stage.def +++ b/stage5/stage.def @@ -1,3 +1,3 @@ #!/bin/bash -export LFS_STAGE=stage3 +export LFS_STAGE=stage5 -- 2.20.1