##// END OF EJS Templates
Refactor...
Refactor Use RPI_MODEL and SET_ARCH to define all board relevant settings, crosscompilers, architectures etc... - SET_ARCH=32 is default and used for all boards in 32bit mode - SET_ARCH=64 and RPI_MODEL=3 or 3P activate 64bit mode! - no need to set CROSS_COMPILE, KERNEL_IMAGE, RELEASE_ARCH, KERNEL_DEFCONFIG, KERNEL_ARCH, QEMU_BINARY - build kernel is now a default. i kicked out old kernel v3 and jessie support! they're too old. set buster as default - autodetect if program is running on 3142 => assume it is apt-cacher-ng and set APT_PROXY - next pull includes sakaki kernel for RPI3 and RPi3B+ => see https://github.com/sakaki-/bcmrpi3-kernel-bis

Fichier de la dernière révision:

r338:5dd9ea36ae5f
r375:a90f6ad1a83f
Show More
99-reduce.sh
85 lines | 2.8 KiB | application/x-sh | BashLexer
#
# Reduce system disk usage
#
# Load utility functions
. ./functions.sh
# 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
install_readonly files/dpkg/01nodoc "${ETC_DIR}/dpkg/dpkg.cfg.d/01nodoc"
fi
# Install APT configuration files
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"
# Remove APT cache files
rm -fr "${R}/var/cache/apt/pkgcache.bin"
rm -fr "${R}/var/cache/apt/srcpkgcache.bin"
fi
# Remove all doc files
if [ "$REDUCE_DOC" = true ] ; then
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
fi
# Remove all man pages and info files
if [ "$REDUCE_MAN" = true ] ; then
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"
fi
# Remove all locale translation files
if [ "$REDUCE_LOCALE" = true ] ; then
find "${R}/usr/share/locale" -mindepth 1 -maxdepth 1 ! -name 'en' -print0 | xargs -0 rm -r
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
if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then
echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --allow-remove-essential bash
else
echo "Yes, do as I say!" | chroot_exec apt-get purge -qq -y --force-yes bash
fi
chroot_exec update-alternatives --install /bin/bash bash /bin/dash 100
fi
# Remove sound utils and libraries
if [ "$ENABLE_SOUND" = false ] ; then
chroot_exec apt-get -qq -y purge alsa-utils libsamplerate0 libasound2 libasound2-data
fi
# Re-install tools for managing kernel modules
if [ "$RELEASE" = "jessie" ] ; then
chroot_exec apt-get -qq -y install module-init-tools
fi
# Remove GPU kernels
if [ "$ENABLE_MINGPU" = true ] ; then
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"
fi
# Remove kernel and initrd from /boot (already in /boot/firmware)
if [ "$BUILD_KERNEL" = false ] ; then
rm -f "${R}/boot/vmlinuz-*"
rm -f "${R}/boot/initrd.img-*"
fi
# Clean APT list of repositories
rm -fr "${R}/var/lib/apt/lists/*"
chroot_exec apt-get -qq -y update
fi