##// END OF EJS Templates
Sound is part of BT dependency - keep it if used...
Sound is part of BT dependency - keep it if used https://github.com/drtyhlpr/rpi23-gen-image/issues/216#issue-576155174 the whole reduce area could need an update for debian releases

Fichier de la dernière révision:

r745:3a61ef98dff9
r745:3a61ef98dff9
Show More
99-reduce.sh
105 lines | 3.4 KiB | application/x-sh | BashLexer
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 #
# Reduce system disk usage
#
# Load utility functions
. ./functions.sh
Unknown
-Enable_nonfree no longer enables non-free packages while install. now it enables non free packacges in sources.list...
r732 if [ "$ENABLE_IPV6" = false ] ; then
"$LIB_DIR"/xtables/libip6t_ah.so
"$LIB_DIR"/xtables/libip6t_dst.so
"$LIB_DIR"/xtables/libip6t_eui64.so
"$LIB_DIR"/xtables/libip6t_frag.so
"$LIB_DIR"/xtables/libip6t_hbh.so
"$LIB_DIR"/xtables/libip6t_hl.so
"$LIB_DIR"/xtables/libip6t_HL.so
"$LIB_DIR"/xtables/libip6t_icmp6.so
"$LIB_DIR"/xtables/libip6t_ipv6header.so
"$LIB_DIR"/xtables/libip6t_LOG.so
"$LIB_DIR"/xtables/libip6t_mh.so
"$LIB_DIR"/xtables/libip6t_REJECT.so
"$LIB_DIR"/xtables/libip6t_rt.so
"$LIB_DIR"/xtables/libip6t_DNAT.so
"$LIB_DIR"/xtables/libip6t_DNPT.so
"$LIB_DIR"/xtables/libip6t_MASQUERADE.so
"$LIB_DIR"/xtables/libip6t_NETMAP.so
"$LIB_DIR"/xtables/libip6t_REDIRECT.so
"$LIB_DIR"/xtables/libip6t_SNAT.so
"$LIB_DIR"/xtables/libip6t_SNPT.so
fi
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 # Reduce the image size by various operations
if [ "$ENABLE_REDUCE" = true ] ; then
if [ "$REDUCE_APT" = true ] ; then
# Install dpkg configuration file
if [ "$REDUCE_DOC" = true ] || [ "$REDUCE_MAN" = true ] ; then
drtyhlpr
Added Raspberry Pi 3 model support
r94 install_readonly files/dpkg/01nodoc "${ETC_DIR}/dpkg/dpkg.cfg.d/01nodoc"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Install APT configuration files
drtyhlpr
Added Raspberry Pi 3 model support
r94 install_readonly files/apt/02nocache "${ETC_DIR}/apt/apt.conf.d/02nocache"
install_readonly files/apt/03compress "${ETC_DIR}/apt/apt.conf.d/03compress"
install_readonly files/apt/04norecommends "${ETC_DIR}/apt/apt.conf.d/04norecommends"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76
# Remove APT cache files
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 rm -fr "${R}/var/cache/apt/pkgcache.bin"
rm -fr "${R}/var/cache/apt/srcpkgcache.bin"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Remove all doc files
if [ "$REDUCE_DOC" = true ] ; then
Unknown
fixes...
r338 find "${R}/usr/share/doc" -depth -type f ! -name copyright -print0 | xargs -0 rm || true
find "${R}/usr/share/doc" -empty -print0 | xargs -0 rmdir || true
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Remove all man pages and info files
if [ "$REDUCE_MAN" = true ] ; then
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 rm -rf "${R}/usr/share/man" "${R}/usr/share/groff" "${R}/usr/share/info" "${R}/usr/share/lintian" "${R}/usr/share/linda" "${R}/var/cache/man"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Remove all locale translation files
if [ "$REDUCE_LOCALE" = true ] ; then
Unknown
fixes...
r338 find "${R}/usr/share/locale" -mindepth 1 -maxdepth 1 ! -name 'en' -print0 | xargs -0 rm -r
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Remove hwdb PCI device classes (experimental)
if [ "$REDUCE_HWDB" = true ] ; then
rm -fr "/lib/udev/hwdb.d/20-pci-*"
fi
# Replace bash shell by dash shell (experimental)
if [ "$REDUCE_BASH" = true ] ; then
Unknown
its bin/sh again...
r384 # Purge bash and update alternatives
echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --allow-remove-essential bash
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 chroot_exec update-alternatives --install /bin/bash bash /bin/dash 100
fi
# Remove sound utils and libraries
if [ "$ENABLE_SOUND" = false ] ; then
0
Sound is part of BT dependency - keep it if used...
r745 if [ "$ENABLE_BLUETOOTH" = false ] ; then
chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
else
chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0
fi
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
# Remove GPU kernels
if [ "$ENABLE_MINGPU" = true ] ; then
drtyhlpr
Added Raspberry Pi 3 model support
r94 rm -f "${BOOT_DIR}/start.elf"
rm -f "${BOOT_DIR}/fixup.dat"
rm -f "${BOOT_DIR}/start_x.elf"
rm -f "${BOOT_DIR}/fixup_x.dat"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 fi
Jan Wagner
Added: ENABLE_CRYPTFS - encrypted rootfs, use-latest-bootloader, cp-cleanup
r77 # Remove kernel and initrd from /boot (already in /boot/firmware)
if [ "$BUILD_KERNEL" = false ] ; then
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 rm -f "${R}/boot/vmlinuz-*"
rm -f "${R}/boot/initrd.img-*"
Jan Wagner
Added: ENABLE_CRYPTFS - encrypted rootfs, use-latest-bootloader, cp-cleanup
r77 fi
0
Sound is part of BT dependency - keep it if used...
r745
#Reduce BOOT
#Only necessary files for my gen pi
Jan Wagner
Added: ENABLE_CRYPTFS - encrypted rootfs, use-latest-bootloader, cp-cleanup
r77
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 # Clean APT list of repositories
Jan Wagner
fix: ENABLE_CRYPTFS -> UBOOT, SPLITFS, EXPANDROOT - cleanup
r82 rm -fr "${R}/var/lib/apt/lists/*"
Jan Wagner
Added: KERNEL_REDUCE - less than 128MB used space, Added: REDUCE_ parameters
r76 chroot_exec apt-get -qq -y update
fi