view root-filesystem.sh @ 1367:ec3435d0cbfe

Add alt-linux patch symlinks so building unstable linux snapshots is more likely to work.
author Rob Landley <rob@landley.net>
date Fri, 10 Jun 2011 21:07:18 -0500
parents c7dfe0e54a80
children b74d36876c0a
line wrap: on
line source

#!/bin/bash

# Combine the output of simple-root-filesystem and native-compiler.

. sources/include.sh || exit 1

read_arch_dir "$1"

[ ! -d "$BUILD/simple-root-filesystem-$ARCH" ] &&
  echo "No $BUILD/simple-root-filesystem-$ARCH" >&2 &&
  exit 1

[ ! -d "$BUILD/native-compiler-$ARCH" ] &&
  echo "No $BUILD/native-compiler-$ARCH" >&2 &&
  exit 1

cp -al "$BUILD/simple-root-filesystem-$ARCH/." "$STAGE_DIR" || dienow

# Remove shared libraries copied from cross compiler, and let /bin/sh point
# to bash out of native compiler instead of busybox shell.

rm -rf "$BUILD/root-filesystem-$ARCH/"{usr/lib,bin/sh} 2>/dev/null

# Copy native compiler, but do not overwrite existing files (which could
# do bad things to busybox).

[ -z "$ROOT_NODIRS" ] && USRDIR="/usr" || USRDIR=""
yes 'n' | cp -ial "$BUILD/native-compiler-$ARCH/." \
  "$BUILD/root-filesystem-$ARCH$USRDIR" 2>/dev/null || dienow

# Strip everything again, just to be sure.

if [ -z "$SKIP_STRIP" ]
then
  "${ARCH}-strip" --strip-unneeded "$STAGE_DIR"/lib/*.so
  "${ARCH}-strip" "$STAGE_DIR"/{bin/*,sbin/*}
fi

create_stage_tarball