portage-squashfs/README.md

35 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2022-02-20 07:51:16 +00:00
# portage-squashfs
2022-02-20 08:15:38 +00:00
scripts to use squashfs to dramatically reduce the size of `/var/db/repos/gentoo` (or `/usr/portage` if you're old)
## Should I do this?
Probably not. Chances are if you're running Gentoo you've never noticed how much space `/var/db/repos/gentoo` takes up. You would only care if you're running Gentoo on ARM chinky boards with low storage / write speeds. Or if you're me, running it on a chromebook with like 16Gb of storage...
## MASTER / SLAVE structure:
2022-02-20 08:16:16 +00:00
My trick here is to use a MASTER computer (like a server you run 24/7 or a beefy desktop) that also runs Gentoo. The MASTER compresses its copy of the Gentoo repo into a file using squashfs. The SLAVE downloads this copy into a folder and mounts it at `/var/db/repos/gentoo`. The files are still there as far as the SLAVE's portage cares, so you can proceed to install packages as normal.
**Also both master and slave need the** `sys-fs/squashfs-tools` **package!!**
2022-02-20 08:15:38 +00:00
In short:
### MASTER
- takes care of gentoo repo updating
- squashes its copy of the gentoo repo into squashfs file
### SLAVE
- NEVER updates normally
- only downloads squashfs from MASTER
- mounts said squashfs
## scripts
- `portage-squashfs.sh` should be at the MASTER computer
- I put this one under `/etc/cron.daily/` as I already have a daily `emerge --sync` script in there.
- `update.sh` should be at the SLAVE computer
- This one was made to be run deliberately instead of automated.
## FURTHER READING
- https://wiki.gentoo.org/wiki/SquashFS
- https://forums.gentoo.org/viewtopic-t-465367-start-67-postdays-0-postorder-asc-highlight-.html
- https://www.brunsware.de/blog/portage-tree-squashfs-overlayfs
### FEEL FREE TO DO WHATEVER YOU WANT WITH THESE SCRIPTS, MODIFY AS YOU WISH