removing /root directory


the purpose of this thread is to find the script that creates this directory upon boot. while /system/xbin/su, /system/xbin/sushell and /system/app/Superuser can be removed, this directory alone already made Root Checker mentions incomplete install/uninstall of root and I have a few app-sensitive apps (legal live tv apps) that crashes when it found this directory

previous version of emteria around 2017 doesn't create this directory and sometime in 2018 this directory is created for whatever reason. even with latest image 1.1.1 this still happens


  • found out there's /system/etc/init/superuser.rc which creates the /root. already removed it but somehow still loaded. just a little bit more...
  • seems like /root is created during the boot process. I can't modify init and/or init.rc since the image (ramdisk? zImage?) is compiled with u-boot tools. would appreciate if @kalkov can take a look at his build recipe since /root serves no purpose except causing some app that search for root with keyword "root" in their filter
  • edited April 2020
    The /root directory is a fixed part of AOSP and is created automatically by the build system together with other directories like acct, proc and mnt:

    I am quite sure we always had this directory in our OS, since this part of AOSP didn't change since 2016. If there are apps, which think the existence of this directory might be a hint to a rooted system, they are wrong and must be fixed by their developers.
  • thanks for the reply. seems like at least in 9.0.0 they have removed that, you can check via xref or googlesource

    anyway, throughout my time using android, oem and custom, I've never seen a /root before. it's not a symlink either and is an empty directory. I've been using Nokia phones (Nokia 5 2017, Nougat->Oreo->Pie) which is very close to AOSP. The same app never fails and on closer inspection /root has never been there. Even with installing su binary, it only copies su and supersu/superuser.apk including some tweaks in the script but never create a directory called /root

    the usage of keyword root in root detection probably hinted towards the early android days (2.2+) although if I recall no /root was created or existed in other oem android. still, it triggers root detection app, most likely since it has been used in the past. I'd suggest if you're compiling a new build, tweak the mk file to exclude root as I've digging init.environ.rc but doesn't find the reference towards that command line

    if you have a way to remove /root in a persistent manner please let me know.

Sign In or Register to comment.