From 39bd84a7834bbf8bd4cdeeca637b21f25174281d Mon Sep 17 00:00:00 2001 From: Steev Klimaszewski Date: Thu, 28 Jun 2018 18:25:05 -0500 Subject: [PATCH] Everyone get on the random machine name train --- banana-pi.sh | 9 ++++++--- banana-pro.sh | 9 ++++++--- bbb.sh | 9 ++++++--- chromebook-arm-acer.sh | 9 ++++++--- chromebook-arm-exynos.sh | 9 ++++++--- chromebook-arm-veyron.sh | 9 ++++++--- cubieboard2.sh | 9 ++++++--- cubietruck.sh | 9 ++++++--- cubox-i.sh | 9 ++++++--- cubox.sh | 9 ++++++--- efikamx.sh | 9 ++++++--- kalitap.sh | 9 ++++++--- luna.sh | 9 ++++++--- mini-x.sh | 9 ++++++--- nanopi2.sh | 9 ++++++--- nanopi3.sh | 9 ++++++--- odroid-c.sh | 9 ++++++--- odroid-c2.sh | 11 +++++++---- odroid-u2.sh | 9 ++++++--- odroid-w-devkit.sh | 9 ++++++--- odroid-w.sh | 9 ++++++--- odroid-xu.sh | 9 ++++++--- odroid-xu3.sh | 9 ++++++--- rpi-tft.sh | 9 ++++++--- rpi.sh | 13 ++++++++----- rpi0w-nexmon-p4wnp1.sh | 9 ++++++--- rpi2.sh | 9 ++++++--- trimslice.sh | 9 ++++++--- usbarmory.sh | 9 ++++++--- utilite.sh | 9 ++++++--- 30 files changed, 183 insertions(+), 93 deletions(-) diff --git a/banana-pi.sh b/banana-pi.sh index 652b9bf..57ac814 100755 --- a/banana-pi.sh +++ b/banana-pi.sh @@ -7,6 +7,9 @@ fi basedir=`pwd`/bananapi-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -66,7 +69,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M bpi -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -163,7 +166,7 @@ rm -f /third-stage EOF chmod +x kali-$architecture/third-stage -LANG=C systemd-nspawn -M bpi -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -177,7 +180,7 @@ rm -f /usr/bin/qemu* EOF chmod +x kali-$architecture/cleanup -LANG=C systemd-nspawn -M bpi -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/banana-pro.sh b/banana-pro.sh index e3df3f0..bca7ab3 100755 --- a/banana-pro.sh +++ b/banana-pro.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/bananapro-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -59,7 +62,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M bpro -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -138,7 +141,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M bpro -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -152,7 +155,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M bpro -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/bbb.sh b/bbb.sh index 2554ac9..6c6648f 100755 --- a/bbb.sh +++ b/bbb.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/beaglebone-black-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -50,7 +53,7 @@ fi cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M bbb -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage if [ $0 == 'nightly' ]; then cat << EOF > kali-$architecture/etc/apt/sources.list @@ -178,7 +181,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M bbb -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -192,7 +195,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M bbb -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/chromebook-arm-acer.sh b/chromebook-arm-acer.sh index d83d400..6570463 100755 --- a/chromebook-arm-acer.sh +++ b/chromebook-arm-acer.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/nyan-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -59,7 +62,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M nyan -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -136,7 +139,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M nyan -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -150,7 +153,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M nyan -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/chromebook-arm-exynos.sh b/chromebook-arm-exynos.sh index e8c1246..623f940 100755 --- a/chromebook-arm-exynos.sh +++ b/chromebook-arm-exynos.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/exynos-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -59,7 +62,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M exynos -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -136,7 +139,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M exynos -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -150,7 +153,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M exynos -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/chromebook-arm-veyron.sh b/chromebook-arm-veyron.sh index a082471..ad5a336 100755 --- a/chromebook-arm-veyron.sh +++ b/chromebook-arm-veyron.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/veyron-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M veyron -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -134,7 +137,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M veyron -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -148,7 +151,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M veyron -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup cat << EOF > kali-$architecture/etc/resolv.conf nameserver 8.8.8.8 diff --git a/cubieboard2.sh b/cubieboard2.sh index e14da9f..15ef461 100755 --- a/cubieboard2.sh +++ b/cubieboard2.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/cubieboard2-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M cubieboard2 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -133,7 +136,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M cubieboard2 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -147,7 +150,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M cubieboard2 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/cubietruck.sh b/cubietruck.sh index e350907..7690d4b 100755 --- a/cubietruck.sh +++ b/cubietruck.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/cubietruck-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M cubietruck -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -133,7 +136,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M cubietruck -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -147,7 +150,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M cubietruck -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/cubox-i.sh b/cubox-i.sh index 25cd326..299e974 100755 --- a/cubox-i.sh +++ b/cubox-i.sh @@ -14,6 +14,9 @@ fi basedir=`pwd`/cubox-i-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -59,7 +62,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M cubox-i -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -151,7 +154,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M cubox-i -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -165,7 +168,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M cubox-i -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/cubox.sh b/cubox.sh index c7f37a4..d5f3d56 100755 --- a/cubox.sh +++ b/cubox.sh @@ -14,6 +14,9 @@ fi basedir=`pwd`/cubox-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -59,7 +62,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M cubox -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -133,7 +136,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M cubox -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -147,7 +150,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M cubox -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/efikamx.sh b/efikamx.sh index 4c6098f..16144ba 100755 --- a/efikamx.sh +++ b/efikamx.sh @@ -14,6 +14,9 @@ echo "This script is now deprecated. The kernel is too old to run systemd" basedir=`pwd`/efikamx-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -62,7 +65,7 @@ debootstrap --foreign --arch $architecture moto kali-$architecture http://$mirro cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M efikamx -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -138,7 +141,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M efikamx -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -154,7 +157,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M efikamx -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/kalitap.sh b/kalitap.sh index ed306cf..cb48fec 100755 --- a/kalitap.sh +++ b/kalitap.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/kalitap-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -48,7 +51,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M kalitap -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -136,7 +139,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M kalitap -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -150,7 +153,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M kalitap -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/luna.sh b/luna.sh index 9a25596..01620c7 100755 --- a/luna.sh +++ b/luna.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/luna-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -46,7 +49,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M luna -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -122,7 +125,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M luna -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -136,7 +139,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M luna -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/mini-x.sh b/mini-x.sh index 9d8203c..079b92e 100755 --- a/mini-x.sh +++ b/mini-x.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/mini-x-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M mini-x -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -133,7 +136,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M mini-x -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -147,7 +150,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M mini-x -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/nanopi2.sh b/nanopi2.sh index 936ff40..7d0c621 100755 --- a/nanopi2.sh +++ b/nanopi2.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/nanopi2-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M nanopi2 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -149,7 +152,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M nanopi2 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -163,7 +166,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M nanopi2 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/nanopi3.sh b/nanopi3.sh index 0b713df..d3623c4 100755 --- a/nanopi3.sh +++ b/nanopi3.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/nanopi3-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M nanopi3 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -183,7 +186,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M nanopi3 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -197,7 +200,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M nanopi3 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-c.sh b/odroid-c.sh index fe220ca..f8af70c 100755 --- a/odroid-c.sh +++ b/odroid-c.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroidc-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidc -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -144,7 +147,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidc -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -158,7 +161,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidc -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-c2.sh b/odroid-c2.sh index dc6f7d9..8ee98a0 100755 --- a/odroid-c2.sh +++ b/odroid-c2.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroidc2-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=aarch64-linux-gnu- @@ -67,7 +70,7 @@ debootstrap --foreign --keyring=/usr/share/keyrings/kali-archive-keyring.gpg --a cp /usr/bin/qemu-aarch64-static kali-$architecture/usr/bin/ cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidc2 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -183,7 +186,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidc2 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -197,7 +200,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidc2 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts @@ -637,7 +640,7 @@ rm -f /create-initrd rm -f /usr/bin/qemu-* EOF chmod 755 ${basedir}/root/create-initrd -LANG=C systemd-nspawn -M odroidc2 -D ${basedir}/root /create-initrd +LANG=C systemd-nspawn -M $machine -D ${basedir}/root /create-initrd sync umount ${basedir}/root/boot diff --git a/odroid-u2.sh b/odroid-u2.sh index 85ba9e5..11c4331 100755 --- a/odroid-u2.sh +++ b/odroid-u2.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroid-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidu2 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -136,7 +139,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidu2 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -150,7 +153,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidu2 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-w-devkit.sh b/odroid-w-devkit.sh index 603a276..c24a510 100755 --- a/odroid-w-devkit.sh +++ b/odroid-w-devkit.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroid-w-devkit-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M devkit -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -138,7 +141,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M devkit -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -152,7 +155,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M devkit -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-w.sh b/odroid-w.sh index c49ba6c..b5b8cf5 100755 --- a/odroid-w.sh +++ b/odroid-w.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroid-w-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidw -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -137,7 +140,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidw -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -151,7 +154,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidw -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-xu.sh b/odroid-xu.sh index 60bfe92..c9eb96f 100755 --- a/odroid-xu.sh +++ b/odroid-xu.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroidxu-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # This is used for cross compiling the exynos5-hwcomposer. # If this isn't built/installed, there will be no framebuffer console. hosttuple=arm-linux-gnueabihf @@ -64,7 +67,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidxu -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -163,7 +166,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidxu -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -177,7 +180,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidxu -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/odroid-xu3.sh b/odroid-xu3.sh index 514127a..0d19f5d 100755 --- a/odroid-xu3.sh +++ b/odroid-xu3.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/odroidxu3-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M odroidxu3 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -159,7 +162,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M odroidxu3 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -173,7 +176,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M odroidxu3 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/rpi-tft.sh b/rpi-tft.sh index bd6283a..b9fd6aa 100755 --- a/rpi-tft.sh +++ b/rpi-tft.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/rpi-tft-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -58,7 +61,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M rpitft -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -177,7 +180,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M rpitft -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -191,7 +194,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M rpitft -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/rpi.sh b/rpi.sh index a3c3ba2..b876ef5 100755 --- a/rpi.sh +++ b/rpi.sh @@ -15,12 +15,15 @@ fi basedir=`pwd`/rpi-$1 workfile=$1 -kaliname=kali +hostname=kali if [ $2 ]; then - kalname=$2 + hostname=$2 fi +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -67,7 +70,7 @@ fi cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -if LANG=C systemd-nspawn -M rpi -D kali-$architecture /debootstrap/debootstrap --second-stage +if LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage then echo "[*] Secondary Boostrap Success" else @@ -80,7 +83,7 @@ deb http://$mirror/kali kali-rolling main contrib non-free EOF # Set hostname -echo "${kaliname}" > kali-$architecture/etc/hostname +echo "$hostname" > kali-$architecture/etc/hostname # So X doesn't complain, we add kali to hosts cat << EOF > kali-$architecture/etc/hosts 127.0.0.1 ${kaliname} localhost @@ -200,7 +203,7 @@ export DEBIAN_FRONTEND=noninteractive chmod 755 kali-$architecture/third-stage -if LANG=C systemd-nspawn -M rpi -D kali-$architecture /third-stage +if LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage then echo "[*] Boostrap Success" else diff --git a/rpi0w-nexmon-p4wnp1.sh b/rpi0w-nexmon-p4wnp1.sh index 5329f2d..8caefff 100755 --- a/rpi0w-nexmon-p4wnp1.sh +++ b/rpi0w-nexmon-p4wnp1.sh @@ -17,6 +17,9 @@ fi basedir=`pwd`/rpi0w-nexmon-p4wnp1-$1 TOPDIR=`pwd` +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M 0wp4np1 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -241,7 +244,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M 0wp4np1 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -255,7 +258,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M 0wp4np1 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/rpi2.sh b/rpi2.sh index 770bf43..8fa07eb 100755 --- a/rpi2.sh +++ b/rpi2.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/rpi2-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Package installations for various sections. # This will build a minimal XFCE Kali system with the top 10 tools. # This is the section to edit if you would like to add more packages. @@ -56,7 +59,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M rpi2 -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -180,7 +183,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M rpi2 -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -194,7 +197,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M rpi2 -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/trimslice.sh b/trimslice.sh index 382dcc5..4ae9e21 100755 --- a/trimslice.sh +++ b/trimslice.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/trimslice-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -60,7 +63,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M trimslice -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -198,7 +201,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M trimslice -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -212,7 +215,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M trimslice -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/usbarmory.sh b/usbarmory.sh index 048673a..a1c8262 100755 --- a/usbarmory.sh +++ b/usbarmory.sh @@ -12,6 +12,9 @@ fi basedir=`pwd`/usbarmory-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -57,7 +60,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M usbarmory -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage # Create sources.list cat << EOF > kali-$architecture/etc/apt/sources.list @@ -146,7 +149,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M usbarmory -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -162,7 +165,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M usbarmory -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts diff --git a/utilite.sh b/utilite.sh index fea8791..2b996c7 100755 --- a/utilite.sh +++ b/utilite.sh @@ -15,6 +15,9 @@ fi basedir=`pwd`/utilite-$1 +# Generate a random machine name to be used. +machine=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + # Make sure that the cross compiler can be found in the path before we do # anything else, that way the builds don't fail half way through. export CROSS_COMPILE=arm-linux-gnueabihf- @@ -61,7 +64,7 @@ debootstrap --foreign --arch $architecture kali-rolling kali-$architecture http: cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/ -LANG=C systemd-nspawn -M utilite -D kali-$architecture /debootstrap/debootstrap --second-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /debootstrap/debootstrap --second-stage cat << EOF > kali-$architecture/etc/apt/sources.list deb http://$mirror/kali kali-rolling main contrib non-free EOF @@ -138,7 +141,7 @@ rm -f /third-stage EOF chmod 755 kali-$architecture/third-stage -LANG=C systemd-nspawn -M utilite -D kali-$architecture /third-stage +LANG=C systemd-nspawn -M $machine -D kali-$architecture /third-stage cat << EOF > kali-$architecture/cleanup #!/bin/bash @@ -152,7 +155,7 @@ rm -f /usr/bin/qemu* EOF chmod 755 kali-$architecture/cleanup -LANG=C systemd-nspawn -M utilite -D kali-$architecture /cleanup +LANG=C systemd-nspawn -M $machine -D kali-$architecture /cleanup #umount kali-$architecture/proc/sys/fs/binfmt_misc #umount kali-$architecture/dev/pts