Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS missing partition entries #53

Closed
anestisb opened this issue Jan 4, 2017 · 3 comments
Closed

macOS missing partition entries #53

anestisb opened this issue Jan 4, 2017 · 3 comments

Comments

@anestisb
Copy link
Owner

anestisb commented Jan 4, 2017

It appears that fuse-ext2 (or OSXFUSE) has a bug when running in latest macOS sierra resulting into missing entries when mounting raw images generated from simg2img.

 diff -u mac_mtc20k.txt linux_mtc20k.txt
--- mac_mtc20k.txt	2017-01-04 20:37:16.000000000 +0200
+++ linux_mtc20k.txt	2017-01-04 20:37:24.000000000 +0200
@@ -3,7 +3,13 @@
 bullhead/mtc20k/factory_imgs_data/system/app/Bluetooth/Bluetooth.apk:9260d0fb26c50ffb3da6e4069cc0e076
 bullhead/mtc20k/factory_imgs_data/system/app/Bluetooth/oat/arm/Bluetooth.odex:da52b4290679e2159c5ec6b6214c4c87
 bullhead/mtc20k/factory_imgs_data/system/app/BluetoothMidiService/BluetoothMidiService.apk:91073d348f48f85c3a307c8166afa8bf
+bullhead/mtc20k/factory_imgs_data/system/app/BluetoothMidiService/oat/arm64/BluetoothMidiService.odex:4530a1517c06b6a0023cbc6542adb629
+bullhead/mtc20k/factory_imgs_data/system/app/BullheadLayout/BullheadLayout.apk:972b77d8fabefa9aeb29986b0b7f0cd9
+bullhead/mtc20k/factory_imgs_data/system/app/BullheadLayout/oat/arm64/BullheadLayout.odex:877862149469b58a9fc93d20f663ad30
 bullhead/mtc20k/factory_imgs_data/system/app/CalculatorGoogle/CalculatorGoogle.apk:345130b0cb4d3d970bae2327cb92bd72
+bullhead/mtc20k/factory_imgs_data/system/app/CalculatorGoogle/oat/arm64/CalculatorGoogle.odex:a145a9a2d2a06ce150164dca0b8ff889
+bullhead/mtc20k/factory_imgs_data/system/app/CalendarGooglePrebuilt/CalendarGooglePrebuilt.apk:57c0f2b401d27b0ce8ee65e063ce67c8
+bullhead/mtc20k/factory_imgs_data/system/app/CalendarGooglePrebuilt/oat/arm64/CalendarGooglePrebuilt.odex:87f6974202332bcd1f7760f72d45a164
 bullhead/mtc20k/factory_imgs_data/system/app/CaptivePortalLogin/CaptivePortalLogin.apk:d813a4369791e8f7d2c70fc835251a9d
 bullhead/mtc20k/factory_imgs_data/system/app/CaptivePortalLogin/oat/arm64/CaptivePortalLogin.odex:2464de47c7d45f983b19c910f8e0330c
 bullhead/mtc20k/factory_imgs_data/system/app/CertInstaller/CertInstaller.apk:7aacd43b3d1aa685b6512ac9ccb0dd7b
@@ -22,6 +28,10 @@
 bullhead/mtc20k/factory_imgs_data/system/app/Drive/oat/arm64/Drive.odex:7284406140576278410fcb5ff386fffe
 bullhead/mtc20k/factory_imgs_data/system/app/FaceLock/FaceLock.apk:1b6ca424757c862222661a72df8a65b1
 bullhead/mtc20k/factory_imgs_data/system/app/FaceLock/oat/arm64/FaceLock.odex:d73f36cd52f87e086a5c207475dadad0
+bullhead/mtc20k/factory_imgs_data/system/app/GoogleCamera/GoogleCamera.apk:df17d60a00d9532b12327cbe5f8007b7
+bullhead/mtc20k/factory_imgs_data/system/app/GoogleCamera/oat/arm64/GoogleCamera.odex:52961de2ff049b6f523680fde62af739
+bullhead/mtc20k/factory_imgs_data/system/app/GoogleContactsSyncAdapter/GoogleContactsSyncAdapter.apk:b99ededa6897f8ebd54eee652be710b0
+bullhead/mtc20k/factory_imgs_data/system/app/GoogleContactsSyncAdapter/oat/arm64/GoogleContactsSyncAdapter.odex:53bcba9825a42fb1c938af62f70c1dfe
 bullhead/mtc20k/factory_imgs_data/system/app/GoogleHindiIME/GoogleHindiIME.apk:033ab854fe0c07a3fc2ea0d3bffc4c93
 bullhead/mtc20k/factory_imgs_data/system/app/GoogleHindiIME/oat/arm64/GoogleHindiIME.odex:609bd8e75f620ba301b649cbb35fe835
 bullhead/mtc20k/factory_imgs_data/system/app/GoogleHome/GoogleHome.apk:0b3a06e3e003bd140b0ec8525ad60c08
