target/realtek: fix upgrade hang

(cherry picked from commit fc2db101bcf238dc2faad6ed5a24ffbbeb5921fc)
This commit is contained in:
jjm2473 2021-12-17 14:13:18 +08:00
parent b8b067b59a
commit 07bc9014fc
3 changed files with 16 additions and 10 deletions

View File

@ -115,8 +115,8 @@ killall -9 ash
kill_remaining TERM
sleep 3
sync
/usr/bin/umount -R -d /mnt
/usr/bin/umount -R -d /overlay
/usr/bin/umount -R -d /mnt &
sleep 5
kill_remaining KILL 1
sleep 1
@ -135,7 +135,7 @@ fi
grep /overlay /proc/mounts > /dev/null && {
/bin/mount -o noatime,remount,ro /overlay
/bin/umount -l /overlay
/usr/bin/umount -R -d -l /overlay || /bin/umount -l /overlay
}
# Exec new shell from ramfs

View File

@ -5,21 +5,27 @@ START=14
split_opkg_status() {
local line
local of=/dev/null
local gap=1
exec 3>/dev/null
rm -rf $2
mkdir -p $2
cat $1 | while read; do
line="$REPLY"
if [ -z "$line" ]; then
echo >>$of
of=/dev/null
echo >&3
exec 3>&-
exec 3>/dev/null
gap=1
else
if [ "x/dev/null" = "x$of" ] && echo "$line" | grep -q "^Package: "; then
of=$2/`echo "$line"|cut -d' ' -f2`
if [ "x1" = "x$gap" ] && echo "$line" | grep -q "^Package: "; then
exec 3>&-
exec 3>$2/`echo "$line"|cut -d' ' -f2`
gap=0
fi
echo "$line" >>$of
echo "$line" >&3
fi
done
exec 3>&-
}
split_both_status() {

View File

@ -1,7 +1,7 @@
# bins for install_a
RAMFS_COPY_BIN="/usr/bin/cat /usr/bin/chmod /usr/bin/cp /usr/bin/dd \
/usr/bin/echo /usr/bin/mkdir /usr/bin/rm"
/usr/bin/echo /usr/bin/mkdir /usr/bin/rm /usr/bin/umount"
platform_check_image() {
echo "platform_check_image"