Android6.0 storage目錄sd卡存儲(chǔ)的路徑創(chuàng)建詳解
Android6.0 storage目錄sd卡存儲(chǔ)的路徑創(chuàng)建
前言:
之前一直很疑惑,android6.0上sd卡掛載storage下的sd卡路徑是什么時(shí)候創(chuàng)建的。
因?yàn)閽燧dsd卡的PublicVolume,負(fù)責(zé)創(chuàng)建mount路徑,然后掛載。
接著會(huì)創(chuàng)建幾個(gè)fuse路徑,如下:
1./mnt/runtime/default/
2./mnt/runtime/read/
3./mnt/runtime/write/
然后會(huì)把這個(gè)mount的路徑fuse到上面這幾個(gè)路徑。
但是一直沒(méi)有storage/下sd卡路徑的創(chuàng)建,而在PublicVolume下doMount函數(shù)也只有設(shè)置mPath為storage/....確沒(méi)有創(chuàng)建這個(gè)路徑。
后來(lái)終于在init.rc中發(fā)現(xiàn)下面這句
on post-fs start logd #add for amt chmod 0755 /amt # once everything is setup, no need to modify / mount rootfs rootfs / ro remount # Mount shared so changes propagate into child namespaces mount rootfs rootfs / shared rec # Mount default storage into root namespace mount none /mnt/runtime/default /storage slave bind rec
它把/mnt/runtime/default mount到storage下了,這樣問(wèn)題就迎刃而解了。
只是為什么要這么做比較奇怪,一般總是會(huì)創(chuàng)建目錄,或者創(chuàng)建軟鏈接。像這種方式比較少,所以也沒(méi)往這地方想。導(dǎo)致找了很長(zhǎng)時(shí)間才發(fā)現(xiàn)。
感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
相關(guān)文章
Android實(shí)現(xiàn)ListView分頁(yè)加載數(shù)據(jù)
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)ListView分頁(yè)加載數(shù)據(jù),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-11-11
Android報(bào)錯(cuò)Error:Could not find com.android.tools.build:gradle
這篇文章主要介紹了Android Studio報(bào)錯(cuò)Error:Could not find com.android.tools.build:gradle:4.1解決辦法,碰到該問(wèn)題的同學(xué)快過(guò)來(lái)看看吧2021-08-08
Android實(shí)現(xiàn)高德地圖首頁(yè)效果(上)
這篇文章主要為大家詳細(xì)介紹了基于Android實(shí)現(xiàn)高德地圖首頁(yè)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2023-08-08
Flutter中如何實(shí)現(xiàn)無(wú)Context跳轉(zhuǎn)詳解
這篇文章主要給大家介紹了關(guān)于Flutter中如何實(shí)現(xiàn)無(wú)Context跳轉(zhuǎn)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Flutter具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09
Android Webview的postUrl與loadUrl加載頁(yè)面實(shí)例
這篇文章主要介紹了Android Webview的postUrl與loadUrl加載頁(yè)面實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-03-03
解決Android studio用真機(jī)調(diào)試時(shí)logcat一直輸出日志問(wèn)題
這篇文章主要介紹了解決Android studio用真機(jī)調(diào)試時(shí)logcat一直輸出日志問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2020-04-04
Android 程序申請(qǐng)權(quán)限注意事項(xiàng)
本主要介紹Android 程序申請(qǐng)權(quán)限注意事項(xiàng),這里整理了相關(guān)資料,并詳細(xì)說(shuō)明如何避免開發(fā)的程序支持設(shè)備減少,有需要的小伙伴可以參考下2016-09-09

