Update and fix gateworks-ventana.sh

This commit is contained in:
Arszilla
2022-08-22 20:25:09 +03:00
parent 4e37edced4
commit fa72599178

View File

@@ -9,8 +9,10 @@
# Hardware model
hw_model=${hw_model:-"gateworks-ventana"}
# Architecture
architecture=${architecture:-"armhf"}
# Desktop manager (xfce, gnome, i3, kde, lxde, mate, e17 or none)
desktop=${desktop:-"xfce"}
@@ -80,12 +82,14 @@ cd "${base_dir}"
status "Kernel stuff"
git clone --depth 1 -b gateworks_4.20.7 https://github.com/gateworks/linux-imx6 ${work_dir}/usr/src/kernel
cd ${work_dir}/usr/src/kernel
# Don't change the version because of our patches
touch .scmversion
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf- mrproper
patch -p1 <${repo_dir}/patches/veyron/4.19/kali-wifi-injection.patch
patch -p1 <${repo_dir}/patches/veyron/4.19/wireless-carl9170-Enable-sniffer-mode-promisc-flag-t.patch
# Remove redundant YYLOC global declaration
patch -p1 <${repo_dir}/patches/11647f99b4de6bc460e106e876f72fc7af3e54a6-1.patch
cp ${repo_dir}/kernel-configs/gateworks-ventana-4.20.7.config .config
@@ -95,7 +99,8 @@ make uImage LOADADDR=0x10008000
make modules_install INSTALL_MOD_PATH=${work_dir}
cp arch/arm/boot/dts/imx6*-gw*.dtb ${work_dir}/boot/
cp arch/arm/boot/uImage ${work_dir}/boot/
# cleanup
# Cleanup
cd ${work_dir}/usr/src/kernel
make mrproper
@@ -125,18 +130,23 @@ parted -s -a minimal "${image_dir}/${image_name}.img" mkpart primary $fstype 4Mi
# Set the partition variables
make_loop
# Create file systems
mkfs_partitions
# Make fsta.
make_fstab
# Create the dirs for the partitions and mount them
status "Create the dirs for the partitions and mount them"
mkdir -p "${base_dir}"/root/
if [[ $fstype == ext4 ]]; then
mount -t ext4 -o noatime,data=writeback,barrier=0 "${rootp}" "${base_dir}"/root
else
mount "${rootp}" "${base_dir}"/root
fi
status "Rsyncing rootfs into image file"