2018-09-05 17:06:30 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -o pipefail # Bashism
|
|
|
|
|
2018-09-26 14:43:45 -06:00
|
|
|
parrot_mirror=http://archive.parrotsec.org/parrot
|
2018-10-22 15:44:44 -06:00
|
|
|
public_mirror=http://archive.parrotsec.org/parrot
|
2018-09-05 17:06:30 -06:00
|
|
|
|
2018-10-22 15:44:44 -06:00
|
|
|
#public_mirror=http://deb.parrotsec.org/parrot
|
2018-10-18 18:01:16 -06:00
|
|
|
|
|
|
|
|
2018-09-05 17:06:30 -06:00
|
|
|
# Detect target architecture and filter args
|
|
|
|
if [ ! $arch ]; then
|
|
|
|
arch=$(dpkg --print-architecture)
|
|
|
|
fi
|
|
|
|
if [ ! $variant ]; then
|
|
|
|
variant="home"
|
|
|
|
fi
|
|
|
|
dist="parrot"
|
|
|
|
lb_opts=""
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
arg="$1"
|
|
|
|
case "$arg" in
|
|
|
|
-a|--arch|--architecture|--architectures)
|
|
|
|
arch="$2"
|
|
|
|
temp="$temp "'"'"$arg"'"'
|
|
|
|
temp="$temp "'"'"$2"'"'
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--distribution)
|
|
|
|
dist="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
--variant)
|
|
|
|
variant="$2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
-p|--proposed-updates)
|
|
|
|
enable_pu="1"
|
|
|
|
;;
|
|
|
|
--)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
temp="$temp "'"'"$arg"'"'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
eval set -- "$temp"
|
|
|
|
|
|
|
|
# live-build doesn't work if --parent-debian-distribution is unknown of
|
|
|
|
# debian-cd => we have to put a symlink so that it deals with kali like sid
|
|
|
|
if [ ! -e ${LIVE_BUILD:-/usr/share/live/build}/data/debian-cd/$dist ]; then
|
|
|
|
if [ -w ${LIVE_BUILD:-/usr/share/live/build}/data/debian-cd ]; then
|
|
|
|
ln -sf sid ${LIVE_BUILD:-/usr/share/live/build}/data/debian-cd/$dist
|
|
|
|
else
|
|
|
|
echo "ERROR: Run this first:"
|
|
|
|
echo "ln -sf sid ${LIVE_BUILD:-/usr/share/live/build}/data/debian-cd/$dist"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "$arch" in
|
|
|
|
amd64)
|
|
|
|
lb_opts="$lb_opts --binary-images iso-hybrid --architecture amd64 --debian-installer live --linux-flavours amd64"
|
|
|
|
;;
|
|
|
|
i386)
|
|
|
|
lb_opts="$lb_opts --binary-images iso-hybrid --architecture i386 --debian-installer live --linux-flavours 686-pae"
|
|
|
|
;;
|
|
|
|
486)
|
|
|
|
lb_opts="$lb_opts --binary-images iso-hybrid --architecture i386 --debian-installer live --linux-flavours 486"
|
|
|
|
;;
|
|
|
|
armel|armhf|arm64)
|
|
|
|
lb_opts="$lb_opts --binary-images hdd --binary-filesystem ext4 --chroot-filesystem none"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "WARNING: configuration not tested on arch $arch" >&2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Setup configuration files from variant and options
|
|
|
|
|
|
|
|
# Drop all files that a former run might have put into place
|
|
|
|
for file in $(cd config && find . -type f); do
|
|
|
|
file=${file#./*/}
|
|
|
|
rm -f config/$file || true
|
|
|
|
done
|
|
|
|
|
|
|
|
cp -rT templates/common config
|
|
|
|
[ ! -d templates/parrot-$variant ] || cp -rTL templates/parrot-$variant config
|
|
|
|
|
|
|
|
[ ! $arch ] || sed -i "s/ISO_ARCH/$arch/g" config/includes.binary/isolinux/menu.cfg
|
|
|
|
[ ! $arch ] || sed -i "s/ISO_ARCH/$arch/g" config/includes.binary/boot/grub/live-theme/theme.txt
|
|
|
|
[ ! $version ] || sed -i "s/ISO_VERSION/$version/g" config/includes.binary/isolinux/menu.cfg
|
|
|
|
[ ! $version ] || sed -i "s/ISO_VERSION/$version/g" config/includes.binary/boot/grub/live-theme/theme.txt
|
|
|
|
[ ! $variant ] || sed -i "s/ISO_TITLE/Parrot $variant/g" config/includes.binary/isolinux/menu.cfg
|
|
|
|
[ ! $variant ] || sed -i "s/ISO_TITLE/Parrot $variant/g" config/includes.binary/boot/grub/live-theme/theme.txt
|
|
|
|
|
|
|
|
lb config noauto \
|
|
|
|
--distribution "$dist" \
|
|
|
|
--debian-installer-distribution "$dist" \
|
|
|
|
--archive-areas "main contrib non-free" \
|
2018-10-29 13:39:10 -06:00
|
|
|
--debootstrap-options "--include=ca-certificates,csec-archive-keyring,gnupg --keyring=templates/common/archives/csec.key" \
|
2018-10-29 00:06:07 -06:00
|
|
|
--keyring-packages parrot-archive-keyring \
|
2018-09-05 17:06:30 -06:00
|
|
|
--updates false \
|
|
|
|
--security false \
|
|
|
|
--backports false \
|
|
|
|
--firmware-binary false \
|
|
|
|
--firmware-chroot false \
|
|
|
|
--compression xz \
|
|
|
|
--mirror-bootstrap "$parrot_mirror" \
|
|
|
|
--mirror-chroot "$parrot_mirror" \
|
|
|
|
--mirror-debian-installer "$parrot_mirror" \
|
2018-10-18 18:01:16 -06:00
|
|
|
--mirror-binary "$public_mirror" \
|
2018-09-05 17:06:30 -06:00
|
|
|
--iso-application "Parrot" \
|
|
|
|
--iso-publisher "Parrot Project" \
|
|
|
|
--iso-volume "ParrotSec" \
|
|
|
|
--linux-packages linux-image \
|
|
|
|
--bootappend-live "boot=live hostname=parrot splash noautomount" \
|
|
|
|
--source false \
|
|
|
|
$lb_opts \
|
|
|
|
"$@"
|
|
|
|
|
|
|
|
#use overlay instead of aufs as union filesystem support for squashfs
|
|
|
|
sed -i "s/LB_UNION_FILESYSTEM=\"aufs\"/LB_UNION_FILESYSTEM=\"overlay\"/g" config/chroot
|