theos / theos

A cross-platform suite of tools for building and deploying software for iOS and other platforms.
https://theos.dev
Other
4.43k stars 1.08k forks source link

Reduce dependency on /var/jb fixed path #727

Closed H5GG closed 1 year ago

H5GG commented 1 year ago

What problem are you trying to solve?

Theos currently compiles rootless deb to package all files into a fixed path of /var/jb, which will make it difficult to modify or randomize the /var/jb path in the future.

Since rootless is called "rootless", rootless deb should be able to be installed in a directory with any name, and should not depend on the fixed path of /var/jb.

Describe the solution you’d like

The dpkg installer has been designed to support installing debs into any specified root directory:

**parameters**:

--admindir=dir
          Set the administrative directory to directory.   This  directory
          contains  many  files  that  give  information  about  status of
          installed   or   uninstalled   packages,   etc.    Defaults   to
          <</var/db/dpkg>>.

       --instdir=dir
          Set  the  installation  directory, which refers to the directory
          where  packages  are  to  be  installed.  instdir  is  also  the
          directory   passed   to   [chroot(2)](https://man.freebsd.org/cgi/man.cgi?query=chroot&sektion=2&apropos=0&manpath=FreeBSD+13.2-RELEASE+and+Ports)   before  running  package's
          installation scripts, which means that the scripts  see  instdir
          as a root directory.  Defaults to <</>>.

       --root=dir
          Set the root directory to directory, which sets the installation
          directory  to  <<dir>>  and  the  administrative  directory   to
          <<dir/var/db/dpkg>>.

**environment**:  

          DPKG_ROOT
          Defined by dpkg on the maintainer script environment to indicate
          which  installation to act on (since dpkg 1.18.5).  The value is
          intended to be prepended to any path maintainer scripts  operate
          on.   During  normal  operation,  this  variable is empty.  When
          installing packages into  a  different  instdir,  dpkg  normally
          invokes  maintainer  scripts  using  [chroot(2)](https://man.freebsd.org/cgi/man.cgi?query=chroot&sektion=2&apropos=0&manpath=FreeBSD+13.2-RELEASE+and+Ports)  and  leaves this
          variable empty, but if  --force-script-chrootless  is  specified
          then the [chroot(2)](https://man.freebsd.org/cgi/man.cgi?query=chroot&sektion=2&apropos=0&manpath=FreeBSD+13.2-RELEASE+and+Ports) call is skipped and instdir is  non-empty.

       DPKG_ADMINDIR
          Defined by dpkg on the maintainer script environment to indicate
          the dpkg administrative directory to use  (since  dpkg  1.16.0).
          This variable is always set to the current --admindir value.

So we don’t need to package the files into the fixed path of /var/jb when generating deb, we only need to specify the root directory of rootless jailbreak through parameters or environment variables when installing deb.

In this way, we will be able to easily modify or randomize the /var/jb path in the future without recompiling all third-party jailbreak apps/tweaks.

Describe any alternatives you’ve considered

No response

Documentation, Adoption, Migration Strategy

No response

kirb commented 1 year ago

Based on the fact that you’ve created numerous threads about this in many places, after being asked several times to stick to just discussing your ideas in one thread and one repo, I’m unfortunately going to be temporary banning you from all Theos project repos.

We really appreciate your suggestions, but in every prior thread you’ve been told why this won’t work. The directory flags on dpkg don’t solve the problems the Procursus, Dopamine, and ElleKit teams have told you about.