Skip to content

Commit

Permalink
make bdrv smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Jan 22, 2022
1 parent fc1d5b4 commit 72cc171
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion woof-code/3builddistro
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ fi

if [ "$BUILD_SFS" = 'yes' ]; then
sh $MWD/support/files2delete.sh rootfs-complete
[ "$USR_SYMLINKS" = "yes" ] && usrmerge rootfs-complete 1

if [ "${DISTRO_BINARY_COMPAT}" = 'debian' -a "$BUILD_BDRV" = 'yes' ]; then
if [ "$ISOFLAG" -o "$FRUGALIFY" ]; then
Expand All @@ -1016,7 +1017,6 @@ if [ "$BUILD_SFS" = 'yes' ]; then
fi
fi

[ "$USR_SYMLINKS" = "yes" ] && usrmerge rootfs-complete 1
#build the rootfs-complete sfs...
echo -e "\nNow building the main f.s., ${PUPPYSFS}..."
rm -f build/${PUPPYSFS} 2>/dev/null
Expand Down
14 changes: 13 additions & 1 deletion woof-code/support/bdrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,25 @@ chroot bdrv apt-mark hold `chroot bdrv dpkg-query -f '${binary:Package}\n' -W |
# remove unneeded files
chroot bdrv apt-get clean
rm -f bdrv/var/lib/apt/lists/* 2>/dev/null || :
rm -rf bdrv/home bdrv/root bdrv/dev bdrv/run bdrv/var/log bdrv/var/cache/man bdrv/var/cache/fontconfig bdrv/var/cache/ldconfig bdrv/etc/ssl bdrv/lib/udev bdrv/lib/modprobe.d bdrv/lib/firmware bdrv/usr/share/mime bdrv/etc/ld.so.cache
rm -rf bdrv/home bdrv/root bdrv/dev bdrv/run bdrv/var/log bdrv/var/cache/man bdrv/var/cache/fontconfig bdrv/var/cache/ldconfig bdrv/etc/ssl bdrv/lib/udev bdrv/lib/modprobe.d bdrv/lib/firmware bdrv/usr/share/mime bdrv/etc/ld.so.cache bdrv/usr/bin/systemctl bdrv/usr/bin/systemd-analyze bdrv/usr/bin/systemctl bdrv/usr/lib/systemd/systemd-networkd bdrv/usr/lib/systemd/systemd bdrv/usr/lib/systemd/systemd-journald bdrv/usr/share/fonts
rm -rf `find bdrv -name __pycache__`
for ICONDIR in bdrv/usr/share/icons/*; do
[ "$ICONDIR" != "bdrv/usr/share/icons/hicolor" ] || continue
rm -rf "$ICONDIR"
done

# remove all duplicates and files that may conflict with the main SFS
find bdrv | tac | while read FILE; do
RELPATH=${FILE#bdrv/}
[ -e "rootfs-complete/$RELPATH" ] || continue

if [ -L "bdrv/$RELPATH" -o -f "bdrv/$RELPATH" ]; then
rm -f "bdrv/$RELPATH"
elif [ -d "bdrv/$RELPATH" ]; then
rmdir "bdrv/$RELPATH" 2>/dev/null || :
fi
done

# delete files and directories present in the main SFS
cat ../status/findpkgs_FINAL_PKGS-${DISTRO_BINARY_COMPAT}-${DISTRO_COMPAT_VERSION} | cut -f 5 -d \| | while read NAME; do
LIST=bdrv/var/lib/dpkg/info/$NAME:$ARCH.list
Expand Down

0 comments on commit 72cc171

Please sign in to comment.