Add comments and some other fixes to the scripts

This commit is contained in:
Steev Klimaszewski (Kali Linux Developer)
2014-03-26 02:36:32 -04:00
parent 6f691872d5
commit 2e8041e869
12 changed files with 281 additions and 51 deletions

30
bbb.sh
View File

@@ -9,6 +9,12 @@ basedir=`pwd`/beaglebone-black-$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.
# See http://www.kali.org/news/kali-linux-metapackages/ for meta packages you
# can use. You can also install packages, using just the package name, but keep
# in mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +26,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -151,8 +159,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Now some fixes/changes needed!
# Enable serial console on ttyO0
echo 'T1:12345:respawn:/sbin/agetty 115200 ttyO0 vt100' >> ${basedir}/root/etc/inittab
cat << EOF >> ${basedir}/root/etc/udev/links.conf
@@ -163,10 +170,16 @@ cat << EOF >> ${basedir}/root/etc/securetty
ttyO0
EOF
# Uncomment this if you use apt-cacher-ng or else git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# NOTE: This downloads it's own cross compiler!
# We export AUTO_BUILD so that it doesn't prompt us to use the menuconfig option
# with the kernel.
# You can load the github URL in a browser, and see what other branches you can
# try. Keep in mind if you do so, that you will likely want to comment out
# AUTO_BUILD so that you can configure the kernel!
git clone --depth 1 https://github.com/RobertCNelson/linux-dev -b am33x-v3.8 ${basedir}/kernel
cd ${basedir}/kernel
git config user.name root
@@ -228,6 +241,8 @@ rm -rf ${basedir}/root/lib/firmware/.git
tar -xovf ${basedir}/kernel/deploy/3.8.*-firmware.tar.gz -C ${basedir}/root/lib/firmware/
cd ${basedir}
# Unused currently, but this script is a part of using the usb as an ethernet
# device.
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
@@ -237,8 +252,17 @@ umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/kernel
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-bbb.img"
sha1sum kali-$1-bbb.img > ${basedir}/kali-$1-bbb.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -9,6 +9,12 @@ basedir=`pwd`/spring-$1
# Package installations for various sections.
# This will build a minimal Gnome Kali system with the top 10 tools.
# This is the section to edit if you would like to add more packages.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you
# can use. You can also install packages, using just the package name, but keep
# in mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +26,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment futher down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -153,8 +161,12 @@ mount $scriptp ${basedir}/script
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section. Currently we're using 3.4, but there will be a switch to
# 3.8.
git clone --depth 1 http://chromium.googlesource.com/chromiumos/third_party/kernel.git -b chromeos-3.4 ${basedir}/kernel
cd ${basedir}/kernel
cp ${basedir}/../kernel-configs/chromebook.config .config
@@ -175,7 +187,7 @@ cat << __EOF__ > ${basedir}/kernel/arch/arm/boot/kernel-spring.its
#address-cells = <1>;
images {
kernel@1{
description = "kernel";
description = "kernel";
data = /incbin/("zImage");
type = "kernel_noload";
arch = "arm";
@@ -219,7 +231,7 @@ setenv extra_bootargs console=tty1
setenv mmc0_boot echo ERROR: Could not boot from USB or SD
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/script/u-boot/boot.txt ${basedir}/script/u-boot/boot.scr.uimg
# Touchpad configuration
@@ -237,6 +249,7 @@ Section "InputClass"
Option "FingerPress" "256"
EndSection
EOF
# Turn off DPMS, this is supposed to help with fbdev/armsoc blanking.
# Doesn't really seem to affect fbdev, but marked improvement with armsoc.
cat << EOF > ${basedir}/root/etc/X11/xorg.conf
@@ -273,7 +286,9 @@ Section "ServerLayout"
Screen "DefaultScreen"
EndSection
EOF
# A few settings for the desktop
# At the moment we use fbdev, but in the future we will switch to the armsoc
# driver provided by ChromiumOS.
cat << EOF > ${basedir}/root/etc/X11/xorg.conf.d/20-armsoc.conf
Section "Device"
Identifier "Mali FBDEV"
@@ -308,6 +323,10 @@ umount $bootp
umount $rootp
umount $scriptp
# This is the u-boot bootloader that gets written to the first partition. When
# you hit CTRL+U, this is what gets read first. If you want to customize your
# u-boot in some way, you will need to read the ChromiumOS dev wiki.
# http://www.chromium.org/chromium-os/developer-guide
wget https://github.com/offensive-security/kali-uboot-images/raw/master/nv_uboot-spring.kpart
dd if=nv_uboot-spring.kpart of=$ubootp
@@ -315,9 +334,15 @@ dd if=nv_uboot-spring.kpart of=$ubootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/nv_uboot-spring.kpart ${basedir}/script
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-spring.img"
sha1sum kali-$1-spring.img > ${basedir}/kali-$1-spring.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -9,6 +9,12 @@ basedir=`pwd`/chromebook-$1
# Package installations for various sections.
# This will build a minimal Gnome Kali system with the top 10 tools.
# This is the section to edit if you would like to add more packages.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +26,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -153,8 +161,12 @@ mount $scriptp ${basedir}/script
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section. Currently we're using 3.4, but there will be a switch to
# 3.8.
git clone --depth 1 http://chromium.googlesource.com/chromiumos/third_party/kernel.git -b chromeos-3.4 ${basedir}/kernel
cd ${basedir}/kernel
cp ${basedir}/../kernel-configs/chromebook.config .config
@@ -235,7 +247,7 @@ setenv extra_bootargs console=tty1
setenv mmc0_boot echo ERROR: Could not boot from USB or SD
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/script/u-boot/boot.txt ${basedir}/script/u-boot/boot.scr.uimg
# Touchpad configuration
@@ -289,7 +301,9 @@ Section "ServerLayout"
Screen "DefaultScreen"
EndSection
EOF
# A few settings for the desktop
# At the moment we use fbdev, but in the future, we will switch to the armsoc
# driver provided by ChromiumOS.
cat << EOF > ${basedir}/root/etc/X11/xorg.conf.d/20-armsoc.conf
Section "Device"
Identifier "Mali FBDEV"
@@ -324,15 +338,25 @@ umount $bootp
umount $rootp
umount $scriptp
# This is the u-boot bootloader that gets written to the first partition. When
# you hit CTRL+U, this is what gets read first. If you want to customize your
# u-boot in some way, you will need to read the ChromiumOS dev wiki.
# http://www.chromium.org/chromium-os/developer-guide
wget -O - http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow.kpart.bz2 | bunzip2 > nv_uboot-snow.kpart
dd if=nv_uboot-snow.kpart of=$ubootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/nv_uboot-snow.kpart ${basedir}/script
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-chromebook.img"
sha1sum kali-$1-chromebook.img > ${basedir}/kali-$1-chromebook.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -9,6 +9,12 @@ basedir=`pwd`/cubieboard2-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +26,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -146,13 +154,17 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs to image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Now some fixes/changes needed!
# Enable the serial console
echo "T1:12345:/sbin/agetty -L ttyS0 115200 vt100" >> ${basedir}/root/etc/inittab
# Load the ethernet module since it doesn't load automatically at boot.
echo "sunxi_emac" >> ${basedir}/root/etc/modules
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Kernel section. If you want to us ea custom kernel, or configuration, replace
# them in this section.
# Get, compile and install kernel
git clone --depth 1 https://github.com/linux-sunxi/u-boot-sunxi
git clone --depth 1 https://github.com/linux-sunxi/linux-sunxi -b stage/sunxi-3.4 ${basedir}/kernel
@@ -184,11 +196,7 @@ fatload mmc 0 0x48000000 uImage
bootm 0x48000000
EOF
cat << EOF >> ${basedir}/root/etc/modules
sunxi_emac
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.cmd ${basedir}/bootp/boot.scr
cd ${basedir}/u-boot-sunxi/
@@ -209,9 +217,15 @@ umount $bootp
umount $rootp
kpartx -dv $loopdevice
# 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.
echo "Cleaning up the temporary build files..."
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/patches ${basedir}/*sunxi*
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum of kali-$1-cubieboard2.img"
sha1sum kali-$1-cubieboard2.img > ${basedir}/kali-$1-cubieboard2.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# This is for the Original (Marvell based) NOT the Cubox-i (Freescale based)
if [[ $# -eq 0 ]] ; then
echo "Please pass version number, e.g. $0 1.0.1"
exit 0
@@ -9,6 +11,12 @@ basedir=`pwd`/cubox-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +28,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -140,14 +150,15 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Now some fixes/changes needed!
# Enable serial console
echo 'T1:12345:respawn:/sbin/agetty 115200 ttyS0 vt100' >> \
${basedir}/root/etc/inittab
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 https://github.com/rabeeh/linux.git ${basedir}/kernel
cd ${basedir}/kernel
mkdir -p ../patches
@@ -195,7 +206,7 @@ fi
echo "!! Unable to locate root partition on \${device_name} !!"
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/root/boot/boot.txt ${basedir}/root/boot/boot.scr
rm -rf ${basedir}/root/lib/firmware
@@ -207,10 +218,17 @@ cd ${basedir}
# Unmount partitions
umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/kernel ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-cubox.img"
sha1sum kali-$1-cubox.img > ${basedir}/kali-$1-cubox.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -9,20 +9,29 @@ basedir=`pwd`/efikamx-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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-linux kali-menu kali-linux-full kali-defaults initramfs-tools"
desktop="xfce4 network-manager network-manager-gnome xserver-xorg-video-fbdev"
pth="passing-the-hash unicornscan winexe enum4linux polenum nfspy wmis nipper-ng jsql ghost-phisher uniscan lbd automater arachni bully inguma sslsplit dumpzilla recon-ng ridenum jd-gui"
export packages="${arm} ${base} ${desktop} ${pth} armitage iceweasel metasploit wpasupplicant openssh-server"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -150,8 +159,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Now some fixes/changes needed!
# For serial console you can use one of the following two items.
# (No auto login)
#T1:12345:respawn:/sbin/agetty 115200 ttymxc0 vt100 >> ${basedir}/root/etc/inittab
# (Auto login on serial console)
@@ -172,9 +180,11 @@ EOF
# udev won't start and we have no devices, including keyboard/usb support.
sed -i -e "s/2.6.3\[0-1\]/2.6.30/g" ${basedir}/root/etc/init.d/udev
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 https://github.com/genesi/linux-legacy ${basedir}/kernel
cd ${basedir}/kernel
touch .scmversion
@@ -205,7 +215,7 @@ bootm \${kerneladdr} \${ramdiskaddr}
fi;
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.script ${basedir}/bootp/boot.scr
rm -rf ${basedir}/root/lib/firmware
@@ -221,9 +231,15 @@ umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# Remove all the various bits used to generate the image.
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-efikamx.img"
sha1sum kali-$1-efikamx.img > ${basedir}/kali-$1-efikamx.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -9,6 +9,12 @@ basedir=`pwd`/mini-x-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -20,12 +26,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -147,9 +155,11 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 https://github.com/linux-sunxi/u-boot-sunxi
git clone --depth 1 https://github.com/linux-sunxi/linux-sunxi -b stage/sunxi-3.4 ${basedir}/kernel
git clone --depth 1 https://github.com/linux-sunxi/sunxi-tools
@@ -180,7 +190,7 @@ fatload mmc 0 0x48000000 uImage
bootm 0x48000000
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.cmd ${basedir}/bootp/boot.scr
cd ${basedir}/u-boot-sunxi/
@@ -201,9 +211,15 @@ umount $bootp
umount $rootp
kpartx -dv $loopdevice
# 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.
echo "Cleaning up temporary build system"
rm -rf ${basedir}/*sunxi* ${basedir}/patches ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-mini-x.img"
sha1sum kali-$1-mini-x.img > ${basedir}/kali-$1-mini-x.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -12,6 +12,12 @@ basedir=`pwd`/odroid-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -23,12 +29,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -150,8 +158,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Now some fixes/changes needed!
# Serial console settings.
# (No auto login)
#T1:12345:respawn:/sbin/agetty 115200 ttySAC1 vt100 >> ${basedir}/root/etc/inittab
# (Auto login on serial console)
@@ -169,6 +176,8 @@ ttySAC1
ttySAC2
EOF
# This file needs to exist in order to save the mac address, otherwise every
# boot, the ODROID-U2/U3 will generate a random mac address.
touch ${basedir}/root/etc/smsc95xx_mac_addr
# Start X on the ODROID U2.
@@ -206,9 +215,11 @@ Mode 0666
EndSection
EOF
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroid-3.8.y ${basedir}/kernel
cd ${basedir}/kernel
touch .scmversion
@@ -233,7 +244,7 @@ setenv bootargs "console=tty1 console=ttySAC1,115200n8 root=/dev/mmcblk0p2 rootw
boot
EOF
# Create image
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.txt ${basedir}/bootp/boot.scr
rm -rf ${basedir}/root/lib/firmware
@@ -247,7 +258,9 @@ umount $bootp
umount $rootp
kpartx -dv $loopdevice
# Get basic boot structure
# Build the latest u-boot bootloader, and then use the Hardkernel script to fuse
# it to the image. This is required because of a requirement that the
# bootloader be signed.
git clone --depth 1 https://github.com/hardkernel/u-boot -b odroid-v2010.12
cd ${basedir}/u-boot
# https://code.google.com/p/chromium/issues/detail?id=213120
@@ -263,9 +276,15 @@ cd ${basedir}
losetup -d $loopdevice
# 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.
echo "Clean up the build system"
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/patches ${basedir}/u-boot
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-odroid.img"
sha1sum kali-$1-odroid.img > ${basedir}/kali-$1-odroid.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -11,11 +11,18 @@ fi
basedir=`pwd`/odroidxu-$1
# This is used for cross compiling the exynos5-hwcomposer
# 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
# 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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -27,12 +34,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -159,6 +168,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Serial console settings.
# (Auto login on serial console)
#T1:12345:respawn:/sbin/agetty 115200 ttySAC2 vt100 >> ${basedir}/root/etc/inittab
# (No auto login)
@@ -185,9 +195,11 @@ startx
fi
EOF
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidxu-3.4.y ${basedir}/kernel
cd ${basedir}/kernel
mkdir -p ../patches
@@ -201,10 +213,9 @@ make -j $(grep -c processor /proc/cpuinfo)
make modules_install INSTALL_MOD_PATH=${basedir}/root
cp arch/arm/boot/zImage ${basedir}/bootp
# This is to build the console framebuffer application.
echo "Building the hwcomposer"
cd ${basedir}/kernel/tools/hardkernel/exynos5-hwcomposer
# It's quite chatty still, so we if 0 the logging, and also add a missing #define
sed -i -e 's/if 1/if 0/g' include/log.h
sed -i -e 's/#define ALOGD/#define ALOGD\r#define ALOGF/g' include/log.h
@@ -256,7 +267,7 @@ umount $bootp
umount $rootp
kpartx -dv $loopdevice
# Get basic boot structure
# Write the signed u-boot binary to the image so that it will boot.
cd ${basedir}/kernel/tools/hardkernel/u-boot-pre-built
sh sd_fusing.sh $loopdevice
cd ${basedir}
@@ -279,9 +290,15 @@ cd ${basedir}
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/patches ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-odroidxu.img"
sha1sum kali-$1-odroidxu.img > ${basedir}/kali-$1-odroidxu.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

28
rpi.sh
View File

@@ -12,6 +12,12 @@ basedir=`pwd`/rpi-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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 sudo parted e2fsprogs"
@@ -24,12 +30,21 @@ size=3000 # Size of image in megabytes
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armel"
# Check to ensure that the architecture is set to ARMEL since the RPi is the
# only board that is armel.
if [[ $architecture != "armel" ]] ; then
echo "The Raspberry Pi cannot run the Debian armhf binaries"
exit 0
fi
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -158,10 +173,11 @@ rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Enable login over serial
echo "T0:23:/sbin/getty -L ttyAMA0 115200 vt100" >> ${basedir}/root/etc/inittab
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Switch to upstream kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone -b rpi-3.13.y --depth 1 https://github.com/raspberrypi/linux ${basedir}/kernel
git clone --depth 1 https://github.com/raspberrypi/tools ${basedir}/tools
@@ -208,9 +224,15 @@ umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Cleaning up the temporary build files..."
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot ${basedir}/tools ${basedir}/patches
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-rpi.img"
sha1sum kali-$1-rpi.img > ${basedir}/kali-$1-rpi.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -12,6 +12,12 @@ basedir=`pwd`/trimslice-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -23,12 +29,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -151,6 +159,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Enable serial console access
echo "T1:23:/sbin/agetty -L ttys0 115200 vt100" >> ${basedir}/root/etc/inittab
cat << EOF >> ${basedir}/root/etc/udev/links.conf
@@ -161,9 +170,11 @@ cat << EOF >> ${basedir}/root/etc/securetty
ttyS0
EOF
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail.
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ${basedir}/kernel
cd ${basedir}/kernel
mkdir -p ../patches
@@ -194,6 +205,7 @@ ext2load usb 0:1 4000000 tegra20-trimslice.dtb
bootm 4080000 4800000 4000000
EOF
# Create u-boot boot script image
mkimage -A arm -T script -C none -d ${basedir}/bootp/boot.txt ${basedir}/bootp/boot.scr
# Unmount partitions
@@ -202,9 +214,15 @@ umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/patches ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-trimslice.img"
sha1sum kali-$1-trimslice.img > ${basedir}/kali-$1-trimslice.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.

View File

@@ -12,6 +12,12 @@ basedir=`pwd`/utilite-$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.
# See http://www.kali.org/new/kali-linux-metapackages/ for meta packages you can
# use. You can also install packages, using just the package name, but keep in
# mind that not all packages work on ARM! If you specify one of those, the
# 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"
@@ -23,12 +29,14 @@ extras="iceweasel wpasupplicant"
export packages="${arm} ${base} ${desktop} ${tools} ${services} ${extras}"
export architecture="armhf"
# Set this to use an http proxy, like apt-cacher-ng, and uncomment further down
# to unset it.
#export http_proxy="http://localhost:3142/"
mkdir -p ${basedir}
cd ${basedir}
# create the rootfs
# create the rootfs - not much to modify here, except maybe the hostname.
debootstrap --foreign --arch $architecture kali kali-$architecture http://http.kali.org/kali
cp /usr/bin/qemu-arm-static kali-$architecture/usr/bin/
@@ -151,6 +159,7 @@ mount $rootp ${basedir}/root
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${basedir}/kali-$architecture/ ${basedir}/root/
# Enable serial console access
echo "T1:23:/sbin/agetty -L ttymxc3 115200 vt100" >> ${basedir}/root/etc/inittab
cat << EOF >> ${basedir}/root/etc/udev/links.conf
@@ -161,9 +170,11 @@ cat << EOF >> ${basedir}/root/etc/securetty
ttymxc3
EOF
# Uncomment this if you use apt-cacher-ng otherwise git clones will fail
#unset http_proxy
# Get, compile and install kernel
# Kernel section. If you want to use a custom kernel, or configuration, replace
# them in this section.
git clone --depth 1 git://gitorious.org/utilite/utilite.git ${basedir}/kernel
cd ${basedir}/kernel
mkdir -p ../patches
@@ -190,9 +201,15 @@ umount $rootp
kpartx -dv $loopdevice
losetup -d $loopdevice
# 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.
echo "Removing temporary build files"
rm -rf ${basedir}/kernel ${basedir}/bootp ${basedir}/root ${basedir}/kali-$architecture ${basedir}/boot
# If you're building an image for yourself, comment all of this out, as you
# don't need the sha1sum or to compress the image, since you will be testing it
# soon.
echo "Generating sha1sum for kali-$1-utilite.img"
sha1sum kali-$1-utilite.img > ${basedir}/kali-$1-utilite.img.sha1sum
# Don't pixz on 32bit, there isn't enough memory to compress the images.