# HG changeset patch
# User Rob Landley
# Date 1351830909 18000
# Node ID da21ff27331eeaae702d30ee097f225d5de11e7d
# Parent c3b91b70cc428a3a0e1b8626229604b1fbb28638
Add ability to check out repositories in packages, IGNORE_REPOS to build from tarballs anyway, a FAQ entry on it, and more/repo.sh to set up/update some of the common ones.
diff -r c3b91b70cc42 -r da21ff27331e config
--- a/config Tue Oct 30 19:55:35 2012 -0500
+++ b/config Thu Nov 01 23:35:09 2012 -0500
@@ -54,19 +54,17 @@
# export SYSIMAGE_TYPE=squashfs
-# Size of writeable HDA image (if any). Does not apply to squashfs or initramfs
+# Size of writeable (ext2) HDA image. Does not apply to squashfs or initramfs
# export SYSIMAGE_HDA_MEGS=2048
-# Set this to use symlinks instead of hard links when creating temporary copies
-# of the source packages (in setupfor). This is slower and uses more inodes,
-# but allows the extracted source packages to live in a different filesystem
-# than the build directory.
+# Build from stable tarballs for these packages, instead of source control
+# repositories.
-# export SNAPSHOT_SYMLINK=1
+# export IGNORE_REPOS=all
# Use qemu to run "hello world" built by the cross compiler. Note that this
-# requires working qemu application emulation for your target to do this, which
+# requires working qemu application emulation for your target, which
# is significantly more brittle than system emulation. (To unbreak qemu-arm,
# "echo 0 > /proc/sys/vm/mmap_min_addr" as root.) You probably don't need
# to do this.
diff -r c3b91b70cc42 -r da21ff27331e more/repo.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/more/repo.sh Thu Nov 01 23:35:09 2012 -0500
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Populate a few source control directories. If they exist, they'll be used
+# instead of source tarballs. (Note: if you want to apply patches you'll have
+# to do it yourself, sources/patches only applies to tarballs.)
+
+mkdir -p packages &&
+if [ ! -d packages/busybox ]
+then
+ git clone git://busybox.net/busybox packages/busybox || exit 1
+else
+ (cd packages/busybox && git pull) || exit 1
+fi
+
+if [ ! -d packages/uClibc ]
+then
+ git clone git://uclibc.org/uClibc packages/uClibc
+else
+ (cd packages/uClibc && git pull) || exit 1
+fi
+
+if [ ! -d packages/linux ]
+then
+ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 \
+ packages/linux || exit 1
+else
+ (cd packages/linux && git pull) || exit 1
+fi
+
+if [ ! -d packages/toybox ]
+then
+ hg clone http://landley.net/hg/toybox packages/toybox || exit 1
+else
+ (cd packages/toybox && hg pull -u) || exit 1
+fi
diff -r c3b91b70cc42 -r da21ff27331e sources/download_functions.sh
--- a/sources/download_functions.sh Tue Oct 30 19:55:35 2012 -0500
+++ b/sources/download_functions.sh Thu Nov 01 23:35:09 2012 -0500
@@ -58,6 +58,8 @@
mkdir -p "$SRCTREE" || dienow
PACKAGE="$1"
+ ! is_in_list "PACKAGE" "$IGNORE_REPOS" && [ -d "$SRCDIR/$PACKAGE" ] &&
+ return 0
# Announce to the world that we're cracking open a new package
@@ -205,6 +207,8 @@
# Give package name, minus file's version number and archive extension.
BASENAME="$(noversion "$FILENAME")"
+ ! is_in_list "$BASENAME" "$IGNORE_REPOS" &&
+ [ -d "$SRCDIR/$BASENAME" ] && echo "Using $SRCDIR/$BASENAME" && return 0
# If environment variable specifies a preferred mirror, try that first.
diff -r c3b91b70cc42 -r da21ff27331e sources/functions.sh
--- a/sources/functions.sh Tue Oct 30 19:55:35 2012 -0500
+++ b/sources/functions.sh Thu Nov 01 23:35:09 2012 -0500
@@ -197,21 +197,28 @@
echo "Snapshot '$PACKAGE'..."
- if [ -z "$REUSE_CURSRC" ]
- then
- blank_workdir "$PACKAGE"
- CURSRC="$(pwd)"
- fi
+ SNAPFROM="$SRCDIR/$PACKAGE"
+ (is_in_list "$PACKAGE" "$IGNORE_REPOS" || [ ! -d "$SNAPFROM" ]) &&
+ SNAPFROM="$SRCTREE/$PACKAGE"
- [ -z "$SNAPSHOT_SYMLINK" ] && LINKTYPE="l" || LINKTYPE="s"
- cp -${LINKTYPE}fR "$SRCTREE/$PACKAGE/"* "$CURSRC"
-
- if [ $? -ne 0 ]
+ if [ ! -d "$SNAPFROM" ]
then
echo "$PACKAGE not found. Did you run download.sh?" >&2
dienow
fi
+ # Try hardlink, then symlink, then normal (noclobber) copy
+ for LINKTYPE in l s n
+ do
+ if [ -z "$REUSE_CURSRC" ]
+ then
+ blank_workdir "$PACKAGE"
+ CURSRC="$(pwd)"
+ fi
+
+ cp -${LINKTYPE}fR "$SNAPFROM/"* "$CURSRC" && break
+ done
+
cd "$CURSRC" || dienow
export WRAPPY_LOGPATH="$BUILD/logs/cmdlines.${ARCH_NAME}.${STAGE_NAME}.$1"
diff -r c3b91b70cc42 -r da21ff27331e www/FAQ.html
--- a/www/FAQ.html Tue Oct 30 19:55:35 2012 -0500
+++ b/www/FAQ.html Thu Nov 01 23:35:09 2012 -0500
@@ -28,6 +28,7 @@
Q: What's the package cache for?
Q: What are working copies for?
+Q: Can I use source code from repositories instead of tarballs?
Development questions
@@ -515,6 +516,20 @@
the source files and not the generated files, that's what the package
cache is for.
+
Q: Can I use source code from repositories instead of tarballs?
+
+Sure. Check them out into the packages directory with the name of the
+package you want. The more/repo.sh script provides an example for several
+packages.
+
+If a directory such as "packages/linux" exists, the build from that
+(instead of the package cache) for the appropriate package. Note that it
+will use this directory verbatim, if you want any of the patches from
+sources/patches you'll have to apply them yourself.
+
+When you'd like to build from vanilla tarballs again, either build with
+IGNORE_REPOS=all or delete the directory out of packages.
+
Q: What's a miniconfig?