Another paco patch is ready ;)

Notes:
- It works for the HLFS and LFS part of jhalfs-X-2378.
- The use of Paco can be toggled on/off in the common/config file
- Use paco-svn-20060319 or later, 1.10.2 will fail with HLFS and 1.10.3 has a bug and doesn't honour the EXCLUDE dirs. - Paco will be installed twice in Ch06. The first install will link against /tools, and second link against the adjusted toolchain. - The paco source package has to be copied manually to the /sources dir before starting the make

That should be it, enjoy :)

I'll start working on the BLFS part now, but that will need a totally different approach, so it'll maybe take awhile. The CLFS part will be that last thing I try, as there's a lot of changes there, and I don't have any experience with it.

All feedback welcome


Tor Olav
diff -Naur jhalfs-X-2378-orig/HLFS/master.sh jhalfs-X-2378-paco/HLFS/master.sh
--- jhalfs-X-2378-orig/HLFS/master.sh   2006-03-21 09:02:41.000000000 +0100
+++ jhalfs-X-2378-paco/HLFS/master.sh   2006-03-21 09:10:54.000000000 +0100
@@ -371,7 +371,13 @@
     #
     # The rest of Chapter06
     else
-      wrt_run_as_chroot1 "${this_script}" "${file}"
+      if [ "$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
     fi
     #
     # Remove the build directory(ies) except if the package build fails.
@@ -399,6 +405,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/*
 
 }
@@ -463,6 +478,17 @@
     # 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 ]] ; then
+      if [[ `_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 [[ `_IS_ $this_script bootscripts` ]]; then
+        wrt_paco_prep
+        wrt_run_as_chroot2 "${this_script}" "${file}"
+        wrt_paco_log "hlfs-bootscripts"
+      fi
     else
       # Initialize the log and run the script
       wrt_run_as_chroot2 "${this_script}" "${file}"
diff -Naur jhalfs-X-2378-orig/LFS/master.sh jhalfs-X-2378-paco/LFS/master.sh
--- jhalfs-X-2378-orig/LFS/master.sh    2006-03-21 09:02:41.000000000 +0100
+++ jhalfs-X-2378-paco/LFS/master.sh    2006-03-21 09:10:54.000000000 +0100
@@ -188,8 +188,14 @@
     # and not to use chroot.
     if [[ `_IS_ ${this_script} kernfs` ]] ; then
       wrt_run_as_root "${this_script}" "$file"
-    else   # The rest of Chapter06
-      wrt_run_as_chroot1 "${this_script}" "$file"
+    else
+      if [ "$vrs" != "" ] && [ $USE_PACO != 0 ]; then
+        wrt_paco_prep
+        wrt_run_as_chroot1 "${this_script}" "${file}"
+        wrt_paco_log "${name}" "${vrs}"
+      else   # The rest of Chapter06
+        wrt_run_as_chroot1 "${this_script}" "$file"
+      fi
     fi
 
     # Remove the build directory(ies) except if the package build fails.
@@ -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/*
 }
 
@@ -258,6 +273,16 @@
       # 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 ]] ; then
+      if [[ `_IS_ $this_script kernel` ]] ; then
+        wrt_paco_prep
+        wrt_run_as_chroot2 "${this_script}" "${file}"
+        wrt_paco_log "linux-kernel" "${vrs}"
+      elif [[ `_IS_ $this_script bootscripts` ]]; then
+        wrt_paco_prep
+        wrt_run_as_chroot2 "${this_script}" "${file}"
+        wrt_paco_log "lfs-bootscripts" "${vrs}"
+      fi
     else
       # Initialize the log and run the script
       wrt_run_as_chroot2 "$this_script" "$file"
diff -Naur jhalfs-X-2378-orig/common/config jhalfs-X-2378-paco/common/config
--- jhalfs-X-2378-orig/common/config    2006-03-21 09:02:41.000000000 +0100
+++ jhalfs-X-2378-paco/common/config    2006-03-21 10:28:19.000000000 +0100
@@ -65,3 +65,18 @@
 #--- Working directories
 JHALFSDIR=$BUILDDIR/jhalfs
    LOGDIR=$JHALFSDIR/logs
+
+#==== PACO VARIABLES ====
+#--- Use paco? 0/1 0(no)/1(yes)
+USE_PACO=1
+PACO_VERSION=20060319
+
+#--- 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=/tmp:/usr/src:/usr/share/info/dir
+PACO_TMPFILE=/tmp/paco.tmp
+LD_PRELOAD=/usr/lib/libpaco-log.so
diff -Naur jhalfs-X-2378-orig/common/paco-build.sh 
jhalfs-X-2378-paco/common/paco-build.sh
--- jhalfs-X-2378-orig/common/paco-build.sh     1970-01-01 01:00:00.000000000 
+0100
+++ jhalfs-X-2378-paco/common/paco-build.sh     2006-03-21 09:10:54.000000000 
+0100
@@ -0,0 +1,9 @@
+#!/bin/sh
+set -e
+
+cd $PKGDIR
+./configure --prefix=/usr \
+       --disable-gpaco \
+       --sysconfdir=/etc &&
+make &&
+make install
diff -Naur jhalfs-X-2378-orig/common/paco-functions 
jhalfs-X-2378-paco/common/paco-functions
--- jhalfs-X-2378-orig/common/paco-functions    1970-01-01 01:00:00.000000000 
+0100
+++ jhalfs-X-2378-paco/common/paco-functions    2006-03-21 10:29:59.000000000 
+0100
@@ -0,0 +1,67 @@
+#!/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 \\
+         paco --log --logdir=\$(MOUNT_PT)/var/log/paco \\
+         --package=$package <  \$(MOUNT_PT)$PACO_TMPFILE; \\
+       fi && \\
+       rm -f \$(MOUNT_PT)$PACO_TMPFILE
+EOF
+) >> $MKFILE.tmp
+}
+
diff -Naur jhalfs-X-2378-orig/master.sh jhalfs-X-2378-paco/master.sh
--- jhalfs-X-2378-orig/master.sh        2006-03-21 09:02:41.000000000 +0100
+++ jhalfs-X-2378-paco/master.sh        2006-03-21 09:10:54.000000000 +0100
@@ -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_}"
 
 
@@ -312,6 +320,9 @@
 
 if [[ "$PWD" != "$JHALFSDIR" ]]; then
   cp -v $COMMON_DIR/makefile-functions $JHALFSDIR/
+  if [[ USE_PACO != 0 ]]; then
+    cp -v $COMMON_DIR/paco-build.sh $JHALFSDIR/
+  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

Reply via email to