[Bugfix][T106BUG-246]fix fakeroot compile error
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I463d8ec830dfc32323437bbb4f862426382df478
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
index f7ff653..9e504f7 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-core/images/files/squashfs_dm-verity.sh
@@ -4,18 +4,17 @@
WORK_DIR=$2
OUT_FILE=$3
PRIV_KEY=$4
-SignImage=$5
VERITY_DIR=$WORK_DIR/verity
-rm -rf $VERITY_DIR $OUT_FILE $OUT_FILE.pad
+rm -rf $VERITY_DIR/raw_table $VERITY_DIR/hash_tree $VERITY_DIR/sign
mkdir -p $VERITY_DIR
# 1.pad
let size="$(stat -c%s $IN_FILE)" pad="128*1024" offset="0" pad="(pad - ((size + offset) % pad)) % pad" newsize='size + pad'
echo $size $newsize
dd if=$IN_FILE of=$OUT_FILE bs=$newsize count=1 conv=sync
-#cp -v $OUT_FILE $OUT_FILE.pad
+cp -v $OUT_FILE $OUT_FILE.pad
# 2. gen raw_table and hash_tree
veritysetup format $OUT_FILE $VERITY_DIR/hash_tree > $VERITY_DIR/raw_table
@@ -25,16 +24,14 @@
fi
# 3. gen signature of raw_table
-#openssl dgst -sha256 -binary -sign $PRIV_KEY $VERITY_DIR/raw_table > $VERITY_DIR/sign
-$SignImage -i $VERITY_DIR/raw_table -o $VERITY_DIR/raw_table.signed -k $PRIV_KEY
+openssl dgst -sha256 -binary -sign $PRIV_KEY $VERITY_DIR/raw_table > $VERITY_DIR/sign
if [ $? -ne 0 ]; then
echo "generate squashfs dm-verity sign error!"
exit 1
fi
-dd if=$VERITY_DIR/raw_table.signed of=$VERITY_DIR/sign bs=640 count=1 status=none
# 4. padding sign, raw_table and hash_tree to input file
-$WORK_DIR/zxic_generate_squashfs_verity $OUT_FILE $VERITY_DIR/sign $VERITY_DIR/raw_table $VERITY_DIR/hash_tree
+$WORK_DIR/generate_squashfs_verity $OUT_FILE $VERITY_DIR/sign $VERITY_DIR/raw_table $VERITY_DIR/hash_tree
if [ $? -ne 0 ]; then
echo "generate squashfs dm-verity error!"
exit 1