[or-cvs] r11666: Improve building by not requiring the checkout to be in /usr (incognito/trunk)
double at seul.org
double at seul.org
Thu Sep 27 16:09:30 UTC 2007
Author: double
Date: 2007-09-27 12:09:30 -0400 (Thu, 27 Sep 2007)
New Revision: 11666
Added:
incognito/trunk/build-stage.sh
Modified:
incognito/trunk/building.html
incognito/trunk/livecd-stage2.sh
Log:
Improve building by not requiring the checkout to be in /usr/src/incognito
Added: incognito/trunk/build-stage.sh
===================================================================
--- incognito/trunk/build-stage.sh (rev 0)
+++ incognito/trunk/build-stage.sh 2007-09-27 16:09:30 UTC (rev 11666)
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+source /etc/catalyst/catalyst.conf
+
+# Build any stage modifying the checkout root to the pwd.
+
+# Verify arguments
+SPEC="$1"
+if [[ -z "${SPEC}" ]] || [[ ! -r "${SPEC}" ]]; then
+ echo "Usage: $0 <spec_file>"
+ exit 1
+fi
+
+# Verify correct type
+if grep "target:.*livecd-stage2" "${SPEC}" >/dev/null; then
+ echo "Target must NOT be livecd-stage2: ${SPEC}"
+ grep "target:" "${SPEC}"
+ echo "Use livecd-stage2.sh"
+ exit 1
+fi
+
+# Create temporary
+DIR="$(mktemp -t -d incognitoXXXXXXXX)"
+if [[ $? -ne 0 ]]; then
+ echo "Could not create temporary directory, $? from mktemp" >2
+ exit 1
+fi
+
+cp "${SPEC}" "${DIR}/stage.spec"
+
+# Fix checkout root
+sed -i "s:/usr/src/incognito:$(pwd):g" "${DIR}/stage.spec"
+
+# Build it
+NICECMD=""
+[[ -x "/usr/bin/ionice" ]] && NICECMD="/usr/bin/ionice -c 3"
+[[ -x "/usr/bin/schedtool" ]] && NICECMD="/usr/bin/schedtool -B -n 8 -e ${NICECMD}"
+${NICECMD} catalyst -f "${DIR}/stage.spec"
+
+# Clean up
+rm -rf "${DIR}"
+
Property changes on: incognito/trunk/build-stage.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: incognito/trunk/building.html
===================================================================
--- incognito/trunk/building.html 2007-09-27 16:08:10 UTC (rev 11665)
+++ incognito/trunk/building.html 2007-09-27 16:09:30 UTC (rev 11666)
@@ -5,7 +5,7 @@
<body>
<p>
-Following are the steps to build the Incognito CD. Note that this process will take a long time as all software is compiled from scratch. You'll get a nice, compact, optimized system though.
+Following are the steps to build the Incognito CD. Note that this process will take a long time as all software is compiled from scratch. You'll get a nice, compact, optimized CD though.
</p>
<p>
@@ -17,10 +17,8 @@
</p>
<ol>
-<li>Ensure the source is in /usr/src/incognito. This is required due to absolute
-paths needed in current versions of catalyst (2.0.4).</li>
-<li>Download <code>stage3-i686-2006.1.tar.bz2</code> into <code>/var/tmp/catalyst/builds/default/</code>. You can find this tarball from a <a href="http://www.gentoo.org/main/en/mirrors.xml">Gentoo Mirror</a>. Look for a directory structure like <code>releases/x86/2006.1/stages/</code>.</li>
+<li>Download <code>stage3-i686-2007.0.tar.bz2</code> into <code>/var/tmp/catalyst/builds/default/</code>. You can find this tarball from a <a href="http://www.gentoo.org/main/en/mirrors.xml">Gentoo Mirror</a>. Look for a directory structure like <code>releases/x86/2007.0/stages/</code>.</li>
<li>Pick version number from current date using YYYYMMDD format.</li>
@@ -40,22 +38,22 @@
related to stage1, stage2 or stage3 may be removed. Only the stage3 tarball
needs to be kept.
<pre>
- catalyst -f arch/x86/stage1.spec
- catalyst -f arch/x86/stage2.spec
- catalyst -f arch/x86/stage3.spec
+ ./build-stage.sh arch/x86/stage1.spec
+ ./build-stage.sh arch/x86/stage2.spec
+ ./build-stage.sh arch/x86/stage3.spec
</pre>
</li>
<li>Generate full version.
<pre>
- catalyst -f arch/x86/livecd-stage1.spec
+ ./build-stage.sh arch/x86/livecd-stage1.spec
./livecd-stage2.sh arch/x86/livecd-stage2.spec
</pre>
</li>
<li>Generate tiny version.
<pre>
- catalyst -f arch/x86/livecd-stage1-tiny.spec
+ ./build-stage.sh arch/x86/livecd-stage1-tiny.spec
./livecd-stage2.sh arch/x86/livecd-stage2-tiny.spec
</pre>
</li>
@@ -72,14 +70,14 @@
<li>Generate full version. (~2 hours)
<pre>
- catalyst -f arch/x86/livecd-stage1.spec
+ ./build-stage.sh arch/x86/livecd-stage1.spec
./livecd-stage2.sh arch/x86/livecd-stage2.spec
</pre>
</li>
<li>Generate tiny version. (~30 minutes)
<pre>
- catalyst -f arch/x86/livecd-stage1-tiny.spec
+ ./build-stage.sh arch/x86/livecd-stage1-tiny.spec
./livecd-stage2.sh arch/x86/livecd-stage2-tiny.spec
</pre>
</li>
Modified: incognito/trunk/livecd-stage2.sh
===================================================================
--- incognito/trunk/livecd-stage2.sh 2007-09-27 16:08:10 UTC (rev 11665)
+++ incognito/trunk/livecd-stage2.sh 2007-09-27 16:09:30 UTC (rev 11666)
@@ -4,12 +4,20 @@
# Build a livecd-stage2 ensuring the .svn directories don't make it on
+# Verify arguments
SPEC="$1"
if [[ -z "${SPEC}" ]] || [[ ! -r "${SPEC}" ]]; then
echo "Usage: $0 <spec_file>"
exit 1
fi
+# Verify correct type
+if ! grep "target:.*livecd-stage2" "${SPEC}" >/dev/null; then
+ echo "Target must be livecd-stage2: ${SPEC}"
+ grep "target:" "${SPEC}"
+ exit 1
+fi
+
# Find overlay
OVERLAY="$(grep 'livecd/overlay:' ${SPEC} | cut -d ':' -f 2 | tr -d [:space:])"
if [[ -n "${OVERLAY}" ]] && [[ ! -d "${OVERLAY}" ]]; then
More information about the tor-commits
mailing list