Can't mount Android system.img in Mac - android-source

I downloaded the AOSP source code, and successfully make the build. Now with the new built system.img file, I want to mount it and take a look inside. However I am not be able to mount it. I am working on the MacOS, and the command I used was:
$ file system.img
system.img: Linux rev 1.0 ext4 filesystem data, UUID=b250775f-0c87-4e48-b8ed-c0443f127ee9 (extents) (large files) (huge files)
$ mount -o loop -t ext4 system.img /mnt
mount: exec /Library/Filesystems/ext4.fs/Contents/Resources/mount_ext4 for /mnt: No such file or directory
How can I solve this issue?

Here are the steps that worked for me
Install the required dependencies
brew install simg2img
brew install osxfuse
brew install ext4fuse
I did a reboot at this stage as it was recommended here
Convert the system.img into a raw img
simg2img system.img system_raw.img
mount the image
mkdir mountpoint
ext4fuse system_raw.img mountpoint
At this point you can also browse the img as a folder in Mac Finder
References
https://solumachines.wordpress.com/2015/08/15/mounting-an-android-system-img-on-mac-os-x/
https://github.com/anestisb/android-simg2img
https://medium.com/#chmodxx/extracting-android-factory-images-on-macos-cc61e45139d1

You can use extfstools to extract the Android system.img on macOS and Linux. You don't need root privileges or mount anything.
The original version is at https://github.com/petib/extfstools and it was written for macOS. It doesn't support symlinks.
I have a fork of extfstools at https://github.com/qmfrederik/extfstools which does support symlinks, but was tested on Linux only.

Related

libxkbcommon.so.0: no version information available after installing VSCode update

