Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move Android source into case-sensitive image

I have downloaded the Android source to my Mac. When I went to build, I got this message:

$make -j4
Checking build tools versions...
build/core/main.mk:90: ************************************************************
build/core/main.mk:91: You are building on a case-insensitive filesystem.
build/core/main.mk:92: Please move your source tree to a case-sensitive filesystem.
build/core/main.mk:93: ************************************************************
build/core/main.mk:94: *** Case-insensitive filesystems not supported. Stop.

Then I realised I had missed creating a case-sensitive image. So I created a new one as mentioned on http://source.android.com/source/initializing.html, like this:

hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

...but I can not create any folder in it, it says:

mkdir android
mkdir: android: Read-only file system

How can I move Android source code which was downloaded on my Mac OS to a newly created case-sensitive image?

like image 672
ysnky Avatar asked Dec 01 '11 12:12

ysnky


3 Answers

I met the same problem. I found if you use sudo then the problem is gone.

Note the # character in Google's step by step guide:

# hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }

So you have to run the commands with sudo:

sudo hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg
sudo hdiutil attach ~/android.dmg -mountpoint /Volumes/android
like image 82
spikeyang Avatar answered Oct 16 '22 17:10

spikeyang


With the given command:

hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/android.dmg

We'll get a read-only sparse disk image file. Thus we need to convert it to writable before mounting it:

hdiutil convert ~/android.dmg.sparsefile -format UDRW -o ~/android.dmg

Besides, instead create & convert images, we can generate writable disk image directly with OSX build-in Disk Utility.

like image 28
coldturnip Avatar answered Oct 16 '22 17:10

coldturnip


As of macOS High Seirra, there's a faster alternative called "APFS Subvolumes". It's significantly faster than sparse images, and also features some fancy copy-on-write features like BTRFS.

  1. Open Applications → Utilities → Disk Utility
  2. Click the View button and change to "Show All Devices"
  3. Select the desired container disk and click the add button at the top of screen
  4. Select the new partition and name it e.g. “android”
  5. Choose "APFS (Case-sensitive)" from the Format menu
  6. Optionally click "Size Options" to set quota for the subvolume
  7. Click "Add" to create the volume

You should now have an extremely fast, case-sensitive partition that grows dynamically like a sparse image.

like image 45
Zach Riggle Avatar answered Oct 16 '22 16:10

Zach Riggle