ProcursusTeam / Procursus

Modern *OS Bootstrap
https://apt.procurs.us
BSD Zero Clause License
860 stars 126 forks source link

dpkg for randomized /var/jb #1388

Closed H5GG closed 1 year ago

H5GG commented 1 year ago

could we use dpkg parameters or environment variables to make dpkg install the deb into a randomized /var/jb path?

**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.

we don't even need to patch dpkg, and theos just need to, and theos no longer needs to package the files into the fixed path of /var/jb when generating deb.

Teutates commented 1 year ago

1378