Unable to copy the files to /system/app

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to copy the files to /system/app

Jump to solution
944 Views
Senior Contributor III

Dear NXP,

 

I am working on i.MX 6Quad SABRE-SD with Android 9. I am facing some problem when copy the some data to system/app from USB Mass Storage,

I got error, when I mount the system to write access,

sabresd_6dq:/ # mount -o remount,rw '/system'
EXT4-fs (dm-0): previous I/O error to superblock detected
Buffer I/O error on dev dm-0, logical block 0, lost sync page write
EXT4-fs (dm-0): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8

And also I got error when copy the some data to system/app from USB Mass Storage.

sabresd_6dq:/system/app # cp /mnt/media_rw/2A61-DD07/ota/update.zip  /system/app
EXT4-fs error (device dm-0): ext4_mb_generate_buddy:757: group 11, block bitmap and bg descriptor inconsistent: 32768 vs 0 free clusters
EXT4-fs (dm-0): previous I/O error to superblock detected
Buffer I/O error on dev dm-0, logical block 0, lost async page write
Buffer I/O error on dev dm-0, logical block 1, lost async page write
Buffer I/O error on dev dm-0, logical block 123, lost async page write
Buffer I/O error on dev dm-0, logical block 124, lost async page write
Buffer I/O error on dev dm-0, logical block 125, lost async page write
Buffer I/O error on dev dm-0, logical block 289, lost async page write
EXT4-fs warning: 79 callbacks suppressed
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 1052672 starting block 425984)
buffer_io_error: 14668 callbacks suppressed
Buffer I/O error on device dm-0, logical block 425984
Buffer I/O error on device dm-0, logical block 425985
Buffer I/O error on device dm-0, logical block 425986
Buffer I/O error on device dm-0, logical block 425987
Buffer I/O error on device dm-0, logical block 425988
Buffer I/O error on device dm-0, logical block 425989
Buffer I/O error on device dm-0, logical block 425990
Buffer I/O error on device dm-0, logical block 425991
Buffer I/O error on device dm-0, logical block 425992
Buffer I/O error on device dm-0, logical block 425993
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 2101248 starting block 426240)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 3149824 starting block 426496)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 4198400 starting block 426752)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 5246976 starting block 427008)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 6295552 starting block 427264)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 7344128 starting block 427520)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 0 size 8388608 starting block 427776)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 8388608 size 1052672 starting block 428032)
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 8388608 size 2101248 starting block 428288)
Buffer I/O error on dev dm-0, logical block 289, lost async page write
Buffer I/O error on dev dm-0, logical block 1, lost async page write
Buffer I/O error on dev dm-0, logical block 125, lost async page write
Buffer I/O error on dev dm-0, logical block 125, lost async page write
EXT4-fs warning: 98 callbacks suppressed
EXT4-fs warning (device dm-0): ext4_end_bio:323: I/O error 10 writing to inode 2390 (offset 113246208 size 1052672 starting block 119808)
buffer_io_error: 27638 callbacks suppressed
Buffer I/O error on device dm-0, logical block 119808

Thanks & Regards,

VinothS.

Regards,
Vinothkumar Sekar
Labels (2)
0 Kudos
1 Solution
300 Views
Senior Contributor III

Thank you CarlosCasillas,

This is the problem with some of the following parameters and I configured parameter to disable verity mode,

After Configuration,

androidboot.verifiedbootstate=orange

androidboot.vbmeta.device_state=unlocked

androidboot.veritymode=disabled

I able to copy the files to system app folder.

sabresd_6dq:/ # mount -o rw,remount /system
EXT4-fs (mmcblk3p4): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8

sabresd_6dq:/ # rm -rf system/app/VehicleData
sabresd_6dq:/ # cp -rf mnt/media_rw/B91D-0AB7/VehicleData/ /system/app/.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
10 Replies
300 Views
Senior Contributor III

I close this thread now, issue resolved by unlock the device

Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos
300 Views
NXP Employee
NXP Employee

Hi VinothS,

Could you please mention which specific BSP are you using?

Could you also specify what is the File System on which the USB stick is formatted?

