chore: use compression for brew on disk. (#1308)

This commit is contained in:
m2 2024-05-16 10:09:17 -04:00 committed by GitHub
parent a4c90c7bbf
commit 81e5b1c8e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 11 deletions

View file

@ -13,8 +13,4 @@ mkdir -p /var/roothome
curl -Lo /tmp/brew-install https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
chmod +x /tmp/brew-install
/tmp/brew-install
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor
rm -rf /home/linuxbrew/.linuxbrew/Homebrew/.git
# Copy to image
cp -R /home/linuxbrew /usr/share/homebrew
tar --zstd -cvf /usr/share/homebrew.tar.zst /home/linuxbrew/.linuxbrew

View file

@ -7,13 +7,11 @@ ConditionPathExists=!/var/home/linuxbrew/.linuxbrew
[Service]
Type=oneshot
Environment=HOMEBREW_CELLAR=/home/linuxbrew/.linuxbrew/Cellar
Environment=HOMEBREW_PREFIX=/home/linuxbrew/.linuxbrew
Environment=HOMEBREW_REPOSITORY=/home/linuxbrew/.linuxbrew/Homebrew
ExecStart=/usr/bin/cp -R -n /usr/share/homebrew/.linuxbrew /var/home/linuxbrew
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew update
ExecStart=/home/linuxbrew/.linuxbrew/bin/brew upgrade
ExecStart=/usr/bin/mkdir -p /tmp/homebrew
ExecStart=/usr/bin/tar --zstd -xvf /usr/share/homebrew.tar.zst -C /tmp/homebrew
ExecStart=/usr/bin/cp -R -n /tmp/homebrew/home/linuxbrew/.linuxbrew /var/home/linuxbrew
ExecStart=/usr/bin/chown -R 1000:1000 /var/home/linuxbrew
ExecStart=/usr/bin/rm -rf /tmp/homebrew
ExecStart=/usr/bin/touch /etc/.linuxbrew
[Install]