# Making the Filesystem make sense



## HalosGhost (Jun 29, 2011)

Evening everyone!

I post so soon again because, now that I have my slate back, I would love to make it as close to a legitimate linux OS as possible. I realize a large portion of this wouldn't make sense (for instance, making user accounts); however, I mainly want the folder hierarchy and mounting to be more sensical for my own purposes. To that end, there are several changes I want to make to the rootfs (/). I realize, however, that to do so across boots, I would have to unpack, repackage and reinstall the initramfs. Can anyone point me in the correct direction to do this? Or, better yet, does anyone have any experience in doing this themselves?

The primary changes I want to make are:
remove /Removable
Add /media
Add USBdisk1 and USBdisk2 to /media and mount the two respective USB disks there (they make more sense than in /Removable)
add /home
add personal folder in /home (/home/HalosGhost) and change sdcard mount location to point there
relink /sdcard to /home/HalosGhost
add two folders in /mnt for the sdcards because they make more sense there
All the other changes I want to make are made in places not in the rootfs, but to have any of these persist across boots, I need to be able to modify the initramfs. If people want me to upload the final product initramfs so that other people can have sensical filesystems too, I'd be happy to do so.

Thank you, in advance, for all your help and suggestions.

All the best,

-HG


----------



## jermaine151 (Aug 26, 2011)

Hey Bro. I got your PM. You might have issues doing this but I can tell you how to unpack/repack the boot image. The /Removable is configured in more places than just the ramdisk. Anyways, see this thread for info on how to unpack the boot blob and boot.img: http://forum.xda-dev...d.php?t=1121379

Boot tools needs to be built from this source: https://github.com/A...dRoot/BootTools
Get the BlobTools from this post: http://forum.xda-dev...50&postcount=24

and be sure to use the -s switch when you run blobpack. Also make sure to NOT use a cmdline when you make your boot image or you will boot loop.


----------



## HalosGhost (Jun 29, 2011)

jermaine151 said:


> Hey Bro. I got your PM. You might have issues doing this but I can tell you how to unpack/repack the boot image. The /Removable is configured in more places than just the ramdisk. Anyways, see this thread for info on how to unpack the boot blob and boot.img: http://forum.xda-dev...d.php?t=1121379
> 
> Boot tools needs to be built from this source: https://github.com/A...dRoot/BootTools
> Get the BlobTools from this post: http://forum.xda-dev...50&postcount=24
> ...


Thank you for the reply and the guidance Jermaine! I will let you know how it goes. On an unrelated note, does anyone know how to change the default download folder? I want it to be /sdcard/Downloads. The "s" is important to me









All the best,

-HG


----------



## craigacgomez (Jan 17, 2012)

HalosGhost said:


> On an unrelated note, does anyone know how to change the default download folder? I want it to be /sdcard/Downloads. The "s" is important to me
> 
> 
> 
> ...


I believe you might be able to change is by changing something in android.os.Environment is framework.jar... not 100%, but all environment folders are set here


----------



## HalosGhost (Jun 29, 2011)

Thanks for the heads up Craig, but that would mean I'd have to decompile the framework.jar too, right? This is a bit ridiculous. Why is Android not a little more flexible?

All the best,

-HG


----------



## HalosGhost (Jun 29, 2011)

jermaine151 said:


> Boot tools needs to be built from this source: https://github.com/A...dRoot/BootTools


Hey Jermaine, in following the instructions of your post, I've begun my attempts to compile BootTools; however, cmake errors out saying src/mincrypt/rsa.c doesn't exist (which it doesn't). Is this file accidentally absent from the source, or was I supposed to grab it from somewhere? the readme is fairly unhelpful, and the github never mentioned it. Do you have any advice for me?

On a related note, you pointed to a different place for me to get the binaries from for Windows, I'm assuming if I build the source for Linux, I don't need to worry about that, am I right?

All the best,

-HG


----------



## jermaine151 (Aug 26, 2011)

HalosGhost said:


> Thank you for the reply and the guidance Jermaine! I will let you know how it goes. On an unrelated note, does anyone know how to change the default download folder? I want it to be /sdcard/Downloads. The "s" is important to me
> 
> 
> 
> ...


The default download directory is controlled by an environment variable; Environment.DIRECTORY_DOWNLOADS. I'm not sure of the best way to change it. Dolphin HD lets you choose your download folder.


----------



## HalosGhost (Jun 29, 2011)

jermaine151 said:


> The link I pointed you to has the newer windows binaries AND the newer source code to build from. That's what I used. It allows building secure blobs which the Prime requires. As far as the BootTools, I don't have that file either. All I did was this:
> 
> So I'm not sure why you're getting an error. Do you have all of the required gcc build tools installed?
> 
> Edit: What flavor and version of Linux are you running? I'm on Linux Mint 13 (Cinnamon).


The error I'm getting is from a missing file, but I believe I know why that happened. I'm going to retry here shortly, I have big plans for this filesystem. I'm running Fc16(Verne).x86_64.

All the best,

-HG


----------



## HalosGhost (Jun 29, 2011)

Well then. It seems some of the things I want to change (for instance, where and how the sdcards all mount) can't be changed by just modifying the initramfs. Thus, I abandoned this project in favor of a fairly elaborate init.d script. Sadly, some mounting got a little weird and it wiped my internal sdcard (I don't believe I lost anything that I don't have backed up, but I didn't have an index, so there'll be no way to know other than realizing I lost something). Unless someone can point me in the right direction for fixing those things (preferrably without branching AOKP, as I don't have time to maintain a whole ROM), this project will likely be abandoned indefinitely.

All the best,

-HG


----------



## buxtahuda (Jan 31, 2012)

http://forum.xda-dev.../t-1153082.html

By no means a way to actually clean up, this can help you straighten things out. This is the only way I'm able to make actual use of my external storage. Towards the top you'll see how to simply bind directories and script them to be binded at startup (or card insertion?); towards the bottom you can see how to go about editing the vold.fstab for permanently changing the actual mount-points of your storage (and how to fix permissions for the file on stock ROM).

I know this is probably only a small part of your goal, and likely something you've already seen, but never hurts to have more information in a thread. This is the only way I've been able to properly use my external storage on my Prime, thank you ASUS.

*EDIT:

So, obviously, you could use it to remove /Removable/, but I don't know how in the world you'd get apps and all to see /Home/ and /Media/ directories, and I'm not sure on how to change the mount point of the internal SD. Maybe your search with Jermaine's help has told you?

But, you could leave the internal SD as is and use this method to mount all /Removable/ drives within sub-directories of /data/media/ (internal storage).

So you could at least have everything within the one /sdcard/ directory and sorted out. You could most certainly mount the USBdisks into /mnt/ too, whatever you like, but I think that the only way to make use of all this without editing the framework and such is to place everything in the sdcard.

Hope I've helped somehow, yet again this is the only way I've come to enjoy even having external storage on this device.


----------



## HalosGhost (Jun 29, 2011)

buxtahuda said:


> http://forum.xda-dev.../t-1153082.html
> 
> By no means a way to actually clean up, this can help you straighten things out. This is the only way I'm able to make actual use of my external storage. Towards the top you'll see how to simply bind directories and script them to be binded at startup (or card insertion?); towards the bottom you can see how to go about editing the vold.fstab for permanently changing the actual mount-points of your storage (and how to fix permissions for the file on stock ROM).
> 
> ...


Actually, I hadn't seen that before. I had messed around with the vold.fstab but that screwed some things up. Thank you for your help. This project has been abandoned for the most part; in favor of one day running a fully fledged native GNU/Linux distro (for the love of God, please Arch).

All the best,

-HG


----------