I am using Ubuntu 14.04 LTS. After updating VSCode to v.1.53.0 I am getting following message on opening VSCode:
/usr/share/code/bin/../code: /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0: no version information available (required by /usr/share/code/bin/../code)
On giving command code --verbose I get following logs: logs
I cannot update current Ubuntu version due to limited admin rights.
If you run code --verbose you will see real problem:
[main 2021-04-16T11:44:45.671Z] Main->SharedProcess#connect
/usr/share/code/code --verbose --no-sandbox: relocation error: /usr/share/code/resources/app/node_modules.asar.unpacked/spdlog/build/Release/spdlog.node: symbol _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
It can't find symbol basic_string::compare
echo _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc | demangle
So to run visual studio code on Ubuntu 14.04 LTS
You just need to copy libstdc++.so.6.0.28 and libstdc++.so.6
to /usr/share/code from ubuntu 20.04 LTS
You can get libstdc++.so.6.0.28 (md5=0e7d34a60136c0cd150917ed099980f2) for example from this deb file
Here simple script to do it for you
#!/bin/sh
wget https://mirrors.wikimedia.org/ubuntu/ubuntu/pool/main/g/gcc-10/libstdc%2B%2B6_10.2.0-5ubuntu1~20.04_amd64.deb
dpkg-deb -R libstdc++6_10.2.0-5ubuntu1~20.04_amd64.deb .
sudo cp -P usr/lib/x86_64-linux-gnu/* /usr/share/code/
file version changed in wikimedia.org so new script:
#!/bin/sh
wget https://mirrors.wikimedia.org/ubuntu/ubuntu/pool/main/g/gcc-10/libstdc%2B%2B6_10.3.0-1ubuntu1~20.04_amd64.deb --no-check-certificate
dpkg-deb -R libstdc++6_10.3.0-1ubuntu1~20.04_amd64.deb .
sudo cp -P usr/lib/x86_64-linux-gnu/* /usr/share/code/
md5sum of new libstdc++.so.6.0.28 604ec2999aeb3aadd0e96103fd4b5e5d
Then just type code
ps: very good font for vscode JetBrains Mono
I downgraded my VSCode to lower version. Apparently you can access previous versions of VSCode from it's website but the link's font was too big form me to see.
Still if someone does come across any other alternative please share.
Leaving this here for others.

Raspbian Jessie: Cannot mount NTFS external harddrive anymore after 'apt-get upgrade' (fuse device is missing)

After I used apt-get upgrade earlier today, my Raspberry Pi (Raspbian Jessie) stopped being able to automount my external harddrives anymore. Automounting worked perfectly fine before apt-get upgrade, but now I can't even manually mount my external HDDs anymore.
This is the error message I received:
pi#raspberrypi:~ $ sudo mount /dev/sda1 /mnt
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
'modprobe fuse' gives me the same error message:
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
I reinstalled the kernel and bootloader using this command:
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
But this did not help.
From reading other forum posts, it may look like my kernel and fuse might not be compatible - but how would that have happened? I feel I'm a bit out of my depth here.
Some forum posts suggested a restart will help, but this didn't solve the issue for me.
Alternatively, I also found a post from drownboat on Reddit from two years ago that looks promising - but to be honest, I have no idea if this is just another red herring or if this is indeed the problem I'm facing. In any case, I'm not sure what exactly/how drownboat did it:
I suspect that what is happening is that updates to the kernel and
grub config are being written to the /boot folder, but not onto the
boot device. This has caused the modules and the kernel to go out of
sync. [...]
I fixed it by adding /boot back to /etc/fstab, rebooting to another kernel where the modules were still working, thus mounting /boot, and finally reinstalling apt-get install --reinstall linux-image-3.16.0-4-amd64.
I would greatly appreciate any help!
Some more info:
uname -a
Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016
armv7l GNU/Linux
dpkg -s fuse
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 103
Maintainer: Laszlo Boszormenyi (GCS)
Architecture: armhf
Version: 2.9.3-15+deb8u2
Depends: libc6 (>= 2.4), libfuse2 (= 2.9.3-15+deb8u2), adduser, mount (>= 2.19.1), sed (>= 4), udev | makedev
Conffiles:
/etc/fuse.conf 298587592c8444196833f317def414f2
Description: Filesystem in Userspace
Filesystem in Userspace (FUSE) is a simple interface for userspace programs to
export a virtual filesystem to the Linux kernel. It also aims to provide a
secure method for non privileged users to create and mount their own filesystem
implementations.
Homepage: http://fuse.sourceforge.net/
I FOUND THE SOLUTION (see further below for details)! It turned out that the boot partition was not mounted and the operating system reverted to the old kernel before the apt-get upgrade. So I just had to make sure that /boot was automounted at startup so the correct kernel was used.
Further steps in my error analysis ():
OK so I managed to fix the issue myself. It really just turned out that the /boot partition was not mounted and thus my Raspberry Pi reverted to the old kernel instead of the fancy new one that came with apt-get upgrade.
I found the problem by using uname -r, which gave me '4.9.35-v7+' as an answer. This was strange because the original error message had a different version number:
modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could
not open moddep file '/lib/modules/4.4.26-v7+/modules.dep.bin'
(My emphasis)
When I navigated to /lib/modules using cd /lib/modules I also saw this:
pi#raspberrypi:/lib/modules $ ls
4.9.35+ 4.9.35-v7+
So the error message about a fuse device missing really seemed to have something to do with a mismatch of kernel and fuse versions. The discrepancy between version numbers led me to believe that the wrong kernel was being used (like drownboat also stated in their Reddit post two years ago).
This is how I fixed the problem (SOLUTION):
sudo nano /etc/fstab/
Then I added the following lines to fstab:
# automount /boot partition at startup
/dev/mmcblk0p6 /boot vfat defaults 0 2
After rebooting, I used sudo raspi-config to check if the boot partition was mounted properly (raspi-config will only let you enter its menu if the partition is mounted, otherwise it will tell you that you need to mount the boot partition first).
Then I ran sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel again to doubly ensure that the latest kernel was installed on the boot partition too - but I don't know if this was a crucial step.
Finally, after another restart, I was able to mount/automount my external harddrives again.
Hope this helps anyone else out there having the same issue as me! :)
In my situation, the solution is pretty simple.
I run apt update and apt upgrade -y and then apt install ntfs-3g, after these, I try to mount the disk and met this error.
The solution is just reboot
After reboot, try to mount again, and thing worked well.
I had the same issue trying to get Open Media Vault working. There were missing or unmatched kernel files, outdated libraries etc. I ran the updates in the link below and got it working.
Update system's package list
sudo apt-get update
upgrade all installed packages to their latest versions:
sudo apt-get dist-upgrade
https://www.raspberrypi.org/documentation/raspbian/updating.md
I had this problem trying to mount a FAT32 USB on Buster Lite with
pmount /dev/disk/by-label/<my-usb-label>
The messages implied the system was trying to mount an ntfs device. 'NTFS signature missing' etc.
Before trying anything clever, I tried #Kenneth's suggestion of a reboot. It fixed the problem.
Worrying to see Linux behaving like Windows 8-{
Crash after kernel upgrading
apt-get update & dist-upgrade
impossible to mount ntfs usb disk
modprobe: FATAL: Module fuse not found in directory /lib/modules/5.15.87-v7+
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
Thanks a lot for this workaround :
sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

CMake install directory permission

I have built a project using cmake (LLVM project) and tried to install it by issuing the following command:
$ cmake3 --build . --target install
If I run it using root then there is no problem and the files will be installed under the directory /usr/local/.
My problem is when I want to install the project using normal user.
I get the following error:
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot set permissions on "/usr/local/include/llvm"
I have changed the permission of directory /usr/local/ to 777 recursively, and their ownership to root:wheel and I added my normal user to group wheel. But I still cannot install the files into the /usr/local/ directory.
The main issue is about building project in Eclipse which fails at "Build Install" command.
chmod 777 -R / is a very scary command. I've destroyed a system once by doing that.
The philosophy I use for this is:
If I need to deploy something through my IDE to debug or test before packaging, I deploy it locally within my home directory.
I only install stuff to my system (outside of home) if it has been packaged first (*.deb, *.rpm, *.tar.gz) so that I can remove it without problems.
For me, I do this with:
cmake $src
cmake --build . --target install -- DESTDIR=stage
This will configure my project, make it, then install it locally in a folder called ./stage which resides in my build directory. I can then run my executable from ./stage/usr/bin. Note that this only works if make is your generator.
Once I've tested it and I'm happy, I package it and deploy to my system or upload to a repository:
cpack
sudo dpkg -i <package>.deb
We should use USE_SOURCE_PERMISSIONS in our install function.
Example:
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" USE_SOURCE_PERMISSIONS)

MongoDB SpiderMonkey doesn't understand UTF-8

If I add non-ASCII characters to MongoDB database then all db.find() fail telling "non ascii character detected".
It's problem of SpiderMonkey, I have to rebuild it with UTF-8 support.
I've tried to do it like in
http://www.mongodb.org/display/DOCS/Building+Spider+Monkey
but it doesn't work (SpiderMonkey is not installed after I've completed all steps).
I've got Ubuntu 11.04. Does anybody have instruction how to make it work there?
Working instruction how to make work MongoDB with Google V8 can also help.
I'm using MongoDB on Ubuntu Server 11.04, installed it after making fresh OS install using this instruction: http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
Everything is working fine out of the box. Is it critical for you to build MongoDB from scratch?
Using the 10gen-published packages works fine, but if you actually want to compile SpiderMonkey from source with UFT-8 support:
curl -O ftp://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
tar xvzf js185-1.0.0.tar.gz
cd js-1.8.5/js/src
export CFLAGS="-DJS_C_STRINGS_ARE_UTF8"
export CXXFLAGS="-DJS_C_STRINGS_ARE_UTF8"
And then follow the instructions from https://developer.mozilla.org/En/SpiderMonkey/Build_Documentation
autoconf-2.13
./configure
make
make install
cp js /usr/local/bin/
This will install into /usr/local/lib, however the mongodb package looks for it in /usr/lib (where the spidermonkey package is installed). So, we link all files installed to /usr/local /lib from /usr/lib
ln -s /usr/local/lib/libmozjs185.so /usr/lib/libmozjs185.so
ln -s /usr/local/lib/libmozjs185.so.1.0 /usr/lib/libmozjs185.so.1.0
ln -s /usr/local/lib/libmozjs185.so.1.0.0 /usr/lib/libmozjs185.so.1.0.0
ln -s /usr/local/lib/libmozjs185-1.0.a /usr/lib/libmozjs185-1.0.a
Of course you could just move them into /usr/lib instead of symlinking, but I wanted to keep the utf-enabled libs away from the default location, to prevent conflicts with the default spidermonkey package. Without the libmozjs package installed, apt complains that dependencies for mongodb are not satisfied, so I've left it installed.
Keep in mind that if the spidermonkey package gets upgraded, it can overwrite the symlinks to our new libs (or the libs themselves if you've moved them to /usr/local/lib). The ideal solution would be to build your own package to solve dependency issues for good.

Mac OS .deb packaging trouble

I've searched a lot, but didn't find the solution.
I need to package my ios app into .deb.
I have installed Mac Ports and dpkg, I have control file in DEBIAN folder in MyApp folder
I run /opt/local/bin/dpkg-deb -b MyApp and get error.
dpkg-deb: ignoring 3 warnings about the control file(s)
Can't use format gnu: No such format 'gnu': Invalid argument
There is another topic: How to create .deb packages on Mac OS X, but no answer to this question.
I assume you are using a tar implementation that does not support the GNU tar fotrmat, which dpkg-deb expects for its usage.
You should install GNU tar and either recompile dpkg to use that (usually named gtar) instead of simply the executable tar, or prepare a PATH environment to prefer the GNU tar when using dpkg-deb.
Newer dpkg versions detect this requirement at build time and will abort the build, to make sure this does not happen.