#!/bin/sh
+warn() {
+ echo $* 1>&2
+}
+
die() {
echo $* 1>&2
exit 1
fi
if [ $(id -u) -eq 0 ]; then
- if [ -f $rootdir/sbin/ldconfig ]; then
+ if [ ! -d $rootdir/etc ]; then
+ warn "no etc directory in $rootdir, skipping ldconfig"
+ elif [ -f $rootdir/sbin/ldconfig ]; then
$rootdir/sbin/ldconfig -r ${rootdir:-/}
elif [ -f /sbin/ldconfig ]; then
/sbin/ldconfig -r ${rootdir:-/}