Skip to content

Commit 142bbe3

Browse files
committed
ubifs.sh: add R4 variants (2g5,pro,lite)
1 parent 5e942b3 commit 142bbe3

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

ubifs.sh

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,34 @@ if [[ -z "$initrd" ]];then
4646
fi
4747
fi
4848
touch ./ubifs/uEnv.txt
49+
50+
if [[ -n "$variant" ]];then
51+
case $variant in
52+
"bpi-r3-mini")
53+
#r3mini is not selected via uEnv.txt...uboot is compiled with fixed bootconf
54+
;;
55+
"bpi-r4-2g5")
56+
echo "is2g5=1" > ./ubifs/uEnv.txt
57+
;;
58+
"bpi-r4-pro")
59+
echo "isR4Pro=1" > ./ubifs/uEnv.txt
60+
;;
61+
"bpi-r4-lite")
62+
echo "isr4lite=1" > ./ubifs/uEnv.txt
63+
;;
64+
esac
65+
fi
4966
if [[ -n "$initrd" ]];then
5067
cp $initrd ./ubifs/
5168
if [[ $? -eq 0 ]];then
52-
echo "initrd=$initrd" > ./ubifs/uEnv.txt
69+
echo "initrd=$initrd" >> ./ubifs/uEnv.txt
5370
fi
54-
ls -lh ./ubifs/
5571
fi
72+
cat ./ubifs/uEnv.txt
5673
#cp ${kernelfile} ./ubifs/
5774
echo $kernelfile
5875
tar -xzf ${kernelfile} --strip-components=1 -C ./ubifs/ --wildcards 'BPI-BOOT/*.itb'
76+
ls -lh ./ubifs/
5977

6078
mkfs.ubifs -m 2048 -e 124KiB -c 800 -r ./ubifs/ rootfs.ubifs
6179

@@ -107,7 +125,12 @@ ubivol 3 rootfs rootfs.ubifs 1 50MiB
107125

108126
peb_size=128
109127
min_io_size=2048
110-
ubinize -vv -o ${board}_nand.img -m ${min_io_size} -p ${peb_size}KiB ubi.conf
128+
if [[ -n "${variant}" ]];then
129+
imgname=${variant}_nand.img
130+
else
131+
imgname=${board}_nand.img
132+
fi
133+
ubinize -vv -o ${imgname} -m ${min_io_size} -p ${peb_size}KiB ubi.conf
111134
if [[ $? -eq 0 ]];then
112-
echo "${board}_nand.img created..."
135+
echo "${imgname} created..."
113136
fi

0 commit comments

Comments
 (0)