scripts to use squashfs to dramatically reduce the size of /var/db/repos/gentoo (or /usr/portage)
Go to file
bronze 0ffcf9be2a Upload files to '' 2022-02-20 03:24:29 -05:00
LICENSE Initial commit 2022-02-20 02:51:16 -05:00
README.md Update 'README.md' 2022-02-20 03:16:16 -05:00
portage-squash.sh Upload files to '' 2022-02-20 03:24:29 -05:00
update.sh Upload files to '' 2022-02-20 03:24:29 -05:00

README.md

portage-squashfs

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:

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!!

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

FEEL FREE TO DO WHATEVER YOU WANT WITH THESE SCRIPTS, MODIFY AS YOU WISH