diff --git a/banana-pi.sh b/banana-pi.sh index 02735c4..1011879 100755 --- a/banana-pi.sh +++ b/banana-pi.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -275,7 +275,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -290,10 +290,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -301,18 +300,17 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Enable the serial console echo "T1:12345:respawn:/sbin/agetty -L ttyS0 115200 vt100" >> ${work_dir}/etc/inittab # Load the ethernet module since it doesn't load automatically at boot. echo "sunxi_emac" >> ${work_dir}/etc/modules -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -413,7 +411,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}" diff --git a/banana-pro.sh b/banana-pro.sh index 866059a..3546f21 100755 --- a/banana-pro.sh +++ b/banana-pro.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -285,7 +285,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -300,10 +300,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -311,11 +310,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -413,7 +411,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/bbb.sh b/bbb.sh index ac05d21..8496054 100755 --- a/bbb.sh +++ b/bbb.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -291,7 +291,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -306,10 +306,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -317,11 +316,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -539,7 +537,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/chromebook-arm-exynos.sh b/chromebook-arm-exynos.sh index 1776ee8..745b8d4 100755 --- a/chromebook-arm-exynos.sh +++ b/chromebook-arm-exynos.sh @@ -28,7 +28,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -274,7 +274,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -289,10 +289,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -300,11 +299,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -742,7 +740,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/chromebook-arm-nyan.sh b/chromebook-arm-nyan.sh index 50bd136..8da8c8b 100755 --- a/chromebook-arm-nyan.sh +++ b/chromebook-arm-nyan.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -278,7 +278,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -293,10 +293,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -304,11 +303,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -649,7 +647,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/chromebook-arm-veyron.sh b/chromebook-arm-veyron.sh index b6bb00b..e4f1479 100755 --- a/chromebook-arm-veyron.sh +++ b/chromebook-arm-veyron.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -271,7 +271,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -286,10 +286,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -297,17 +296,16 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF > ${work_dir}/etc/resolv.conf nameserver 8.8.8.8 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -613,7 +611,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}" diff --git a/cubieboard2.sh b/cubieboard2.sh index b0fee05..774e53f 100755 --- a/cubieboard2.sh +++ b/cubieboard2.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -280,7 +280,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -295,10 +295,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -306,16 +305,15 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Load the ethernet module since it doesn't load automatically at boot. echo "sunxi_emac" >> ${work_dir}/etc/modules -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -471,7 +469,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/cubietruck.sh b/cubietruck.sh index 2a13bb7..bfbb1fc 100755 --- a/cubietruck.sh +++ b/cubietruck.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -280,7 +280,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -295,10 +295,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -306,16 +305,15 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Load the ethernet module since it doesn't load automatically at boot. echo "sunxi_gmac" >> ${work_dir}/etc/modules -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -469,7 +467,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/cubox-i.sh b/cubox-i.sh index 3d58963..2713019 100755 --- a/cubox-i.sh +++ b/cubox-i.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -288,7 +288,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -303,10 +303,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -314,11 +313,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -437,7 +435,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/cubox.sh b/cubox.sh index a499d06..3e61dc4 100755 --- a/cubox.sh +++ b/cubox.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -282,7 +282,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -297,10 +297,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -308,11 +307,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -474,7 +472,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/gateworks_ventana.sh b/gateworks_ventana.sh index a770212..e2010b2 100755 --- a/gateworks_ventana.sh +++ b/gateworks_ventana.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -324,7 +324,7 @@ EOF systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -339,10 +339,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -350,18 +349,16 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi # Enable serial console echo 'T1:12345:respawn:/sbin/getty -L ttymxc1 115200 vt100' >> \ ${work_dir}/etc/inittab -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -503,7 +500,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/kalitap.sh b/kalitap.sh index f69648e..c41134d 100755 --- a/kalitap.sh +++ b/kalitap.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -280,7 +280,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -295,10 +295,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -306,6 +305,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttyO0 c 5 1 EOF @@ -314,13 +319,6 @@ cat << EOF >> ${work_dir}/etc/securetty ttyO0 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -500,7 +498,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/luna.sh b/luna.sh index d8ff33a..0ace993 100755 --- a/luna.sh +++ b/luna.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -279,7 +279,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -294,10 +294,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -305,6 +304,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttyO0 c 5 1 EOF @@ -313,13 +318,6 @@ cat << EOF >> ${work_dir}/etc/securetty ttyO0 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -465,7 +463,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/mini-x.sh b/mini-x.sh index 64fa3dc..bde0d84 100755 --- a/mini-x.sh +++ b/mini-x.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -285,7 +285,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -300,10 +300,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -311,11 +310,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -414,7 +412,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up temporary build system" rm -rf "${basedir}" diff --git a/nanopi2.sh b/nanopi2.sh index 28f210a..602e995 100755 --- a/nanopi2.sh +++ b/nanopi2.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -292,7 +292,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -307,10 +307,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -318,11 +317,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -556,7 +554,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" rm -rf "${basedir}" diff --git a/nanopi3.sh b/nanopi3.sh index 78c8d0a..fd90eff 100755 --- a/nanopi3.sh +++ b/nanopi3.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -302,7 +302,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -317,10 +317,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -328,18 +327,16 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF > ${work_dir}/etc/resolv.conf nameserver 8.8.8.8 EOF - -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -520,7 +517,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}" diff --git a/nanopineoplus2-minimal.sh b/nanopineoplus2-minimal.sh index dc24df4..dd8fe19 100755 --- a/nanopineoplus2-minimal.sh +++ b/nanopineoplus2-minimal.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -387,7 +387,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -402,10 +402,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -413,17 +412,16 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF > ${work_dir}/etc/resolv.conf nameserver 8.8.8.8 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -644,7 +642,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" rm -rf "${basedir}" diff --git a/nanopineoplus2.sh b/nanopineoplus2.sh index bf3d741..6d3a7f5 100755 --- a/nanopineoplus2.sh +++ b/nanopineoplus2.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -385,7 +385,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -400,10 +400,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -411,17 +410,16 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF > kali-${architecture}/etc/resolv.conf nameserver 8.8.8.8 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -633,7 +631,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}" diff --git a/odroid-c.sh b/odroid-c.sh index dafe0fe..a8db89d 100755 --- a/odroid-c.sh +++ b/odroid-c.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -287,7 +287,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -302,10 +302,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -313,11 +312,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -677,7 +675,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" rm -rf "${basedir}" diff --git a/odroid-c2.sh b/odroid-c2.sh index cad9031..50fbe3c 100755 --- a/odroid-c2.sh +++ b/odroid-c2.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -289,7 +289,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -304,10 +304,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -315,11 +314,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -492,7 +490,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}" diff --git a/odroid-u2.sh b/odroid-u2.sh index a9bc83b..e9f7e6a 100755 --- a/odroid-u2.sh +++ b/odroid-u2.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -287,7 +287,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -302,10 +302,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -313,11 +312,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -520,7 +518,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Clean up the build system" rm -rf "${basedir}" diff --git a/odroid-w-devkit.sh b/odroid-w-devkit.sh index d94bb50..881c081 100755 --- a/odroid-w-devkit.sh +++ b/odroid-w-devkit.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -325,7 +325,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -340,10 +340,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -351,11 +350,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -494,7 +492,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/odroid-w.sh b/odroid-w.sh index 8b59392..63691c0 100755 --- a/odroid-w.sh +++ b/odroid-w.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -325,7 +325,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -340,10 +340,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -351,6 +350,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Create cmdline.txt file cat << EOF > ${work_dir}/boot/cmdline.txt dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=$fstype rootwait rootflags=noload net.ifnames=0 @@ -364,13 +369,6 @@ proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -471,7 +469,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/odroid-xu3.sh b/odroid-xu3.sh index 0b46c53..9d52e84 100755 --- a/odroid-xu3.sh +++ b/odroid-xu3.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -288,7 +288,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -303,10 +303,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -314,6 +313,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttySAC2 c 5 1 EOF @@ -324,13 +329,6 @@ ttySAC1 ttySAC2 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -521,7 +519,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/pinebook-pro.sh b/pinebook-pro.sh index 1937924..dbe43ba 100755 --- a/pinebook-pro.sh +++ b/pinebook-pro.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -280,7 +280,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -295,10 +295,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -306,11 +305,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list diff --git a/pinebook.sh b/pinebook.sh index 6cf357b..460e5da 100755 --- a/pinebook.sh +++ b/pinebook.sh @@ -31,7 +31,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -335,7 +335,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -350,10 +350,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -361,6 +360,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Set up some defaults for chromium, if the user ever installs it mkdir -p ${work_dir}/etc/chromium/ cat << EOF > ${work_dir}/etc/chromium/default @@ -375,13 +380,6 @@ CHROMIUM_FLAGS="\ " EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -493,7 +491,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/riot.sh b/riot.sh index 1380f9a..4ba0640 100755 --- a/riot.sh +++ b/riot.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -316,7 +316,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -331,10 +331,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -342,6 +341,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttymxc1 c 5 1 EOF @@ -359,13 +364,6 @@ proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot vfat defaults 0 2 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -487,7 +485,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" rm -rf "${basedir}" diff --git a/rpi.sh b/rpi.sh index 52fdf8d..20d1ef0 100755 --- a/rpi.sh +++ b/rpi.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -236,7 +236,7 @@ eatmydata apt-get install -y \$aptops ${packages} || eatmydata apt-get --yes --f eatmydata apt-get install -y \$aptops ${desktop} ${extras} ${tools} || eatmydata apt-get --yes --fix-broken install eatmydata apt-get install -y \$aptops ${desktop} ${extras} ${tools} || eatmydata apt-get --yes --fix-broken install eatmydata apt-get install -y \$aptops --autoremove systemd-timesyncd || eatmydata apt-get --yes --fix-broken install -eatmydata apt-get dist-upgrade -y \$aptops +eatmydata apt-get dist-upgrade -y \$aptops eatmydata apt-get --yes --allow-change-held-packages --purge autoremove @@ -312,7 +312,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -327,10 +327,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -338,11 +337,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -455,7 +453,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/rpi0w-nexmon-minimal.sh b/rpi0w-nexmon-minimal.sh index b8e35ee..07a33e9 100755 --- a/rpi0w-nexmon-minimal.sh +++ b/rpi0w-nexmon-minimal.sh @@ -33,7 +33,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -350,7 +350,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -365,10 +365,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -376,11 +375,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -494,7 +492,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/rpi0w-nexmon-p4wnp1-aloa.sh b/rpi0w-nexmon-p4wnp1-aloa.sh index 5ebfb32..e65dcd6 100755 --- a/rpi0w-nexmon-p4wnp1-aloa.sh +++ b/rpi0w-nexmon-p4wnp1-aloa.sh @@ -38,7 +38,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -316,31 +316,44 @@ if [[ $? > 0 ]]; then exit 1 fi -cat << EOF > kali-${architecture}/cleanup -#!/bin/bash -rm -rf /root/.bash_history -rm -rf /root/P4wnP1_go -apt-get update -apt-get clean +# Clean system +systemd-nspawn_exec << 'EOF' rm -f /0 -rm -f /hs_err* -rm -f cleanup -rm -f /usr/bin/qemu* +rm -rf /bsp +fc-cache -frs +rm -rf /tmp/* +rm -rf /etc/*- +rm -rf /hs_err* +rm -rf /userland +rm -rf /opt/vc/src +rm -f /etc/ssh/ssh_host_* +rm -rf /var/lib/dpkg/*-old +rm -rf /var/lib/apt/lists/* +rm -rf /var/cache/apt/*.bin +rm -rf /var/cache/apt/archives/* +rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done +history -c EOF +# Disable the use of http proxy in case it is enabled. +if [ -n "$proxy_url" ]; then + unset http_proxy + rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy +fi + +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + chmod 755 kali-${architecture}/cleanup LANG=C systemd-nspawn -M ${machine} -D kali-${architecture} /cleanup # Enable login over serial echo "T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100" >> ${work_dir}/etc/inittab -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -584,7 +597,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/rpi0w-nexmon.sh b/rpi0w-nexmon.sh index f2ceced..d12be7c 100755 --- a/rpi0w-nexmon.sh +++ b/rpi0w-nexmon.sh @@ -33,7 +33,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -211,7 +211,7 @@ export DEBIAN_FRONTEND=noninteractive eatmydata apt-get update -eatmydata apt-get -y install binutils ca-certificates console-common git initramfs-tools less locales nano u-boot-tools +eatmydata apt-get -y install binutils ca-certificates console-common git initramfs-tools less locales nano u-boot-tools # Create kali user with kali password... but first, we need to manually make some groups because they don't yet exist... # This mirrors what we have on a pre-installed VM, until the script works properly to allow end users to set up their own... user. @@ -344,7 +344,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -359,10 +359,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -370,11 +369,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -483,7 +481,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/rpi3-64-lite.sh b/rpi3-64-lite.sh index 0b36608..3d63182 100755 --- a/rpi3-64-lite.sh +++ b/rpi3-64-lite.sh @@ -322,7 +322,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -337,10 +337,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then diff --git a/rpi3-64.sh b/rpi3-64.sh index 0f160ed..d78c9e2 100755 --- a/rpi3-64.sh +++ b/rpi3-64.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -241,7 +241,7 @@ install -m755 /bsp/scripts/monstop /usr/bin/ # Resize rootfs script install -m755 /bsp/scripts/rpi-resizerootfs /usr/sbin/ -# Add rpi userland to the path (e.g. vcgencmd) +# Add rpi userland to the path (e.g. vcgencmd) install -m644 /bsp/configs/raspi-userland.conf /etc/ld.so.conf.d/ install -m644 /bsp/configs/vc.sh /etc/profile.d/vc.sh install -m644 /bsp/udev/99-vchiq-permissions.rules /etc/udev/rules.d/ @@ -326,7 +326,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -341,10 +341,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -352,11 +351,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -495,7 +493,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/rpi3-nexmon.sh b/rpi3-nexmon.sh index 26248ae..872f5e3 100755 --- a/rpi3-nexmon.sh +++ b/rpi3-nexmon.sh @@ -29,7 +29,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -308,7 +308,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -323,10 +323,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -334,6 +333,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + # Create cmdline.txt file cat << EOF > ${work_dir}/boot/cmdline.txt dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=$fstype rootwait rootflags=noload net.ifnames=0 @@ -348,13 +353,6 @@ proc /proc proc defaults 0 0 /dev/mmcblk0p2 / $fstype defaults,noatime 0 1 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -461,7 +459,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Cleaning up the temporary build files..." rm -rf "${basedir}" diff --git a/trimslice.sh b/trimslice.sh index a8cc173..bc13df4 100755 --- a/trimslice.sh +++ b/trimslice.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -251,7 +251,7 @@ eatmydata apt-get install -y \$aptops ${packages} || eatmydata apt-get --yes --f eatmydata apt-get install -y \$aptops ${desktop} ${extras} ${tools} || eatmydata apt-get --yes --fix-broken install eatmydata apt-get install -y \$aptops ${desktop} ${extras} ${tools} || eatmydata apt-get --yes --fix-broken install eatmydata apt-get install -y \$aptops --autoremove systemd-timesyncd || eatmydata apt-get --yes --fix-broken install -eatmydata apt-get dist-upgrade -y \$aptops +eatmydata apt-get dist-upgrade -y \$aptops # Install the kernel here. This is due to needing to fake being an arm device for flash-kernel to work properly. cd /root && gcc -Wall -shared -o libfakeuname.so fakeuname.c @@ -314,7 +314,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -329,10 +329,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -340,6 +339,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttyS0 c 5 1 EOF @@ -357,13 +362,6 @@ proc /proc proc defaults 0 0 /dev/mmcblk0p1 /boot ext2 defaults 0 2 EOF -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling -fi - # Define sources.list cat << EOF > ${work_dir}/etc/apt/sources.list deb ${mirror} ${suite} ${components//,/ } @@ -458,6 +456,5 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. rm -rf "${basedir}" diff --git a/usbarmory-mk2.sh b/usbarmory-mk2.sh index a13c132..190fc4c 100644 --- a/usbarmory-mk2.sh +++ b/usbarmory-mk2.sh @@ -279,7 +279,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -294,10 +294,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then diff --git a/usbarmory.sh b/usbarmory.sh index b85bb0d..624e67a 100755 --- a/usbarmory.sh +++ b/usbarmory.sh @@ -29,11 +29,11 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url -githubraw="https://raw.githubusercontent.com" +githubraw="$githubraw" # Check EUID=0 you can run any binary as root. if [[ $EUID -ne 0 ]]; then @@ -279,7 +279,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -294,10 +294,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -305,11 +304,10 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi -# Mirror replacement -if [[ ! -z "${@:5}" || "$suite" != "kali-rolling" ]]; then - mirror=${@:5} - [ ! -z "${@:5}" ] || mirror="http://http.kali.org/kali" - [ "$suite" != "kali-rolling" ] && suite=kali-rolling +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} fi # Define sources.list @@ -480,12 +478,12 @@ export ARCH=arm export CROSS_COMPILE=arm-linux-gnueabihf- patch -p1 --no-backup-if-mismatch < ${current_dir}/patches/kali-wifi-injection-4.14.patch patch -p1 --no-backup-if-mismatch < ${current_dir}/patches/0001-wireless-carl9170-Enable-sniffer-mode-promisc-flag-t.patch -#wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/usbarmory_linux-4.14.config -O .config -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-host.dts -O arch/arm/boot/dts/imx53-usbarmory-host.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-gpio.dts -O arch/arm/boot/dts/imx53-usbarmory-gpio.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-spi.dts -O arch/arm/boot/dts/imx53-usbarmory-spi.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-i2c.dts -O arch/arm/boot/dts/imx53-usbarmory-i2c.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-scc2.dts -O arch/arm/boot/dts/imx53-usbarmory-scc2.dts +#wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/usbarmory_linux-4.14.config -O .config +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-host.dts -O arch/arm/boot/dts/imx53-usbarmory-host.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-gpio.dts -O arch/arm/boot/dts/imx53-usbarmory-gpio.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-spi.dts -O arch/arm/boot/dts/imx53-usbarmory-spi.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-i2c.dts -O arch/arm/boot/dts/imx53-usbarmory-i2c.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-scc2.dts -O arch/arm/boot/dts/imx53-usbarmory-scc2.dts cp ${current_dir}/kernel-configs/usbarmory-4.14.config ${work_dir}/usr/src/kernel/.config cp ${current_dir}/kernel-configs/usbarmory-4.14.config ${work_dir}/usr/src/usbarmory-4.14.config make LOADADDR=0x70008000 -j $(grep -c processor /proc/cpuinfo) uImage modules imx53-usbarmory-gpio.dtb imx53-usbarmory-i2c.dtb imx53-usbarmory-spi.dtb imx53-usbarmory.dtb imx53-usbarmory-host.dtb imx53-usbarmory-scc2.dtb @@ -495,11 +493,11 @@ cp arch/arm/boot/dts/imx53-usbarmory*.dtb ${work_dir}/boot/ make mrproper # Since these aren't integrated into the kernel yet, mrproper removes them. cp ${current_dir}/kernel-configs/usbarmory-4.14.config ${work_dir}/usr/src/kernel/.config -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-host.dts -O arch/arm/boot/dts/imx53-usbarmory-host.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-gpio.dts -O arch/arm/boot/dts/imx53-usbarmory-gpio.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-spi.dts -O arch/arm/boot/dts/imx53-usbarmory-spi.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-i2c.dts -O arch/arm/boot/dts/imx53-usbarmory-i2c.dts -wget https://raw.githubusercontent.com/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-scc2.dts -O arch/arm/boot/dts/imx53-usbarmory-scc2.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-host.dts -O arch/arm/boot/dts/imx53-usbarmory-host.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-gpio.dts -O arch/arm/boot/dts/imx53-usbarmory-gpio.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-spi.dts -O arch/arm/boot/dts/imx53-usbarmory-spi.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-i2c.dts -O arch/arm/boot/dts/imx53-usbarmory-i2c.dts +wget $githubraw/inversepath/usbarmory/master/software/kernel_conf/mark-one/imx53-usbarmory-scc2.dts -O arch/arm/boot/dts/imx53-usbarmory-scc2.dts # Fix up the symlink for building external modules @@ -599,7 +597,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing build directory" rm -rf "${basedir}" diff --git a/utilite.sh b/utilite.sh index 85aa04d..4095592 100755 --- a/utilite.sh +++ b/utilite.sh @@ -32,7 +32,7 @@ compress="xz" # Choose filesystem format to format ( ext3 or ext4 ) fstype="ext3" # If you have your own preferred mirrors, set them here. -mirror=${4:-"http://http.kali.org/kali"} +mirror=${mirror:-"http://http.kali.org/kali"} # Gitlab url Kali repository kaligit="https://gitlab.com/kalilinux" # Github raw url @@ -284,7 +284,7 @@ systemd-nspawn_exec /third-stage systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg # Clean system -systemd-nspawn_exec << EOF +systemd-nspawn_exec << 'EOF' rm -f /0 rm -rf /bsp fc-cache -frs @@ -299,10 +299,9 @@ rm -rf /var/lib/apt/lists/* rm -rf /var/cache/apt/*.bin rm -rf /var/cache/apt/archives/* rm -rf /var/cache/debconf/*.data-old +for logs in $(find /var/log -type f); do > $logs; done history -c EOF -#Clear all logs -for logs in `find $work_dir/var/log -type f`; do > $logs; done # Disable the use of http proxy in case it is enabled. if [ -n "$proxy_url" ]; then @@ -310,6 +309,12 @@ if [ -n "$proxy_url" ]; then rm -rf ${work_dir}/etc/apt/apt.conf.d/66proxy fi +# Mirror & suite replacement +if [[ ! -z "${4}" || ! -z "${5}" ]]; then + mirror=${4} + suite=${5} +fi + cat << EOF >> ${work_dir}/etc/udev/links.conf M ttymxc3 c 5 1 EOF @@ -494,7 +499,6 @@ else fi # Clean up all the temporary build stuff and remove the directories. -# Comment this out to keep things around if you want to see what may have gone -# wrong. +# Comment this out to keep things around if you want to see what may have gone wrong. echo "Removing temporary build files" -rm -rf "${basedir}" \ No newline at end of file +rm -rf "${basedir}"