#!/bin/sh
# version 0.7

. 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" $ROOTFS

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

# copy and symlink libs
mkdir -p $ROOTFS/lib
cp -dp $STATIC/lib/libgcc_s*so* $ROOTFS/lib
ldconfig -n				"$ROOTFS/lib"
link_samename		/lib		"$ROOTFS/lib/*.a"
link_samename		/lib		"$ROOTFS/lib/*.so*"
link_samename		/lib		"$ROOTFS/lib/*.la"