@@ -35,14 +45,29 @@
 bullhead/mtc20k/factory_imgs_data/system/app/HTMLViewer/HTMLViewer.apk:c54264b488461304e22349cb171c4f43
 bullhead/mtc20k/factory_imgs_data/system/app/HTMLViewer/oat/arm64/HTMLViewer.odex:83487ea0307c92c0683500b658b87706
 bullhead/mtc20k/factory_imgs_data/system/app/Hangouts/Hangouts.apk:0101359b4a10468bd8ce5e649b208389
+bullhead/mtc20k/factory_imgs_data/system/app/Hangouts/oat/arm/Hangouts.odex:6b77481a562b1575e4c5d4d6083d55a1
+bullhead/mtc20k/factory_imgs_data/system/app/HiddenMenu/HiddenMenu.apk:a50731a5ab478950a7d3156eb667204f
+bullhead/mtc20k/factory_imgs_data/system/app/HiddenMenu/oat/arm64/HiddenMenu.odex:e5fd1b68b799a360d42c382cc238ea7c
 bullhead/mtc20k/factory_imgs_data/system/app/KeyChain/KeyChain.apk:eaca5540bb6e2641bc84cad3645042e2
+bullhead/mtc20k/factory_imgs_data/system/app/KeyChain/oat/arm64/KeyChain.odex:1944e27cfa31628cc07258de2f96f585
+bullhead/mtc20k/factory_imgs_data/system/app/KoreanIME/KoreanIME.apk:3a5ec342bb3c67e3ccbe424063dd7cf8
+bullhead/mtc20k/factory_imgs_data/system/app/KoreanIME/oat/arm64/KoreanIME.odex:cdd61bb0198cd5da7ad23440ec09d8f1
 bullhead/mtc20k/factory_imgs_data/system/app/LatinImeGoogle/LatinImeGoogle.apk:1f9c02b03027b4341765bc8b4805730b
 bullhead/mtc20k/factory_imgs_data/system/app/LatinImeGoogle/oat/arm64/LatinImeGoogle.odex:d13a725625e62444fa9f15b66bccbfe1
 bullhead/mtc20k/factory_imgs_data/system/app/LiveWallpapersPicker/LiveWallpapersPicker.apk:d257afad6612d0b212f7d8e2214c2e5e
+bullhead/mtc20k/factory_imgs_data/system/app/LiveWallpapersPicker/oat/arm64/LiveWallpapersPicker.odex:1d1b27c77ec2153625e6b96bddd7e8fc
+bullhead/mtc20k/factory_imgs_data/system/app/Maps/Maps.apk:7af9c6808885afcbf9bf637ddc2b5b53
+bullhead/mtc20k/factory_imgs_data/system/app/Maps/oat/arm64/Maps.odex:e3fc7f5b67161a8959babd936a6a4198
+bullhead/mtc20k/factory_imgs_data/system/app/Music2/Music2.apk:2c27b51d325f700f5cdc70a29fcc719a
+bullhead/mtc20k/factory_imgs_data/system/app/Music2/oat/arm64/Music2.odex:93b9d3d6fdb4ad8899e1ace61cd042d2
 bullhead/mtc20k/factory_imgs_data/system/app/NfcNci/NfcNci.apk:07fbce22c357f7421d4a8ca07d439c4d
 bullhead/mtc20k/factory_imgs_data/system/app/NfcNci/oat/arm64/NfcNci.odex:df252f4a6e554b1eaf6c598181e6bd7c
 bullhead/mtc20k/factory_imgs_data/system/app/PacProcessor/PacProcessor.apk:7f327097aa51f4b9175080cb672d6707
 bullhead/mtc20k/factory_imgs_data/system/app/PacProcessor/oat/arm64/PacProcessor.odex:cf28fe91df20be6e39cc047d87d0eb8a
+bullhead/mtc20k/factory_imgs_data/system/app/PartnerBookmarksProvider/PartnerBookmarksProvider.apk:6744e3b58a25809310e22160357322d4
+bullhead/mtc20k/factory_imgs_data/system/app/PartnerBookmarksProvider/oat/arm64/PartnerBookmarksProvider.odex:09f83086a12340e6df5ae688ea81dd30
+bullhead/mtc20k/factory_imgs_data/system/app/Photos/Photos.apk:092f2cefe3fc0e2fb5853a337cd7e5fa
+bullhead/mtc20k/factory_imgs_data/system/app/Photos/oat/arm/Photos.odex:2a4a232db130312ce13312c8eb7d3c15
 bullhead/mtc20k/factory_imgs_data/system/app/PlayAutoInstallConfig/PlayAutoInstallConfig.apk:c100f9a4b66da1de8f2d444294b9484a
 bullhead/mtc20k/factory_imgs_data/system/app/PlayAutoInstallConfig/oat/arm/PlayAutoInstallConfig.odex:74c9ed973ea8530f982484c8521e04b5
 bullhead/mtc20k/factory_imgs_data/system/app/PlayAutoInstallConfig/oat/arm64/PlayAutoInstallConfig.odex:dc217da7e5447974c46c045da498ec78
