#!/sbin/sh
OUTFD=$2
ZIP=$3
MISC=/tmp/misc
SOURCE_P=$MISC/system/priv-app
DEST_P=/system/priv-app
mkdir $MISC
mkdir $SOURCE_P
if readlink /proc/$$/fd/"$OUTFD" 2>/dev/null | grep -q "/tmp" ; then
# rerouted to log file, we don't want our ui_print commands going there
OUTFD=0
# we are probably running in embedded mode, see if we can find the right fd
# we know the fd is a pipe and that the parent updater may have been started as
# 'update-binary 3 fd zipfile'
for FD in /proc/$$/fd/*; do