Android: adb: copy file to /system (Permission

2019-02-03 10:25发布

actually I try to install busybox on my HTC Desire. Therefore I try to copy a busybox-binary to /system/bin. So I remounted /system with rw:

mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system

After this I didn't get a "Read-only file system"-error. But now I'm experiencing "Permission denied" when trying to push the file to /system/bin. I also tried pushing my file to /sdcard and then move this to /system/bin, but this doesn't work either:

$ mv /sdcard/busybox /system/bin
failed on '/sdcard/busybox' - Cross-device link

Some ideas, how to solve this problem?

5条回答
家丑人穷心不美
2楼-- · 2019-02-03 11:04

Not sure but since you asked for ideas I'll mention that I never specified the -t option.

mount -o remount,rw /system

always worked for me

查看更多
ゆ 、 Hurt°
3楼-- · 2019-02-03 11:13

Mounting is not enough, you have to run as root (this is the reason for permission denied). This is how I push busybox:

adb root
adb remount
adb push busybox /system/bin

I run into some devices that you need to remount with mount -o remount,rw /system and not with adb remount.

查看更多
Juvenile、少年°
4楼-- · 2019-02-03 11:21

Do a mount to check if the device really was remounted as RW.

The same error happened to me, then I simply made a cp orig dest and then a rm on orig, weird but seams mv behaves this way.

查看更多
\"骚年 ilove
5楼-- · 2019-02-03 11:21

If some command is not working, try putting busybox in front of it. (if installed)

f.ex.

root@android:/ # mv /sdcard/androidLTheme/bootanim/bootanimation.zip /system/media/
failed on '/sdcard/androidLTheme/bootanim/bootanimation.zip' - Cross-device link
root@android:/ # _

but

root@android:/ # busybox mv /sdcard/androidLTheme/bootanim/bootanimation.zip /system/media/
root@android:/ # _
查看更多
冷血范
6楼-- · 2019-02-03 11:26

mv just moves a hardlink within a single filesystem. If you want to move files between two filesystems you need to copy and then delete the original. e.g.

if ( cp -R /sdcard/busybox /system/bin ); then
rm -fR /sdcard/busybox
fi
查看更多
登录 后发表回答