Skip to content

Commit

Permalink
Merge "properly handle /tmp symlink from moto gb init.rc" into ginger…
Browse files Browse the repository at this point in the history
…bread
  • Loading branch information
tpruvot authored and Gerrit Code Review committed May 16, 2012
2 parents d37de5b + aa92304 commit da24216
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
17 changes: 5 additions & 12 deletions bootmenu/script/2nd-boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,11 @@ killall ueventd
ADBD_RUNNING=`ps | grep adbd | grep -v grep`
if [ -z "$ADB_RUNNING" ]; then
rm -f /tmp/usbd_current_state
#delete if is a symlink
[ -L "/tmp" ] && rm -f /tmp
mkdir -p /tmp
else
# well, not beautiful but do the work
# to keep current usbd state (if present)
if [ -L "/tmp" ]; then
mv /tmp/usbd_current_state / 2>/dev/null
rm -f /tmp
mkdir -p /tmp
mv /usbd_current_state /tmp/ 2>/dev/null
fi
fi

# original /tmp data symlink
if [ -L /tmp.bak ]; then
rm /tmp.bak
fi

if [ -L /sdcard-ext ]; then
Expand Down
17 changes: 5 additions & 12 deletions bootmenu/script/2nd-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@ killall ueventd
ADBD_RUNNING=`ps | grep adbd | grep -v grep`
if [ -z "$ADB_RUNNING" ]; then
rm -f /tmp/usbd_current_state
#delete if is a symlink
[ -L "/tmp" ] && rm -f /tmp
mkdir -p /tmp
else
# well, not beautiful but do the work
# to keep current usbd state
if [ -L "/tmp" ]; then
mv /tmp/usbd_current_state / 2>/dev/null
rm -f /tmp
mkdir -p /tmp
mv /usbd_current_state /tmp/ 2>/dev/null
fi
fi

# original /tmp data symlink
if [ -L /tmp.bak ]; then
rm /tmp.bak
fi

if [ -L /sdcard-ext ]; then
Expand Down
6 changes: 6 additions & 0 deletions bootmenu/script/pre_bootmenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ if [ -x $BM_ROOTDIR/script/overclock.sh ]; then
$BM_ROOTDIR/script/overclock.sh safe
fi

# must be restored in stock.sh
if [ -L /tmp ]; then
mv /tmp /tmp.bak
mkdir /tmp && busybox mount -t ramfs ramfs /tmp
fi

exit 0
14 changes: 10 additions & 4 deletions bootmenu/script/stock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ export PATH=/sbin:/system/xbin:/system/bin

######## Main Script

mount -o remount,rw /
cp -f /system/bootmenu/binary/adbd /sbin/adbd
chmod 4755 /sbin/adbd
chown root.system /sbin/adbd
busybox mount -o remount,rw /
busybox cp -f /system/bootmenu/binary/adbd /sbin/adbd
busybox chmod 4755 /sbin/adbd
busybox chown root.system /sbin/adbd

# restore original /tmp data symlink
if [ -L /tmp.bak ]; then
busybox umount /tmp
busybox mv /tmp.bak /tmp
fi

######## Cleanup

Expand Down

0 comments on commit da24216

Please sign in to comment.