Mercurial > hg > aboriginal
view more/chroot-splice.sh @ 1522:95a720e694a6
Switch x86_64 from nptl back to pthreads. This isn't the correct fix but uClibc apparently never tested nptl on x86-64, and one of the assembly files doesn't support PIC.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 10 May 2012 22:03:22 -0500 |
parents | bb26de4dfe47 |
children | 90da269bc09c |
line wrap: on
line source
#!/bin/bash # Combine a root filesystem directory and a control image into an $ARCH-specific # chroot containing native build control files, suitable for chrooting into. if [ $# -ne 2 ] then echo "usage: $0 "'$ARCH $CONTROL_IMAGE' >&2 exit 1 fi # Make sure prerequisites exist for i in "build/root-filesystem-$1" "$2" do if [ ! -e "$i" ] then echo "No $i" >&2 exit 1 fi done if [ `id -u` -ne 0 ] then echo "Not root">&2 exit 1 fi # Zap old stuff (if any) CHROOT="build/chroot-$1" trap 'more/zapchroot.sh "$CHROOT"' EXIT if [ -e "$CHROOT" ] then more/zapchroot.sh "$CHROOT" || exit 1 else # Copy root filesystem and splice in control image cp -la "build/root-filesystem-$1" "$CHROOT" || exit 1 fi # Copy root filesystem and splice in control image cp -la "build/root-filesystem-$1" "$CHROOT" || exit 1 if [ -d "$2" ] then rm -rf "$CHROOT/mnt" && cp -la "$2" "$CHROOT/mnt" || exit 1 else mount -o loop "$2" "$CHROOT/mnt" || exit 1 fi # Tar it up # Output some usage hints CPUS=1 HOST="$1" chroot "$CHROOT" /sbin/init.sh