#!/bin/sh
# version 0.A

. ./installink.sh

. ./!vda_ver

ROOTFS=/app/$NAME$VER
STATIC=/usr/app/$NAME$VER

echo "*** Installing root fs files (stuff needed at early boot)"
echo
echo "This will install symlinks to ROOT FS $NAME$VER files"
echo "Note: this will crush any existing file in the way!"
echo -n "Press <Enter> to continue or Ctrl-C to exit: "; read junk

mkdir -p $ROOTFS

# copy install scripts to root fs
cp -dp "$0" "./!vda_ver" installink.sh $ROOTFS

# copy and symlink binaries
#cp -dpR 		$STATIC/rootfs/bin	$ROOTFS
#link_samename_strip	/bin			"$ROOTFS/bin/*"
cp -dpR			$STATIC/rootfs/sbin	$ROOTFS
link_samename_strip	/sbin			"$ROOTFS/sbin/*"

# copy and symlink libs
mkdir -p $ROOTFS/lib
cp -dpR 		$STATIC/rootfs/lib	$ROOTFS
ldconfig -n					"$ROOTFS/lib"
link_samename		/lib			"$ROOTFS/lib/*.so*"
