Skip to content
Snippets Groups Projects
Commit 16d7b70d authored by zouxf's avatar zouxf
Browse files

firefly: add userdata partition, auto modify rootfs size

1. add userdata partition in package-file
2. auto modify rootfs size in parameter

Change-Id: I8855e3e4a406cc46245d543d6db8d268013376d8
parent b49d3bbe
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ echo "Press any key to quit:"
read -n1 -s key
exit 1
}
echo "start to make update.img..."
if [ ! -f "Image/parameter" -a ! -f "Image/parameter.txt" ]; then
echo "Error:No found parameter!"
......@@ -14,9 +15,30 @@ if [ ! -f "package-file" ]; then
echo "Error:No found package-file!"
exit 1
fi
ALIGN()
{
X=$1
A=$2
OUT=$(($((${X} + ${A} -1 ))&$((~$((${A}-1))))))
printf 0x%x ${OUT}
}
FSIZE=$(stat $(readlink -f Image/rootfs.img) -c %b)
PSIZE=$(ALIGN $((${FSIZE}+204800)) 512)
PARA_FILE=$(readlink -f Image/parameter.txt)
ORIGIN=$(grep -Eo "0x[0-9a-fA-F]*@0x[0-9a-fA-F]*\(rootfs" $PARA_FILE)
NEWSTR=$(echo $ORIGIN | sed "s/.*@/${PSIZE}@/g")
OFFSET=$(echo $NEWSTR | grep -Eo "@0x[0-9a-fA-F]*" | cut -f 2 -d "@")
NEXT_START=$(printf 0x%x $(($PSIZE + $OFFSET)))
sed -i.orig "s/$ORIGIN/$NEWSTR/g" $PARA_FILE
sed -i "/^CMDLINE.*/s/-@0x[0-9a-fA-F]*/-@$NEXT_START/g" $PARA_FILE
./afptool -pack ./ Image/update.img || pause
./rkImageMaker -RK322H Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
echo "Making update.img OK."
#echo "Press any key to quit:"
#read -n1 -s key
mv ${PARA_FILE}.orig ${PARA_FILE}
exit $?
......@@ -7,7 +7,8 @@ parameter Image/parameter.txt
trust Image/trust.img
uboot Image/uboot.img
boot Image/boot.img
recovery Image/recovery.img
misc Image/misc.img
rootfs:grow Image/rootfs.img
misc Image/misc.img
recovery Image/recovery.img
rootfs Image/rootfs.img
userdata:grow RESERVED
backup RESERVED
......@@ -5,6 +5,7 @@ echo "Press any key to quit:"
read -n1 -s key
exit 1
}
echo "start to make update.img..."
if [ ! -f "Image/parameter" -a ! -f "Image/parameter.txt" ]; then
echo "Error:No found parameter!"
......@@ -14,9 +15,30 @@ if [ ! -f "package-file" ]; then
echo "Error:No found package-file!"
exit 1
fi
ALIGN()
{
X=$1
A=$2
OUT=$(($((${X} + ${A} -1 ))&$((~$((${A}-1))))))
printf 0x%x ${OUT}
}
FSIZE=$(stat $(readlink -f Image/rootfs.img) -c %b)
PSIZE=$(ALIGN $((${FSIZE}+204800)) 512)
PARA_FILE=$(readlink -f Image/parameter.txt)
ORIGIN=$(grep -Eo "0x[0-9a-fA-F]*@0x[0-9a-fA-F]*\(rootfs" $PARA_FILE)
NEWSTR=$(echo $ORIGIN | sed "s/.*@/${PSIZE}@/g")
OFFSET=$(echo $NEWSTR | grep -Eo "@0x[0-9a-fA-F]*" | cut -f 2 -d "@")
NEXT_START=$(printf 0x%x $(($PSIZE + $OFFSET)))
sed -i.orig "s/$ORIGIN/$NEWSTR/g" $PARA_FILE
sed -i "/^CMDLINE.*/s/-@0x[0-9a-fA-F]*/-@$NEXT_START/g" $PARA_FILE
./afptool -pack ./ Image/update.img || pause
./rkImageMaker -RK330C Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
echo "Making ./Image/update.img OK."
#echo "Press any key to quit:"
#read -n1 -s key
mv ${PARA_FILE}.orig ${PARA_FILE}
exit $?
......@@ -9,5 +9,6 @@ uboot Image/uboot.img
boot Image/boot.img
misc Image/misc.img
recovery Image/recovery.img
rootfs:grow Image/rootfs.img
rootfs Image/rootfs.img
userdata:grow RESERVED
backup RESERVED
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment