Update 3 Fing the image already unpacked. So to add the required file, I have mount the image as sudo mount -o loop system.img system_mount
and then tried to copy the contents to another folder with cp system_mount/* system/
so that I can add the required file and make new image out of it but I got following errors:
root@OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea# mkdir system && cp system_mount/* system/
cp: omitting directory 'system_mount/acct'
cp: cannot stat 'system_mount/bin': No such file or directory
cp: cannot stat 'system_mount/bt_firmware': No such file or directory
cp: cannot stat 'system_mount/bugreports': No such file or directory
cp: cannot stat 'system_mount/cache': No such file or directory
cp: cannot stat 'system_mount/charger': No such file or directory
cp: cannot stat 'system_mount/charger_log': No such file or directory
cp: omitting directory 'system_mount/config'
cp: omitting directory 'system_mount/d'
cp: omitting directory 'system_mount/data'
cp: omitting directory 'system_mount/dev'
cp: cannot stat 'system_mount/dsp': No such file or directory
cp: cannot stat 'system_mount/etc': No such file or directory
cp: cannot stat 'system_mount/firmware': No such file or directory
cp: omitting directory 'system_mount/lost+found'
cp: omitting directory 'system_mount/mnt'
cp: omitting directory 'system_mount/odm'
cp: omitting directory 'system_mount/oem'
cp: omitting directory 'system_mount/op1'
cp: omitting directory 'system_mount/op2'
cp: cannot stat 'system_mount/persist': No such file or directory
cp: omitting directory 'system_mount/postinstall'
cp: omitting directory 'system_mount/proc'
cp: cannot stat 'system_mount/product': No such file or directory
cp: omitting directory 'system_mount/res'
cp: omitting directory 'system_mount/sbin'
cp: cannot stat 'system_mount/sdcard': No such file or directory
cp: omitting directory 'system_mount/storage'
cp: omitting directory 'system_mount/sys'
cp: omitting directory 'system_mount/system'
cp: omitting directory 'system_mount/vendor'
root@OMEN-by-HP-Laptop-15-dc0xxx:~/WorkArea#