Thanks David and Manuel for your report.
You found some garbage left after cleaning in my code ;)
I've fixed it and updated the patch.
Thanks guys! :)
Tor Olav
diff -Naur jhalfs-X-2407-orig/BLFS/blfs.xsl jhalfs-X-2407-paco/BLFS/blfs.xsl
--- jhalfs-X-2407-orig/BLFS/blfs.xsl 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/BLFS/blfs.xsl 2006-03-26 10:46:36.000000000 +0200
@@ -158,9 +158,11 @@
<xsl:choose>
<xsl:when test="@role = 'nodump'"/>
<xsl:otherwise>
+ <!-- Commented out by paco-patch
<xsl:if test="@role = 'root'">
<xsl:text>sudo </xsl:text>
</xsl:if>
+ -->
<xsl:apply-templates select="userinput" mode="screen"/>
</xsl:otherwise>
</xsl:choose>
diff -Naur jhalfs-X-2407-orig/BLFS/master.sh jhalfs-X-2407-paco/BLFS/master.sh
--- jhalfs-X-2407-orig/BLFS/master.sh 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/BLFS/master.sh 2006-03-26 10:46:36.000000000 +0200
@@ -79,8 +79,21 @@
EOF
) >> $MKFILE
+ if [[ $USE_PACO != 0 ]]; then
+(
+ cat << EOF
+ @echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n"
>logs/$this_script && \\
+ source $JHALFSDIR/pacovars && \\
+ rm -f $PACO_TMPFILE && \\
+ $JHALFSDIR/${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
+ echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n"
>>logs/$this_script
+EOF
+) >> $MKFILE
+ wrt_paco_log_blfs
+
# Insert date and disk usage at the top of the log file, the script run
# and date and disk usage again at the bottom of the log file.
+ else
(
cat << EOF
@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude=logs/* /\`\n"
>logs/$this_script && \\
diff -Naur jhalfs-X-2407-orig/HLFS/master.sh jhalfs-X-2407-paco/HLFS/master.sh
--- jhalfs-X-2407-orig/HLFS/master.sh 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/HLFS/master.sh 2006-03-26 10:46:36.000000000 +0200
@@ -370,6 +370,10 @@
wrt_run_as_root "${this_script}" "${file}"
#
# The rest of Chapter06
+ elif [ "$vrs" != "" ] && [ $USE_PACO != 0 ]; then
+ wrt_paco_prep
+ wrt_run_as_chroot1 "${this_script}" "${file}"
+ wrt_paco_log "$name" "$vrs"
else
wrt_run_as_chroot1 "${this_script}" "${file}"
fi
@@ -399,6 +403,15 @@
# Keep the script file name for Makefile dependencies.
PREV=$this_script
+
+ if [[ $USE_PACO != 0 ]] ; then
+ if [[ `_IS_ $this_script devices` ]] ; then
+ wrt_paco_inst "068.5"
+ elif [[ `_IS_ $this_script readjusting` ]] ; then
+ wrt_paco_inst "073.5"
+ fi
+ fi
+
done # end for file in chapter06/*
}
@@ -458,6 +471,15 @@
# Check if we have a real /etc/fstab file
if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then
wrt_copy_fstab "$this_script"
+ elif [[ $USE_PACO != 0 ]] && [[ `_IS_ $this_script kernel` ]] ; then
+ vrs=`grep "^linux-version" $JHALFSDIR/packages | sed -e 's/.* //' -e
's/"//g'`
+ wrt_paco_prep
+ wrt_run_as_chroot2 "${this_script}" "${file}"
+ wrt_paco_log "linux-kernel" "$vrs"
+ elif [[ $USE_PACO != 0 ]] && [[ `_IS_ $this_script bootscripts` ]]; then
+ wrt_paco_prep
+ wrt_run_as_chroot2 "${this_script}" "${file}"
+ wrt_paco_log "hlfs-bootscripts"
else
# Initialize the log and run the script
wrt_run_as_chroot2 "${this_script}" "${file}"
diff -Naur jhalfs-X-2407-orig/LFS/master.sh jhalfs-X-2407-paco/LFS/master.sh
--- jhalfs-X-2407-orig/LFS/master.sh 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/LFS/master.sh 2006-03-26 10:46:36.000000000 +0200
@@ -188,7 +188,13 @@
# and not to use chroot.
if [[ `_IS_ ${this_script} kernfs` ]] ; then
wrt_run_as_root "${this_script}" "$file"
- else # The rest of Chapter06
+
+ # The rest of Chapter06
+ elif [ "$vrs" != "" ] && [ $USE_PACO != 0 ]; then
+ wrt_paco_prep
+ wrt_run_as_chroot1 "${this_script}" "${file}"
+ wrt_paco_log "${name}" "${vrs}"
+ else
wrt_run_as_chroot1 "${this_script}" "$file"
fi
@@ -207,6 +213,15 @@
# Keep the script file name for Makefile dependencies.
PREV=${this_script}
+
+ if [[ $USE_PACO != 0 ]] ; then
+ if [[ `_IS_ $this_script devices` ]] ; then
+ wrt_paco_inst "065.5"
+ elif [[ `_IS_ $this_script readjusting` ]] ; then
+ wrt_paco_inst "069.5"
+ fi
+ fi
+
done # end for file in chapter06/*
}
@@ -259,6 +274,14 @@
# Check if we have a real /etc/fstab file
if [[ `_IS_ ${this_script} fstab` ]] && [[ -n "$FSTAB" ]] ; then
wrt_copy_fstab "${this_script}"
+ elif [[ $USE_PACO != 0 ]] && [[ `_IS_ $this_script kernel` ]] ; then
+ wrt_paco_prep
+ wrt_run_as_chroot2 "${this_script}" "${file}"
+ wrt_paco_log "linux-kernel" "${vrs}"
+ elif [[ $USE_PACO != 0 ]] && [[ `_IS_ $this_script bootscripts` ]]; then
+ wrt_paco_prep
+ wrt_run_as_chroot2 "${this_script}" "${file}"
+ wrt_paco_log "lfs-bootscripts" "${vrs}"
else
# Initialize the log and run the script
wrt_run_as_chroot2 "$this_script" "$file"
diff -Naur jhalfs-X-2407-orig/common/config jhalfs-X-2407-paco/common/config
--- jhalfs-X-2407-orig/common/config 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/common/config 2006-03-26 10:46:36.000000000 +0200
@@ -66,3 +66,18 @@
#--- Working directories
JHALFSDIR=$BUILDDIR/jhalfs
LOGDIR=$JHALFSDIR/logs
+
+#==== PACO VARIABLES ====
+#--- Use paco? 0/1 0(no)/1(yes)
+USE_PACO=1
+PACO_VERSION=20060325
+
+#--- Name of the Paco source package
+PACO_FILE=paco-$PACO_VERSION.tar.*
+
+#--- Variables needed
+# Don't change unless you know what you're doing
+PACO_INCLUDE=/
+PACO_EXCLUDE=/sys:/dev:/proc:/tmp:/usr/src:/usr/share/info/dir
+PACO_TMPFILE=/tmp/paco.tmp
+LD_PRELOAD=/usr/lib/libpaco-log.so
diff -Naur jhalfs-X-2407-orig/common/paco-build.sh
jhalfs-X-2407-paco/common/paco-build.sh
--- jhalfs-X-2407-orig/common/paco-build.sh 1970-01-01 01:00:00.000000000
+0100
+++ jhalfs-X-2407-paco/common/paco-build.sh 2006-03-26 10:46:36.000000000
+0200
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+cd $PKGDIR
+./configure --prefix=/usr \
+ --disable-gpaco \
+ --sysconfdir=/etc &&
+make &&
+make install
diff -Naur jhalfs-X-2407-orig/common/paco-functions
jhalfs-X-2407-paco/common/paco-functions
--- jhalfs-X-2407-orig/common/paco-functions 1970-01-01 01:00:00.000000000
+0100
+++ jhalfs-X-2407-paco/common/paco-functions 2006-03-26 10:46:36.000000000
+0200
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+
+#----------------------------#
+wrt_paco_inst() { #
+#----------------------------#
+ name="paco"
+ this_script="$1-$name"
+ file="chapter06/$this_script"
+ chapter6="$chapter6 $this_script"
+
+ # Write target, dependency and unpack
+ wrt_target "$this_script" "$PREV"
+ wrt_unpack2 "$PACO_FILE"
+
+ # Copy the Paco build script to the correct directory and make it executable
+ echo -e "[EMAIL PROTECTED] $JHALFSDIR/paco-build.sh
$JHALFSDIR/${PROGNAME}-commands/$file && \\" >> $MKFILE.tmp
+ echo -e "\tchmod +x $JHALFSDIR/${PROGNAME}-commands/$file" >> $MKFILE.tmp
+
+ # Run the script
+ wrt_run_as_chroot1 "${this_script}" "${file}"
+
+ # Clean up
+ wrt_remove_build_dirs "$name"
+ echo -e '[EMAIL PROTECTED] $@' >> $MKFILE.tmp
+
+ # Override the PREV variable
+ PREV="$this_script"
+}
+
+
+#----------------------------------#
+wrt_paco_prep() { # Export Paco variables
+#----------------------------------# and remove tmpfile
+(
+cat << EOF
+ @echo "export PACO_INCLUDE=$PACO_INCLUDE" >> envars && \\
+ echo "export PACO_EXCLUDE=\$(SRC):$JHALFSDIR:$PACO_EXCLUDE" >> envars
&& \\
+ echo "export PACO_TMPFILE=$PACO_TMPFILE" >> envars && \\
+ echo "export LD_PRELOAD=$LD_PRELOAD" >> envars && \\
+ rm -f \$(MOUNT_PT)$PACO_TMPFILE
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_paco_log() { # If the tmpfile exist, then log the
current package
+#----------------------------------# and remove tempfile
+ local PACKAGE
+
+ if [[ $2 != "" ]] ; then
+ PACKAGE="$1-$2";
+ else
+ PACKAGE="$1"
+ fi
+
+(
+cat << EOF
+ @if [ -e \$(MOUNT_PT)$PACO_TMPFILE ]; then \\
+ \$(CHROOT1) 'paco -lp $PACKAGE < $PACO_TMPFILE' && \\
+ rm -f \$(MOUNT_PT)$PACO_TMPFILE; \\
+ fi;
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_paco_log_blfs() { # If the tmpfile exist, then log the
current package
+#----------------------------------# and remove tempfile
+(
+cat << EOF
+ @PACKAGE=\`head -n1 /tmp/unpacked | sed '[EMAIL
PROTECTED]/@@;s@/.*@@'\` && \\
+ if [ -e $PACO_TMPFILE ]; then \\
+ paco -E ~/sources:$JHALFSDIR:$PACO_EXCLUDE \\
+ -lp \$\$PACKAGE < $PACO_TMPFILE && \\
+ rm -f $PACO_TMPFILE; \\
+ fi;
+EOF
+) >> $MKFILE
+}
+
diff -Naur jhalfs-X-2407-orig/master.sh jhalfs-X-2407-paco/master.sh
--- jhalfs-X-2407-orig/master.sh 2006-03-26 10:45:11.000000000 +0200
+++ jhalfs-X-2407-paco/master.sh 2006-03-26 10:46:36.000000000 +0200
@@ -67,6 +67,14 @@
[[ $? > 0 ]] && echo "$MODULE did not load.." && exit 2
echo "OK"
#
+# If Paco is requested, then source the paco-functions file
+if [ $USE_PACO != 0 ] ; then
+ echo -n "Loading paco-functions module..."
+ source $COMMON_DIR/paco-functions
+ [[ $? > 0 ]] && echo "$COMMON_DIR/paco-functions did not load.." && exit
+ echo "OK"
+fi
+#
echo "---------------${nl_}"
@@ -315,6 +323,14 @@
if [[ "$PWD" != "$JHALFSDIR" ]]; then
cp -v $COMMON_DIR/makefile-functions $JHALFSDIR/
+ if [[ USE_PACO != 0 ]] && [[ $PROGNAME != "blfs" ]]; then
+ cp -v $COMMON_DIR/paco-build.sh $JHALFSDIR/
+ elif [[ USE_PACO != 0 ]] && [[ $PROGNAME = "blfs" ]]; then
+ echo -e "export PACO_INCLUDE=$PACO_INCLUDE" > $JHALFSDIR/pacovars
+ echo -e "export PACO_EXCLUDE=~/sources:$JHALFSDIR:$PACO_EXCLUDE" >>
$JHALFSDIR/pacovars
+ echo -e "export PACO_TMPFILE=$PACO_TMPFILE" >> $JHALFSDIR/pacovars
+ echo -e "export LD_PRELOAD=$LD_PRELOAD" >> $JHALFSDIR/pacovars
+ fi
if [[ -n "$FILES" ]]; then
# pushd/popd necessary to deal with mulitiple files
pushd $PACKAGE_DIR
--
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page