Please also specify if Android is running from the eMMC or from a SD card.

Best regards!

/Carlos

0 Kudos
300 Views
Senior Contributor III

Hi CarlosCasillas‌,

1, Android run from eMMC.

2, USB formatted as FAT32

I don't know what is this sentence "Could you please mention which specific BSP are you using?"  mean.

Thanks & Regards,

VinothS.

Regards,
Vinothkumar Sekar
0 Kudos
300 Views
NXP Employee
NXP Employee

Hi VinothS,

It refers to which software image are you running on the board, from the available Board Support Packages (BSPs) of the following webpage:

i.MX Software | NXP 

 Best regards!

/Carlos

0 Kudos
300 Views
Senior Contributor III

BSP - Android P9.0.0_1.1.0 Patch (base on Linux L4.14.78_1.1.0 bsp).

Thanks & Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos
300 Views
NXP Employee
NXP Employee

Hi VinothS,

Trying on such BSP on a i.MX6Q SABRE board, copying files from the USB storage to the internal storage and vice versa, it works properly with the storage manager.

So, if you are trying to access to USB storage from a custom app, it would be recommended checking the apps permissions, and/or checking the implementation on such Android version (maybe, it causes error because it is already mounted by the storage manager).

Hope this will be useful for you.
Best regards!
/Carlos
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

-------------------------------------------------------------------------------

0 Kudos
300 Views
Senior Contributor III

Hi CarlosCasillas‌,

After unlock the device I able to copy the app file to system app folder. 

androidboot.vbmeta.device_state=unlocked

by using fastboot oem unlock command.

So, Is this right way to resolve this issue ?

Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
301 Views
Senior Contributor III

Thank you CarlosCasillas,

This is the problem with some of the following parameters and I configured parameter to disable verity mode,

After Configuration,

androidboot.verifiedbootstate=orange

androidboot.vbmeta.device_state=unlocked

androidboot.veritymode=disabled

I able to copy the files to system app folder.

sabresd_6dq:/ # mount -o rw,remount /system
EXT4-fs (mmcblk3p4): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8

sabresd_6dq:/ # rm -rf system/app/VehicleData
sabresd_6dq:/ # cp -rf mnt/media_rw/B91D-0AB7/VehicleData/ /system/app/.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
300 Views
Contributor I

Hi.
I am in a similar situation.
I modified the bootargs value as you told me.
However, if the "androidboot.veritymode = disabled" option is entered, the machine reboots and restarts.

I am testing with android_p9.0.0_2.2.0-ga demo image.

Is there any other way?

Freeing unused kernel memory: 1024K
init: init first stage started!
init: Using Android DT directory / proc / device-tree / firmware / android /
init: [libfs_mgr] fs_mgr_read_fstab_default (): failed to find device default fstab
init: [libfs_mgr] Returning avb_handle with status: 0
init: [libfs_mgr] Unknown androidboot.veritymode: disabled
init: [libfs_mgr] Failed to construct verity table.
init: Failed to setup verity for '/ system': Success
init: Failed to mount required partitions early ...
init: Reboot start, reason: reboot, rebootTarget: bootloader
init: Reboot ending, jumping to kernel
imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware
ci_hdrc ci_hdrc.1: remove, state 4
usb usb2: USB disconnect, device number 1
ci_hdrc ci_hdrc.1: USB bus 2 deregistered
ci_hdrc ci_hdrc.0: remove, state 1
usb usb1: USB disconnect, device number 1
usb 1-1: USB disconnect, device number 2
usb 1-1.4: USB disconnect, device number 3
ci_hdrc ci_hdrc.0: USB bus 1 deregistered
reboot: Restarting system with command 'bootloader'

0 Kudos
300 Views
Senior Contributor III

Hi,

Follow my steps,

-------------------------------------------------------------------------------    
remount the file system as write
-------------------------------------------------------------------------------

--------------------------------

Error

----------------------------------
sabresd_6dq:/ # mount -o remount,rw '/system'
EXT4-fs (dm-0): previous I/O error to superblock detected
Buffer I/O error on dev dm-0, logical block 0, lost sync page write
EXT4-fs (dm-0): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8

