This commit is contained in:
2025-01-02 20:37:26 +08:00
parent ce0450a77c
commit dfaf9802a9
2 changed files with 2208 additions and 7 deletions

2196
dtc-lexer.lex.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -45,7 +45,7 @@ free_space="300"
bootsize="128"
# Select compression, xz or none
compress="xz"
compress="noxz"
# Choose filesystem format to format (ext3 or ext4)
fstype="ext3"
@@ -120,10 +120,10 @@ e2fsprogs ifupdown initramfs-tools inxi iw man-db mlocate net-tools \
netcat-traditional parted pciutils psmisc rfkill screen tmux unrar usbutils \
vim wget whiptail zerofree"
desktop="kali-desktop-xfce kali-root-login xfonts-terminus xinput \
xserver-xorg-video-fbdev"
#desktop="kali-desktop-xfce kali-root-login xfonts-terminus xinput \
#xserver-xorg-video-fbdev"
tools="kali-linux-default"
#tools="kali-linux-default"
services="apache2 atftpd"
@@ -322,7 +322,7 @@ apt download -o APT::Sandbox::User=root ca-certificates 2>/dev/null
cp /etc/skel/.bashrc /root/.bashrc
# Set a REGDOMAIN. This needs to be done or wireless doesn't work correctly on the RPi 3B+
sed -i -e 's/REGDOM.*/REGDOMAIN=00/g' /etc/default/crda
##sed -i -e 's/REGDOM.*/REGDOMAIN=00/g' /etc/default/crda
# Enable login over serial
echo 'T1:12345:respawn:/sbin/agetty 115200 ttyS0 vt100' >> /etc/inittab
@@ -346,7 +346,8 @@ systemd-nspawn_exec /third-stage
systemd-nspawn_exec dpkg-divert --remove --rename /usr/bin/dpkg
# Clean system
systemd-nspawn_exec <<'EOF'
#systemd-nspawn_exec <<'EOF'
cat <<EOF >${work_dir}/rm.sh
rm -f /0
rm -rf /bsp
fc-cache -frs
@@ -361,9 +362,11 @@ rm -rf /var/lib/apt/lists/*
rm -rf /var/cache/apt/*.bin
rm -rf /var/cache/apt/archives/*
rm -rf /var/cache/debconf/*.data-old
for logs in $(find /var/log -type f); do > $logs; done
for logs in \$(find /var/log -type f); do > \$logs; done
history -c
EOF
chmod 0755 ${work_dir}/rm.sh
#systemd-nspawn_exec /rm.sh
# Disable the use of http proxy in case it is enabled
if [ -n "$proxy_url" ]; then
@@ -401,6 +404,7 @@ export ARCH=arm
export CROSS_COMPILE="${base_dir}"/gcc-arm-linux-gnueabihf-4.7/bin/arm-linux-gnueabihf-
patch -p1 --no-backup-if-mismatch <${repo_dir}/patches/mac80211-backports.patch
patch -p1 --no-backup-if-mismatch <${repo_dir}/patches/0001-wireless-carl9170-Enable-sniffer-mode-promisc-flag-t.patch
cp ${repo_dir}/dtc-lexer.lex.c ${work_dir}/usr/src/kernel/scripts/dtc/dtc-lexer.lex.c
make odroidc_defconfig
cp .config ../odroidc.config
make -j $(grep -c processor /proc/cpuinfo)
@@ -723,6 +727,7 @@ root_extra=$((${root_size} / 1024 / 1000 * 5 * 1024 / 5))
raw_size=$(($((${free_space} * 1024)) + ${root_extra} + $((${bootsize} * 1024)) + 4096))
# Create the disk and partition it
image_dir=${repo_dir}
echo "Creating image file ${image_name}.img"
fallocate -l $(echo ${raw_size}Ki | numfmt --from=iec-i --to=si) "${image_dir}/${image_name}.img"
parted -s "${image_dir}/${image_name}.img" mklabel msdos