Skip to content

Commit

Permalink
Try to reduce size of raspios sysroot a bit more
Browse files Browse the repository at this point in the history
 - Not sure what else can be removed easily
  • Loading branch information
xtremekforever committed Dec 28, 2024
1 parent cd8858d commit 134fb66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-swift-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Swift ${{ env.SWIFT_VERSION }} for armv7
name: Swift ${{ env.SWIFT_VERSION }} for armhf
tag: ${{ env.SWIFT_VERSION }}
commit: ${{ github.sha }}
artifactErrorsFailBuild: true
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Swift ${{ env.SWIFT_VERSION }} for armv6/armv7
name: Swift ${{ env.SWIFT_VERSION }} for armhf
tag: ${{ env.SWIFT_VERSION }}
commit: ${{ github.sha }}
artifactErrorsFailBuild: false
Expand Down
15 changes: 11 additions & 4 deletions build-sysroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ if [[ $DISTRIBUTION_NAME = "raspios" ]]; then
7z e -y $IMAGE_FILE

echo "Mounting 1.img and needed passthroughs..."
sudo umount -R sysroot && true
rm -rf sysroot && mkdir sysroot
sudo mount -o loop 1.img sysroot
sudo mount --bind /dev sysroot/dev
Expand All @@ -133,19 +134,25 @@ if [[ $DISTRIBUTION_NAME = "raspios" ]]; then
network-manager \
linux-image* \
*firmware* \
openssh* \
p7zip* \
perl \
perl-modules* \
raspi* \
rpi* \
&& apt-get autoremove -y \
"
sudo chroot sysroot qemu-arm-static /bin/bash -c "$REMOVE_DEPS_CMD && $INSTALL_DEPS_CMD"
sudo chroot sysroot qemu-arm-static /bin/bash -c "$REMOVE_DEPS_CMD && $INSTALL_DEPS_CMD && apt-get autoremove -y"

echo "Copying files from sysroot to $SYSROOT..."
rm -rf $SYSROOT
mkdir -p $SYSROOT/usr
mkdir -p $SYSROOT/usr/lib
sudo chroot sysroot qemu-arm-static /bin/bash -c "symlinks -cr /usr/lib"
cp -r sysroot/lib $SYSROOT/lib
cp -r sysroot/usr/include $SYSROOT/usr/include
cp -r sysroot/usr/lib $SYSROOT/usr/lib
cp -r sysroot/usr/lib/*.so* $SYSROOT/usr/lib/
cp -r sysroot/usr/lib/arm-linux-gnueabihf $SYSROOT/usr/lib/
cp -r sysroot/usr/lib/linux $SYSROOT/usr/lib/
cp -r sysroot/usr/lib/gcc $SYSROOT/usr/lib/

echo "Umounting and cleaning up..."
sudo umount -R sysroot
Expand Down

0 comments on commit 134fb66

Please sign in to comment.