sabresd_6dq:/ # cat /proc/cmdline
console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0
consoleblank=0 androidboot.hardware=freescale cma=320M galcore.contiguousSize=33554432 loop.max_part=7 androidboot.selinux=permissive buildvariant=userdebug
androidboot.serialno=102519d4d81917c9 androidboot.btmacaddr=10:25:19:d4:d8:19 androidboot.soc_type=imx6q androidboot.storage_type=emmc
androidboot.boottime=1BLL:0,1BLE:1912,KL:0,KD:0,AVB:994,ODT:0,SW:0 androidboot.bootreason=cold,powerkey androidboot.verifiedbootstate=green
androidboot.slot_suffix= androidboot.vbmeta.device=PARTUUID=e6d02de1-556d-4bad-b465-1fc4b65e2416 androidboot.vbmeta.avb_version=1.1 androidboot.vbmeta.device_state=locked
androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=2944 androidboot.vbmeta.digest=57e82ca11300d0959cfcb2ac6b5f653e0770210e98d3039726c7297c73926385
androidboot.veritymode=enforcing androidboot.dtbo_idx=0 androidboot.keystore=software

-----------------------------------

Solutions:

----------------------------------

From Host,
    reboot bootloader

From Windows Power Shell,
    PS C:\platform-tools> ./fastboot.exe devices
    102519d4d81917c9        fastboot
    
PS C:\platform-tools> ./fastboot.exe oem unlock
    ...
    OKAY [ 53.794s]

Terminal,    
    finished. total time: 53.795s
    Fastboot: Got bootloader commands!
    flashing unlock.
    RNG already instantiated 0x40000003
    It is able to unlock device. 1
    RNG already instantiated 0x40000003
    Start userdata wipe process....
    erase target is MMC:2
    Erasing blocks 4939776 to 4947968 due to alignment
    ........ erased 4194304 bytes from 'misc'
    erase target is MMC:2
    Erasing blocks 3891200 to 4939776 due to alignment
    ........ erased 536870912 bytes from 'cache'
    Wipe userdata completed.

From Windows Power Shell,    
    PS C:\platform-tools> ./adb root
    PS C:\platform-tools> ./adb disable-verity
    Successfully disabled verity
    Now reboot your device for settings to take effect
    PS C:\platform-tools>
    
sabresd_6dq:/ # mount -o rw,remount /system
EXT4-fs (mmcblk3p4): re-mounted. Opts: block_validity,delalloc,barrier,user_xattr,acl,inode_readahead_blks=8

sabresd_6dq:/ # rm -rf system/app/VD
sabresd_6dq:/ # cp -rf mnt/media_rw/B91D-0AB7/VD/ /system/app/.

sabresd_6dq:/ # cat /proc/cmdline
console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0
consoleblank=0 androidboot.hardware=freescale cma=320M galcore.contiguousSize=33554432 loop.max_part=7 androidboot.selinux=permissive buildvariant=userdebug
androidboot.serialno=102519d4d81917c9 androidboot.btmacaddr=10:25:19:d4:d8:19 androidboot.soc_type=imx6q androidboot.storage_type=emmc
androidboot.boottime=1BLL:0,1BLE:3294,KL:0,KD:0,AVB:2296,ODT:0,SW:0 androidboot.bootreason=cold,powerkey androidboot.verifiedbootstate=orange
androidboot.slot_suffix= androidboot.vbmeta.device=PARTUUID=e6d02de1-556d-4bad-b465-1fc4b65e2416 androidboot.vbmeta.avb_version=1.1 androidboot.vbmeta.device_state=unlocked
androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=2944 androidboot.vbmeta.digest=53b72192a85753db0b1cc21a79a170fa3298d8c600c2d85f8434eff01185de1d
androidboot.veritymode=disabled androidboot.dtbo_idx=0 androidboot.keystore=software

---------------------------------------------------------------------------------------------------------------------------------------

VInoth S,

Regards,
Vinothkumar Sekar
0 Kudos