@@ -58,6 +83,10 @@
 bullhead/mtc20k/factory_imgs_data/system/app/PrebuiltGmail/oat/arm64/PrebuiltGmail.odex:9f7dcc10355f825964093dfd9d34b430
 bullhead/mtc20k/factory_imgs_data/system/app/PrintSpooler/PrintSpooler.apk:a03dbfa5cc1557898bc54a2bb5f06729
 bullhead/mtc20k/factory_imgs_data/system/app/PrintSpooler/oat/arm64/PrintSpooler.odex:95d80a2428416dea1022837f45384a71
+bullhead/mtc20k/factory_imgs_data/system/app/RCSBootstraputil/RCSBootstraputil.apk:fd431a92e71618ab380559b6d863b61a
+bullhead/mtc20k/factory_imgs_data/system/app/RCSBootstraputil/oat/arm64/RCSBootstraputil.odex:9746eaf757e23f5b7c59caacf2b132cb
+bullhead/mtc20k/factory_imgs_data/system/app/RcsImsBootstraputil/RcsImsBootstraputil.apk:e9dc9c65bcd2a22881e669458a20a26f
+bullhead/mtc20k/factory_imgs_data/system/app/RcsImsBootstraputil/oat/arm64/RcsImsBootstraputil.odex:a1252868a5999b033ca424cd6a7edcfe
 bullhead/mtc20k/factory_imgs_data/system/app/SetupSmartDeviceOverlay/SetupSmartDeviceOverlay.apk:ab554c944e42d5aeec398254baaa078c
 bullhead/mtc20k/factory_imgs_data/system/app/SetupSmartDeviceOverlay/oat/arm64/SetupSmartDeviceOverlay.odex:3d8a5dfba122875acdf9ae0df2838adf
 bullhead/mtc20k/factory_imgs_data/system/app/Stk/Stk.apk:3d575c24a169f6b0d981cfe8b93eb681
@anestisb anestisb added the bug label Jan 4, 2017
@anestisb anestisb self-assigned this Jan 4, 2017
@anestisb
Copy link
Owner Author

anestisb commented Jan 5, 2017

The problem appears to be located at the fuse readdir() implementation of fuse-ext2

$ fuse-ext2 -o uid=$EUID,ro system.img.raw system

$ ls system/app
BasicDreams             CloudPrint2             GoogleHome              LatinImeGoogle          PrebuiltDeskClockGoogle Tycho                   qcrilmsgtunnel
Bluetooth               DMAgent                 GoogleJapaneseInput     LiveWallpapersPicker    PrebuiltExchange3Google UserDictionaryProvider  talkback
BluetoothMidiService    DocumentsUI             GooglePinyinIME         NfcNci                  PrebuiltGmail           Videos
CalculatorGoogle        DownloadProviderUi      GoogleTTS               PacProcessor            PrintSpooler            Wallet
CaptivePortalLogin      Drive                   HTMLViewer              PlayAutoInstallConfig   SetupSmartDeviceOverlay WebViewGoogle
CertInstaller           FaceLock                Hangouts                PlayGames               Stk                     YouTube
Chrome                  GoogleHindiIME          KeyChain                PrebuiltBugle           TimeService             atfwd

$ ls system/app/HiddenMenu
HiddenMenu.apk oat

$ gstat system/app/HiddenMenu
  File: system/app/HiddenMenu
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 3600003eh/905969726d	Inode: 2059        Links: 3
Access: (0755/drwxr-xr-x)  Uid: (  501/anestisb)   Gid: (    0/   wheel)
Access: 2009-01-01 10:00:00.000000000 +0200
Modify: 2009-01-01 10:00:00.000000000 +0200
Change: 2009-01-01 10:00:00.000000000 +0200
 Birth: -

$ find system/app -name "*Hidden*"

@anestisb
Copy link
Owner Author

anestisb commented Jan 5, 2017

Using the older walk_dir() implementation instead of new default walk_dir2() seems to resolve the problem.

anestisb at khaos in ~/Tools/Misc/fuse-ext2 on master [!?] [2.7] $
$ git diff
diff --git a/fuse-ext2/op_readdir.c b/fuse-ext2/op_readdir.c
index 60e1890..203d60f 100644
--- a/fuse-ext2/op_readdir.c
+++ b/fuse-ext2/op_readdir.c
@@ -25,7 +25,7 @@ struct dir_walk_data {
        fuse_fill_dir_t filler;
 };

-#define _USE_DIR_ITERATE2 1
+//#define _USE_DIR_ITERATE2 1
 #if defined(_USE_DIR_ITERATE2) && (_USE_DIR_ITERATE2 == 1)
 static int walk_dir2 (ext2_ino_t dir, int   entry, struct ext2_dir_entry *dirent, int offset, int blocksize, char *buf, void *vpsid)
 {

@anestisb
Copy link
Owner Author

anestisb commented Jun 6, 2017

Upstream fuse-ext2 has also implemented the temporarily fix - alperakcan/fuse-ext2@48cc22e

@anestisb anestisb closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant