Skip to content

Commit

Permalink
What if I just don't replace with busybox shit
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-psi committed Dec 17, 2021
1 parent e66b6a4 commit 7ba4977
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y --no-install-recommends wget debootstrap grub-pc-bin \
grub-efi-amd64-bin mtools squashfs-tools xorriso ca-certificates curl \
libusb-1.0-0-dev gcc make gzip unzip libc6-dev
libusb-1.0-0-dev gcc make gzip unzip libc6-dev xz-utils
# gotta get 1.5.0
(
Expand Down
24 changes: 12 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,17 @@ dpkg -P --force-all init-system-helpers
dpkg -P --force-all dpkg perl-base
!

# * Replacing coreutils with their Debian equivalents (123MB size reduction)
cat << "!" | chroot work/chroot /bin/bash
ln -sfv "$(command -v busybox)" /usr/bin/which
busybox --list | egrep -v "(busybox)|(init)" | while read -r line; do
if which $line &> /dev/null; then # If command exists
if [ "$(stat -c%s $(which $line))" -gt 16 ]; then # And we can gain storage space from making a symlink (symlinks are 16 bytes)
ln -sfv "$(which busybox)" "$(which $line)" # Then make one (ignore nonexistent commands /shrug)
fi
fi
done
!
# # * Replacing coreutils with their Debian equivalents (123MB size reduction)
# cat << "!" | chroot work/chroot /bin/bash
# ln -sfv "$(command -v busybox)" /usr/bin/which
# busybox --list | egrep -v "(busybox)|(init)" | while read -r line; do
# if which $line &> /dev/null; then # If command exists
# if [ "$(stat -c%s $(which $line))" -gt 16 ]; then # And we can gain storage space from making a symlink (symlinks are 16 bytes)
# ln -sfv "$(which busybox)" "$(which $line)" # Then make one (ignore nonexistent commands /shrug)
# fi
# fi
# done
# !

# * Empty unused directories
(
Expand Down Expand Up @@ -249,7 +249,7 @@ umount work/chroot/sys
umount work/chroot/dev
cp work/chroot/vmlinuz work/iso/boot
cp work/chroot/initrd.img work/iso/boot
mksquashfs work/chroot work/iso/live/filesystem.squashfs -noappend -e boot -comp xz -Xbcj 100% -Xdict-size 100%
mksquashfs work/chroot work/iso/live/filesystem.squashfs -noappend -e boot -comp zstd -Xcompression-level 22

## Creates output ISO dir (easier for GitHub Actions)
mkdir -p out
Expand Down

0 comments on commit 7ba4977

Please sign in to comment.