Add bbb script
This commit is contained in:
43
bbb.sh
43
bbb.sh
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
echo "Please pass version number, e.g. $0 1.0.1"
|
||||
echo "Please pass version number, e.g. $0 2.0"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -16,20 +16,20 @@ basedir=`pwd`/beaglebone-black-$1
|
||||
# script will throw an error, but will still continue on, and create an unusable
|
||||
# image, keep that in mind.
|
||||
|
||||
arm="abootimg cgpt fake-hwclock ntpdate vboot-utils vboot-kernel-utils uboot-mkimage"
|
||||
base="kali-menu kali-defaults initramfs-tools usbutils"
|
||||
desktop="xfce4 network-manager network-manager-gnome ntpdate xserver-xorg-video-fbdev"
|
||||
tools="passing-the-hash winexe aircrack-ng hydra john sqlmap wireshark libnfc-bin mfoc"
|
||||
services="openssh-server apache2"
|
||||
extras="iceweasel wpasupplicant"
|
||||
arm="abootimg cgpt fake-hwclock ntpdate u-boot-tools vboot-utils vboot-kernel-utils"
|
||||
base="e2fsprogs initramfs-tools kali-defaults kali-menu parted sudo usbutils"
|
||||
desktop="fonts-croscore fonts-crosextra-caladea fonts-crosextra-carlito gnome-theme-kali gtk3-engines-xfce kali-desktop-xfce kali-root-login lightdm network-manager network-manager-gnome xfce4 xserver-xorg-video-fbdev"
|
||||
tools="aircrack-ng ethtool hydra john libnfc-bin mfoc nmap passing-the-hash sqlmap usbutils winexe wireshark"
|
||||
services="apache2 openssh-server"
|
||||
extras="iceweasel xfce4-terminal wpasupplicant"
|
||||
|
||||
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
|
||||
export architecture="armhf"
|
||||
packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
|
||||
architecture="armhf"
|
||||
# If you have your own preferred mirrors, set them here.
|
||||
# You may want to leave security.kali.org alone, but if you trust your local
|
||||
# mirror, feel free to change this as well.
|
||||
# After generating the rootfs, we set the sources.list to the default settings.
|
||||
mirror=http.kali.org
|
||||
mirror=repo.kali.org
|
||||
security=security.kali.org
|
||||
|
||||
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
|
||||
@@ -40,15 +40,16 @@ mkdir -p ${basedir}
|
||||
cd ${basedir}
|
||||
|
||||
# create the rootfs - not much to modify here, except maybe the hostname.
|
||||
debootstrap --foreign --arch $architecture kali kali-$architecture http://$mirror/kali
|
||||
debootstrap --foreign --arch $architecture sana kali-$architecture http://$mirror/kali
|
||||
|
||||
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
|
||||
|
||||
LANG=C chroot kali-$architecture /debootstrap/debootstrap --second-stage
|
||||
cat << EOF > kali-$architecture/etc/apt/sources.list
|
||||
deb http://$mirror/kali kali main contrib non-free
|
||||
deb http://$security/kali-security kali/updates main contrib non-free
|
||||
deb http://$mirror/kali sana main contrib non-free
|
||||
deb http://$security/kali-security sana/updates main contrib non-free
|
||||
EOF
|
||||
|
||||
echo "kali" > kali-$architecture/etc/hostname
|
||||
cat << EOF > kali-$architecture/etc/hosts
|
||||
127.0.0.1 kali localhost
|
||||
@@ -103,12 +104,15 @@ apt-get install locales-all
|
||||
debconf-set-selections /debconf.set
|
||||
rm -f /debconf.set
|
||||
apt-get update
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools uboot-mkimage
|
||||
apt-get -y install git-core binutils ca-certificates initramfs-tools u-boot-tools
|
||||
apt-get -y install locales console-common less nano git
|
||||
echo "root:toor" | chpasswd
|
||||
sed -i -e 's/KERNEL\!=\"eth\*|/KERNEL\!=\"/' /lib/udev/rules.d/75-persistent-net-generator.rules
|
||||
rm -f /etc/udev/rules.d/70-persistent-net.rules
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get --yes --force-yes install $packages
|
||||
apt-get --yes --force-yes dist-upgrade
|
||||
apt-get --yes --force-yes autoremove
|
||||
|
||||
rm -f /usr/sbin/policy-rc.d
|
||||
rm -f /usr/sbin/invoke-rc.d
|
||||
@@ -177,11 +181,11 @@ ttyO0
|
||||
EOF
|
||||
|
||||
cat << EOF > ${basedir}/root/etc/apt/sources.list
|
||||
deb http://http.kali.org/kali kali main non-free contrib
|
||||
deb-src http://http.kali.org/kali kali main non-free contrib
|
||||
deb http://http.kali.org/kali sana main non-free contrib
|
||||
deb-src http://http.kali.org/kali sana main non-free contrib
|
||||
|
||||
deb http://security.kali.org/kali-security kali/updates main contrib non-free
|
||||
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
|
||||
deb http://security.kali.org/kali-security sana/updates main contrib non-free
|
||||
deb-src http://security.kali.org/kali-security sana/updates main contrib non-free
|
||||
EOF
|
||||
|
||||
# Uncomment this if you use apt-cacher-ng or else git clones will fail.
|
||||
@@ -262,6 +266,9 @@ cd ${basedir}
|
||||
wget -c https://raw.github.com/RobertCNelson/tools/master/scripts/beaglebone-black-g-ether-load.sh -O ${basedir}/root/root/beaglebone-black-g-ether-load.sh
|
||||
chmod +x ${basedir}/root/root/beaglebone-black-g-ether-load.sh
|
||||
|
||||
cp ${basedir}/../misc/zram ${basedir}/root/etc/init.d/zram
|
||||
chmod +x ${basedir}/root/etc/init.d/zram
|
||||
|
||||
# Unmount partitions
|
||||
umount $bootp
|
||||
umount $rootp
|
||||
|
||||
Reference in New Issue
Block a user