def cache_subdirs(cls, cache: Path) -> list[Path]:
return [cache / "archives"]
+ @classmethod
+ def dpkg_cmd(cls, command: str) -> list[PathString]:
+ return [
+ command,
+ "--admindir=/buildroot/var/lib/dpkg",
+ "--root=/buildroot",
+ ]
+
@classmethod
def scripts(cls, context: Context) -> dict[str, list[PathString]]:
return {
"apt-sortpkgs",
)
},
+ **{
+ command: apivfs_cmd() + cls.dpkg_cmd(command) for command in(
+ "dpkg",
+ "dpkg-query",
+ )
+ },
"mkosi-install" : ["apt-get", "install"],
"mkosi-upgrade" : ["apt-get", "upgrade"],
"mkosi-remove" : ["apt-get", "purge"],
To execute the entire script inside the image, add a ".chroot" suffix
to the name (`mkosi.build.chroot` instead of `mkosi.build`, etc.).
-* For all of the supported package managers except portage (`dnf`,
- `rpm`, `apt`, `pacman`, `zypper`), scripts of the same name are put
- into `$PATH` that make sure these commands operate on the image's root
- directory with the configuration supplied by the user instead of on
- the host system. This means that from a script, you can do e.g. `dnf
- install vim` to install vim into the image.
+* For all of the supported package managers (`dnf`, `rpm`, `apt`, `dpkg`,
+ `pacman`, `zypper`), scripts of the same name are put into `$PATH`
+ that make sure these commands operate on the image's root directory
+ with the configuration supplied by the user instead of on the host
+ system. This means that from a script, you can do e.g.
+ `dnf install vim` to install vim into the image.
Additionally, `mkosi-install`, `mkosi-reinstall`, `mkosi-upgrade` and
`mkosi-remove` will invoke the corresponding operation of the package