More settings
This commit is contained in:
committed by
Steev Klimaszewski
parent
f7e0602bbd
commit
fa83b3e955
@@ -19,6 +19,6 @@ rm -rf /var/cache/debconf/*-old
|
||||
rm -rf /var/cache/apt/archives/*
|
||||
rm -rf /etc/apt/apt.conf.d/apt_opts
|
||||
rm -rf /etc/apt/apt.conf.d/99_norecommends
|
||||
find /var/log -depth -type f -print0 | xargs -0 truncate -s 0
|
||||
for logs in $(find /var/log -type f); do > $logs; done
|
||||
history -c
|
||||
EOF
|
||||
|
||||
@@ -197,16 +197,19 @@ function make_swap() {
|
||||
|
||||
# Print current config.
|
||||
function print_config() {
|
||||
clear
|
||||
echo -e "\n"
|
||||
log "Compilation info" bold
|
||||
if [[ "$hw_model" == *rpi* ]]; then
|
||||
name_model="Raspberry PI 2/3/4"
|
||||
name_model="Raspberry PI 2/3/4/400"
|
||||
log "Hardware model: $(tput sgr0) $name_model" cyan
|
||||
else
|
||||
log "Hardware model: $(tput sgr0) $hw_model" cyan
|
||||
fi
|
||||
log "Architecture: $(tput sgr0) $architecture" cyan
|
||||
log "The basedir thinks it is: $(tput sgr0) ${basedir}" cyan
|
||||
sleep 1
|
||||
echo -e "\n"
|
||||
sleep 1.5
|
||||
}
|
||||
|
||||
# Calculate the space to create the image and create.
|
||||
@@ -227,5 +230,5 @@ function clean_build() {
|
||||
rm -rf "${basedir}"
|
||||
log "Done." green
|
||||
echo -e "\n"
|
||||
log "Your image is: $(tput sgr0) ${imagename}.img.xz" bold
|
||||
log "Your image is: $(tput sgr0) $(ls "${imagename}".*)" bold
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Automatic configuration to use an http proxy, such as apt-cacher-ng.
|
||||
# You can turn off automatic settings by uncommenting apt_cacher=off.
|
||||
# apt_cacher=off
|
||||
# By default the proxy settings are local, but you can define an external proxy.
|
||||
# proxy_url="http://external.intranet.local"
|
||||
apt_cacher=${apt_cacher:-"$(lsof -i :3142 | cut -d ' ' -f3 | uniq | sed '/^\s*$/d')"}
|
||||
if [ -n "$proxy_url" ]; then
|
||||
export http_proxy=$proxy_url
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
git clone https://github.com/raspberrypi/userland.git "${basedir}"/userland
|
||||
|
||||
@@ -20,7 +21,7 @@ case ${architecture} in
|
||||
;;
|
||||
esac
|
||||
|
||||
make -j$(nproc) 2>/dev/null
|
||||
make -j"$(nproc)" 2>/dev/null
|
||||
mkdir "${work_dir}"/opt/vc
|
||||
mv {bin,lib,inc} "${work_dir}"/opt/vc
|
||||
|
||||
|
||||
@@ -46,12 +46,16 @@ basedir=${current_dir}/${hw_model}-${variant}
|
||||
work_dir="${basedir}/kali-${architecture}"
|
||||
# Custom image file name variable - MUST NOT include .img at the end.
|
||||
imagename=${imagename:-"kali-linux-${version}-${hw_model}-${variant}"}
|
||||
# workaround for LP: #520465
|
||||
export MALLOC_CHECK_=0
|
||||
# Proxy
|
||||
# You can turn off automatic settings by uncommenting apt_cacher=off.
|
||||
# apt_cacher=off
|
||||
# By default the proxy settings are local, but you can define an external proxy.
|
||||
# proxy_url="http://external.intranet.local"
|
||||
|
||||
# Load build configuration
|
||||
if [ -f "${current_dir}"/builder.txt ]; then
|
||||
# shellcheck source=/dev/null
|
||||
source "${current_dir}"/builder.txt
|
||||
fi
|
||||
|
||||
# workaround for LP: #520465
|
||||
export MALLOC_CHECK_=0
|
||||
|
||||
@@ -32,15 +32,15 @@ include eatmydata
|
||||
systemd-nspawn_exec eatmydata /debootstrap/debootstrap --second-stage
|
||||
# Define sources.list
|
||||
include sources.list
|
||||
# Set hostname
|
||||
set_hostname "${hostname}"
|
||||
# APT options
|
||||
include apt_options
|
||||
# So X doesn't complain, we add kali to hosts
|
||||
include hosts
|
||||
# Set hostname
|
||||
set_hostname "${hostname}"
|
||||
# Network configs
|
||||
include network
|
||||
add_interface eth0
|
||||
# APT options
|
||||
include apt_options
|
||||
# Copy directory bsp into build dir.
|
||||
cp -rp bsp "${work_dir}"
|
||||
|
||||
@@ -48,6 +48,7 @@ cp -rp bsp "${work_dir}"
|
||||
cat <<EOF >"${work_dir}"/third-stage
|
||||
#!/bin/bash -e
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
eatmydata apt-get update
|
||||
eatmydata apt-get -y install ${third_stage_pkgs}
|
||||
|
||||
@@ -183,6 +184,7 @@ bootp="${loopdevice}p1"
|
||||
rootp="${loopdevice}p2"
|
||||
|
||||
# Create file systems
|
||||
log "Formating partitions" green
|
||||
mkfs.vfat -n BOOT -F 32 "${bootp}"
|
||||
if [[ "$fstype" == "ext4" ]]; then
|
||||
features="^64bit,^metadata_csum"
|
||||
@@ -207,7 +209,7 @@ umount -l "${bootp}"
|
||||
umount -l "${rootp}"
|
||||
|
||||
# Check filesystem
|
||||
dosfsck -w -r -l -a -t "$bootp"
|
||||
dosfsck -w -r -a -t "$bootp"
|
||||
e2fsck -y -f "$rootp"
|
||||
|
||||
# Remove loop devices
|
||||
|
||||
Reference in New Issue
Block a user