# HG changeset patch # User Rob Landley # Date 1210374184 18000 # Node ID 391ea980fffdb48b425c24fa8168e6ca5d27250e # Parent 51bcd6de223d6f7b1365487fd9d11a2dae0aefed Redo sources/native to be "cp -ar"'d into mini-native-$ARCH/tools verbatim. diff -r 51bcd6de223d -r 391ea980fffd mini-native.sh --- a/mini-native.sh Sat May 03 15:29:58 2008 -0500 +++ b/mini-native.sh Fri May 09 18:03:04 2008 -0500 @@ -184,9 +184,9 @@ fi -# Setup script. (Assumes qemu, but should work elsewhere.) +# Copy qemu setup script and so on. -cp "${SOURCES}/native/setup.sh" "${TOOLS}/bin/qemu-setup.sh" || dienow +cp -r "${SOURCES}/native/." "${TOOLS}/" || dienow # Clean up and package the result diff -r 51bcd6de223d -r 391ea980fffd sources/native/bin/qemu-setup.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/native/bin/qemu-setup.sh Fri May 09 18:03:04 2008 -0500 @@ -0,0 +1,40 @@ +#!/tools/bin/bash + +# This builds + +# Create some temporary directories at the root level +mkdir -p /{proc,sys,etc,tmp} +[ ! -e /bin ] && ln -s /tools/bin /bin +[ ! -e /lib ] && ln -s /tools/lib /lib + +# Populate /dev +mount -t sysfs /sys /sys +mount -t tmpfs /dev /dev +mdev -s + +# Setup network for QEMU +mount -t proc /proc /proc +echo "nameserver 10.0.2.3" > /etc/resolv.conf +ifconfig eth0 10.0.2.15 +route add default gw 10.0.2.2 + +# If we have no local clock, you can do this instead: +#rdate time-b.nist.gov + +# If there's a /dev/hdb or /dev/sdb, mount it on home + +[ -b /dev/hdb ] && HOMEDEV=/dev/hdb +[ -b /dev/sdb ] && HOMEDEV=/dev/hdb +if [ ! -z "$HOMEDEV" ] +then + mkdir -p /home + mount $HOMEDEV /home + export HOME=/home +fi + +exec /tools/bin/busybox ash + +#wget http://landley.net/hg/firmware/archive/tip.tar.gz +#tar xvzf tip.tar.gz +#cd firmware-* +#./build.sh $ARCH diff -r 51bcd6de223d -r 391ea980fffd sources/native/setup.sh --- a/sources/native/setup.sh Sat May 03 15:29:58 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -#!/tools/bin/bash - -# This builds - -# Create some temporary directories at the root level -mkdir -p /{proc,sys,etc,tmp} -[ ! -e /bin ] && ln -s /tools/bin /bin -[ ! -e /lib ] && ln -s /tools/lib /lib - -# Populate /dev -mount -t sysfs /sys /sys -mount -t tmpfs /dev /dev -mdev -s - -# Setup network for QEMU -mount -t proc /proc /proc -echo "nameserver 10.0.2.3" > /etc/resolv.conf -ifconfig eth0 10.0.2.15 -route add default gw 10.0.2.2 - -# If we have no local clock, you can do this instead: -#rdate time-b.nist.gov - -# If there's a /dev/hdb or /dev/sdb, mount it on home - -[ -b /dev/hdb ] && HOMEDEV=/dev/hdb -[ -b /dev/sdb ] && HOMEDEV=/dev/hdb -if [ ! -z "$HOMEDEV" ] -then - mkdir -p /home - mount $HOMEDEV /home - export HOME=/home -fi - -exec /tools/bin/busybox ash - -#wget http://landley.net/hg/firmware/archive/tip.tar.gz -#tar xvzf tip.tar.gz -#cd firmware-* -#./build.sh $ARCH diff -r 51bcd6de223d -r 391ea980fffd sources/native/src/thread-hello.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sources/native/src/thread-hello.c Fri May 09 18:03:04 2008 -0500 @@ -0,0 +1,15 @@ +#define __REENTRANT +#include +#include + +void *threadhello(void *unused) +{ + printf("Hello, world!\n"); + return 0; +} + +int main() { + pthread_t thready; + pthread_create(&thready, NULL, &threadhello, NULL); + usleep(10); +} diff -r 51bcd6de223d -r 391ea980fffd sources/toys/thread-hello.c --- a/sources/toys/thread-hello.c Sat May 03 15:29:58 2008 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -#define __REENTRANT -#include -#include - -void *threadhello(void *unused) -{ - printf("Hello, world!\n"); - return 0; -} - -int main() { - pthread_t thready; - pthread_create(&thready, NULL, &threadhello, NULL); - usleep(10); -}