From 5d494ebc6690e09f6dd2b69bb29e9aa1dbee97df Mon Sep 17 00:00:00 2001 From: hugo Date: Sat, 13 Sep 2008 17:05:21 +0000 Subject: [PATCH] -Remis les optimisations pour GCC. -Ajout du bootscript cleanfs. -Ajout du script tarbz2. --- stage2/bootscripts/cleanfs | 43 ++++++++++++++++++++++++++++++++++++++ stage2/cis-bootscripts | 11 +++++----- stage2/cis-gcc | 8 +------ stage2/cis-hv-utilities | 2 +- stage2/hv-utilities/tarbz2 | 25 ++++++++++++++++++++++ stage2/packages-update | 2 +- 6 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 stage2/bootscripts/cleanfs create mode 100755 stage2/hv-utilities/tarbz2 diff --git a/stage2/bootscripts/cleanfs b/stage2/bootscripts/cleanfs new file mode 100644 index 0000000..0453ef3 --- /dev/null +++ b/stage2/bootscripts/cleanfs @@ -0,0 +1,43 @@ +#!/bin/sh + +# cleanfs +# Clean file system + +# Source functions library +source /etc/rc.d/init.d/functions + +log_script_name "$0 $*" + +clean_files() +{ + failed=0 + + cd /tmp && + find . -xdev -mindepth 1 ! -name lost+found ! -name trash ! -name log-init ! -name init.log -delete || failed=1 + + cd /var/lock && + find . -type f ! -newer /proc -exec rm -f {} \; || failed=1 + + cd /var/run && + find . ! -type d ! -name utmp ! -newer /proc -exec rm -f {} \; || failed=1 + > /var/run/utmp + if grep -q '^utmp:' /etc/group ; then + chmod 664 /var/run/utmp + chgrp utmp /var/run/utmp + fi + + return ${failed} +} + + +case "${1}" in + start) + cmd_run_log_box "Cleaning file systems" clean_files + ;; + *) + echo "Usage: $0 {start}" + exit ${EXIT_CODE_FAILURE} + ;; +esac + +exit $? diff --git a/stage2/cis-bootscripts b/stage2/cis-bootscripts index a9c849c..bb7d77b 100755 --- a/stage2/cis-bootscripts +++ b/stage2/cis-bootscripts @@ -97,7 +97,7 @@ if [ "x${KEYBOARD}" != "x" ]; then fi # Copying boot scripts -STAGE2_BOOTSCRIPTS="functions rc checkfs dhcp halt ifdown ifup initlog keyboard modules mountfs \ +STAGE2_BOOTSCRIPTS="functions rc checkfs cleanfs dhcp halt ifdown ifup initlog keyboard modules mountfs \ mountkernfs mountnetfs network nfs portmap reboot sendsignals setclock sshd swap sysklogd udev udev_retry" mkdir -p /etc/rc.d/init.d && for bootscript in ${STAGE2_BOOTSCRIPTS}; do @@ -125,10 +125,11 @@ bootscript_add_rcS udev 20 00 && bootscript_add_rcS swap 25 94 && bootscript_add_rcS checkfs 30 00 && bootscript_add_rcS mountfs 35 95 && -bootscript_add_rcS udev_retry 40 00 && -bootscript_add_rcS sysklogd 45 93 && -bootscript_add_rcS keyboard 50 00 && -bootscript_add_rcS setclock 55 92 && +bootscript_add_rcS cleanfs 40 00 && +bootscript_add_rcS udev_retry 45 00 && +bootscript_add_rcS sysklogd 50 93 && +bootscript_add_rcS keyboard 55 00 && +bootscript_add_rcS setclock 60 92 && # rc0.d bootscript_add_manual 0 sendsignals 95 00 && diff --git a/stage2/cis-gcc b/stage2/cis-gcc index 6812f7e..3b02999 100755 --- a/stage2/cis-gcc +++ b/stage2/cis-gcc @@ -6,9 +6,6 @@ source ../sysinfos source ../functions source ../packages-list -# Saves CFLAGS and CXXFLAGS, and clears them. -save_flags_no_optimizations - # Applying a sed substitution that will suppress the installation of # libiberty.a. We want to use the Binutils version of libiberty.a cd ${LFS_TMP}/${1} && @@ -48,10 +45,7 @@ ln -v -sf gcc /usr/bin/cc && echo 'main(){}' > dummy.c && cc dummy.c && readelf -l a.out | grep ': /lib' 1> /dev/null 2>&1 && -rm dummy.c a.out && - -# Restore original CFLAGS and CXXFLAGS values. -restore_flags +rm dummy.c a.out # Return last error exit $? diff --git a/stage2/cis-hv-utilities b/stage2/cis-hv-utilities index a721fa6..db682a2 100755 --- a/stage2/cis-hv-utilities +++ b/stage2/cis-hv-utilities @@ -13,7 +13,7 @@ SYSBINDIR="${PREFIX}/sbin" BIN_UTILITIES="camera-download cd-erase cd-copy pstopdf distro-backup dos2unix \ dvd-ram-format fix-avi gztobz2 hv-backup hv-video-dvd mail-files \ mail-if-fail mail-statistics media-write pstopdf replace.pl \ - rotatelogs setdate strip-debug-symbols tildes-clean" + rotatelogs setdate strip-debug-symbols tarbz2 tildes-clean" for program in ${BIN_UTILITIES}; do install -v ${SRCDIR}/${program} ${BINDIR} || exit 1 diff --git a/stage2/hv-utilities/tarbz2 b/stage2/hv-utilities/tarbz2 new file mode 100755 index 0000000..cec3194 --- /dev/null +++ b/stage2/hv-utilities/tarbz2 @@ -0,0 +1,25 @@ +#!/bin/sh + +print_usage() +{ + echo "$(basename $0) -- Create bzip2 compressed TAR archive." + echo "Usage: $(basename $0) DIR" +} + +if [ $# -ne 1 ]; then + print_usage + exit 1 +fi + +DIR=${1} + +# Checking if directory exists. +if [ ! -d ${DIR} ]; then + echo "$0: Directory ${DIR} not found." + exit 1 +fi + +# Decompressing file to standard output and piping result to bzip2 +tar cvf - ${DIR} | bzip2 -9 > ${DIR}.tar.bz2 + +exit $? diff --git a/stage2/packages-update b/stage2/packages-update index 2820e42..48533f7 100755 --- a/stage2/packages-update +++ b/stage2/packages-update @@ -54,7 +54,7 @@ fpkg_gnu ${GROFF} fpkg_sf ${FLEX} fpkg_gnu ${INETUTILS} fpkg_hv ${IPROUTE2} -fpkg_lfs ${FILE_PKG} "file" +fpkg ${FILE_PKG} "ftp://ftp.gw.com/mirrors/unix/file/" fpkg ${KBD} http://www.kernel.org/pub/linux/utils/kbd fpkg ${GRUB} ftp://alpha.gnu.org/gnu/grub fpkg ${MAN} http://primates.ximian.com/~flucifredi/man -- 2.20.1