forked from varigit/flexbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-kernel.sh
More file actions
executable file
·90 lines (79 loc) · 2.81 KB
/
Copy pathdebug-kernel.sh
File metadata and controls
executable file
·90 lines (79 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Debug script to check kernel build status
echo "=== Kernel Build Debug ==="
echo "Current directory: $(pwd)"
echo "FBDIR: $FBDIR"
# Source the environment
source setup.env
# Set variables like flex-builder does
DESTARCH=arm64
SOCFAMILY=IMX
KERNEL_TREE=linux
FBOUTDIR=build_lsdk2412
echo ""
echo "=== Expected Paths ==="
echo "Kernel source should be in: $FBDIR/components_lsdk2412/linux/linux"
echo "Kernel output should be in: $FBOUTDIR/linux/$KERNEL_TREE/$DESTARCH/$SOCFAMILY"
echo "Kernel build output should be in: $FBOUTDIR/linux/$KERNEL_TREE/$DESTARCH/$SOCFAMILY/output"
echo ""
echo "=== Checking Kernel Source ==="
if [ -d "components_lsdk2412/linux/linux" ]; then
echo "✓ Kernel source directory exists"
cd components_lsdk2412/linux/linux
echo "Current branch: $(git branch | grep ^* | cut -d' ' -f2)"
echo "Last commit: $(git log --oneline -1)"
cd - > /dev/null
else
echo "✗ Kernel source directory missing"
fi
echo ""
echo "=== Checking Build Output Directory ==="
if [ -d "$FBOUTDIR/linux" ]; then
echo "✓ Build linux directory exists"
find $FBOUTDIR/linux -name "*.dtb" -o -name "Image*" -o -name "config-*" | head -10
else
echo "✗ Build linux directory missing"
fi
echo ""
echo "=== Checking Expected Kernel Files ==="
expected_dir="$FBOUTDIR/linux/$KERNEL_TREE/$DESTARCH/$SOCFAMILY"
if [ -d "$expected_dir" ]; then
echo "✓ Expected directory exists: $expected_dir"
echo "Contents:"
ls -la "$expected_dir"
else
echo "✗ Expected directory missing: $expected_dir"
echo "Creating directory..."
mkdir -p "$expected_dir"
fi
echo ""
echo "=== Checking Kernel Output Directory ==="
output_dir="$FBOUTDIR/linux/$KERNEL_TREE/$DESTARCH/$SOCFAMILY/output"
if [ -d "$output_dir" ]; then
echo "✓ Kernel output directory exists: $output_dir"
# Look for built kernel files
find "$output_dir" -name "Image*" -o -name "*.dtb" | head -5
else
echo "✗ Kernel output directory missing: $output_dir"
fi
echo ""
echo "=== Checking for Built Kernel in Output ==="
if [ -d "$output_dir" ]; then
# Check for the actual built files
for branch_dir in "$output_dir"/*; do
if [ -d "$branch_dir" ]; then
echo "Branch directory: $branch_dir"
if [ -f "$branch_dir/arch/arm64/boot/Image" ]; then
echo " ✓ Found Image in: $branch_dir/arch/arm64/boot/"
fi
if [ -d "$branch_dir/arch/arm64/boot/dts/freescale" ]; then
echo " ✓ Found DTB directory: $branch_dir/arch/arm64/boot/dts/freescale"
ls "$branch_dir/arch/arm64/boot/dts/freescale/"*imx8mp-var-dart*.dtb 2>/dev/null | head -3
fi
fi
done
fi
echo ""
echo "=== Recommendation ==="
echo "If kernel files are missing, try:"
echo " bld linux -r poky:tiny -m imx8mp-var-dart -f sdk-var.yml"