Skip to content

Instantly share code, notes, and snippets.

@hololeap
Last active August 29, 2015 14:23
Show Gist options
  • Save hololeap/d16e9e78f3efba2f17bc to your computer and use it in GitHub Desktop.
Save hololeap/d16e9e78f3efba2f17bc to your computer and use it in GitHub Desktop.
#/bin/sh
fallocate -l 500M /var/db/portage-loop
mkfs.btrfs /var/db/portage-loop
mv /usr/portage/distfiles /var/db
rm -rf /usr/portage
mkdir /usr/portage
mount -o noatime,loop,compress-force /var/db/portage-loop /usr/portage
mkdir /usr/portage/distfiles
mount --bind /var/db/distfiles /usr/portage/distfiles
echo '/var/db/portage-loop /usr/portage btrfs loop,noatime,compress-force 0 2' >> /etc/fstab
echo '/var/db/distfiles /usr/portage/distfiles none bind 0 0' >> /etc/fstab
cd /usr/portage
git init
git remote add origin https://github.com/gentoo/gentoo-portage-rsync-mirror.git
git pull --depth=1 origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment