From 2b270da25ecaefd4e61d00e9f89314fd9f6bca6a 2018-11-12 23:45:14 From: burnbabyburn Date: 2018-11-12 23:45:14 Subject: [PATCH] Merge branch 'ref+fix' of https://github.com/burnbabyburn/rpi23-gen-image into ref+fix --- diff --git a/bootstrap.d/11-apt.sh b/bootstrap.d/11-apt.sh index df7e5d7..1ead2e2 100644 --- a/bootstrap.d/11-apt.sh +++ b/bootstrap.d/11-apt.sh @@ -16,18 +16,22 @@ if [ "$BUILD_KERNEL" = false ] ; then echo "Downloading precompiled kernel" echo "error: not configured" exit 1; -else # BUILD_KERNEL=true - #autconfigure best apt server to not spam ftp.debian.org - #rm files/apt/sources.list - #netselect-apt does not know buster yet - if [ "$RELEASE" = "buster" ] ; then - RELEASE=${RELEASE:=testing} - fi - netselect_string=${netselect_string:=""} - if [ "$ENABLE_NONFREE" = true ] ; then - netselect-apt --arch "$RELEASE_ARCH" --sources "$netselect_string" --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS" - fi - netselect-apt --arch "$RELEASE_ARCH" --sources "$netselect_string" --outfile "${ETC_DIR}/apt/sources.list" -d "$RLS" +# BUILD_KERNEL=true +else + echo "No precompiled kernel repositories were added" +fi + +#autconfigure best apt server to not spam ftp.debian.org +#rm files/apt/sources.list +#netselect-apt does not know buster yet +if [ "$RELEASE" = "buster" ] ; then + RELEASE=${RELEASE:=testing} +fi + +if [ "$ENABLE_NONFREE" = true ] ; then + netselect-apt --arch "$RELEASE_ARCH" --sources --nonfree --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" +else + netselect-apt --arch "$RELEASE_ARCH" --sources --outfile "${ETC_DIR}/apt/sources.list" -d "$RELEASE" fi # Upgrade package index and update all installed packages and changed dependencies @@ -46,4 +50,4 @@ if [ -d packages ] ; then fi chroot_exec apt-get -qq -y -f install -chroot_exec apt-get -qq -y check +chroot_exec apt-get -qq -y check \ No newline at end of file diff --git a/bootstrap.d/21-firewall.sh b/bootstrap.d/21-firewall.sh index 25b64c6..4a91cdc 100644 --- a/bootstrap.d/21-firewall.sh +++ b/bootstrap.d/21-firewall.sh @@ -10,13 +10,12 @@ if [ "$ENABLE_IPTABLES" = true ] ; then # Create iptables configuration directory mkdir -p "${ETC_DIR}/iptables" - #In Jessie iptables is old enough - if ! [ "$RELEASE" = jessie ] ; then # make sure iptables-legacy,iptables-legacy-restore and iptables-legacy-save are the used alternatives chroot_exec update-alternatives --verbose --set iptables /usr/sbin/iptables-legacy #chroot_exec update-alternatives --verbose --set iptables-save /usr/sbin/iptables-legacy-save #chroot_exec update-alternatives --verbose --set iptables-restore /usr/sbin/iptables-legacy-restore - fi + chroot_exec update-alternatives --verbose --install /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-legacy-save 1 + chroot_exec update-alternatives --verbose --install /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-legacy-restore 1 # Install iptables systemd service install_readonly files/iptables/iptables.service "${ETC_DIR}/systemd/system/iptables.service" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 46aed98..a074905 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -188,7 +188,7 @@ CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} # Packages required in the chroot build environment APT_INCLUDES=${APT_INCLUDES:=""} -APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils" +APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup" # Packages required for bootstrapping REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo" @@ -452,11 +452,6 @@ if [ "$ENABLE_MINBASE" = true ] ; then APT_INCLUDES="${APT_INCLUDES},vim-tiny,netbase,net-tools,ifupdown" fi -# Add required locales packages -if [ "$DEFLOCAL" != "en_US.UTF-8" ] || { [ -n "$XKB_MODEL" ] || [ -n "$XKB_LAYOUT" ] || [ -n "$XKB_VARIANT" ] || [ -n "$XKB_OPTIONS" ] ; } ; then - APT_INCLUDES="${APT_INCLUDES},locales,keyboard-configuration,console-setup" -fi - # Add parted package, required to get partprobe utility if [ "$EXPANDROOT" = true ] ; then APT_INCLUDES="${APT_INCLUDES},parted"