diff --git a/bare_image.sh b/bare_image.sh index d0a86fb4bb1b240e49902e3a84a7202700c62b94..6a440f6b79dd07f2327e4fe760d46a119e42e976 100755 --- a/bare_image.sh +++ b/bare_image.sh @@ -70,6 +70,7 @@ minimal_armel () { include_firmware="${include_firmware}" + chroot_very_small_image="${chroot_very_small_image}" chroot_enable_localepurge="${chroot_enable_localepurge}" chroot_enable_deborphan="${chroot_enable_deborphan}" chroot_enable_hardlink="${chroot_enable_hardlink}" @@ -147,7 +148,8 @@ is_debian () { deb_components="main contrib non-free" pkg_list - exclude_pkgs_list="aptitude,aptitude-common,info,install-info,libept1.4.12,manpages,man-db,tasksel,tasksel-data,wget" + exclude_pkgs_list="aptitude,aptitude-common,info,install-info,libept1.4.12,manpages,man-db,tasksel,tasksel-data,vim-common,vim-tiny,wget,whiptail" + chroot_very_small_image="enable" chroot_enable_localepurge="enable" chroot_enable_deborphan="enable" # chroot_enable_hardlink="enable" diff --git a/base_image.sh b/base_image.sh index 24ad40fc5f5198f30e381d549d06193a9ffbb9b8..8b223b7c9f4a1d48f138f5c1650cb7c4c7181108 100755 --- a/base_image.sh +++ b/base_image.sh @@ -70,6 +70,7 @@ minimal_armel () { include_firmware="${include_firmware}" + chroot_very_small_image="${chroot_very_small_image}" chroot_enable_localepurge="${chroot_enable_localepurge}" chroot_enable_deborphan="${chroot_enable_deborphan}" chroot_enable_hardlink="${chroot_enable_hardlink}" @@ -148,6 +149,7 @@ is_debian () { pkg_list exclude_pkgs_list="" +# chroot_very_small_image="enable" # chroot_enable_localepurge="enable" # chroot_enable_deborphan="enable" # chroot_enable_hardlink="enable" diff --git a/build_image.sh b/build_image.sh index 6595dcd856b4343259d35d03d34801a347652ebf..76449b540b621d0f513943c90e8f56240b9a0fd9 100755 --- a/build_image.sh +++ b/build_image.sh @@ -83,6 +83,7 @@ minimal_armel () { include_firmware="${include_firmware}" + chroot_very_small_image="${chroot_very_small_image}" chroot_enable_localepurge="${chroot_enable_localepurge}" chroot_enable_deborphan="${chroot_enable_deborphan}" chroot_enable_hardlink="${chroot_enable_hardlink}" @@ -197,6 +198,7 @@ is_debian () { pkg_list exclude_pkgs_list="" +# chroot_very_small_image="enable" # chroot_enable_localepurge="enable" # chroot_enable_deborphan="enable" # chroot_enable_hardlink="enable" diff --git a/scripts/chroot.sh b/scripts/chroot.sh index 728b416f4f3ad41450bd21626a72e5c1a05d6533..773de23f0112296a9fdc6862831d857879dc8181 100755 --- a/scripts/chroot.sh +++ b/scripts/chroot.sh @@ -141,6 +141,25 @@ sudo chroot ${tempdir} debootstrap/debootstrap --second-stage echo "Log: Complete: [sudo chroot ${tempdir} debootstrap/debootstrap --second-stage]" report_size +if [ "x${chroot_very_small_image}" = "xenable" ] ; then + #so debootstrap just extracts the *.deb's, so lets clean this up hackish now, + #but then allow dpkg to delete these extra files when installed later.. + sudo rm -rf ${tempdir}/usr/share/locale/* || true + sudo rm -rf ${tempdir}/usr/share/man/* || true + + #dpkg 1.15.8++ + mkdir -p ${tempdir}/etc/dpkg/dpkg.cfg.d/ + sudo sh -c "echo \"# Delete locales\" > ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + sudo sh -c "echo \"path-exclude=/usr/share/locale/*\" >> ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + sudo sh -c "echo \"\" >> ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + sudo sh -c "echo \"# Delete translated man pages\" >> ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + sudo sh -c "echo \"path-exclude=/usr/share/man/*\" >> ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + sudo sh -c "echo \"\" >> ${tempdir}/etc/dpkg/dpkg.cfg.d/excludes" + + echo "Log: after locale/man purge" + report_size +fi + file="${tempdir}/etc/apt/sources.list" case "${release}" in wheezy) @@ -284,9 +303,8 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ } install_chroot_pkgs () { - apt-get update - if [ "x${chroot_no_lsb_release}" = "x" ] ; then + apt-get update packages="lsb-release" for pkg in \${packages} ; do check_n_install ; done @@ -510,6 +528,10 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ if [ -f /etc/apt/apt.conf ] ; then rm -rf /etc/apt/apt.conf || true fi + if [ "x${chroot_very_small_image}" = "xenable" ] ; then + #if your flash is already small, the apt cache might overfill it so drop src... + sed -i -e 's:deb-src:#deb-src:g' /etc/apt/sources.list + fi apt-get update apt-get clean @@ -537,7 +559,9 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ packages="initramfs-tools u-boot-tools wget" for pkg in \${packages} ; do check_n_install ; done fi - set_locale + if [ "x${chroot_very_small_image}" = "x" ] ; then + set_locale + fi if [ "x${chroot_enable_deborphan}" = "xenable" ] ; then run_deborphan fi