Revert "[Bugfix][T106BUG-246]fix fakeroot compile error"
This reverts commit 472acc11c26a7727e6f5c6a76104934c0a99ecc1.
Reason for revert: <INSERT REASONING HERE>
Change-Id: Ib310d82d21b087f7580f6274f7eaadd8b33405a6
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 9e504f7..f7ff653 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,17 +4,18 @@
WORK_DIR=$2
OUT_FILE=$3
PRIV_KEY=$4
+SignImage=$5
VERITY_DIR=$WORK_DIR/verity
-rm -rf $VERITY_DIR/raw_table $VERITY_DIR/hash_tree $VERITY_DIR/sign
+rm -rf $VERITY_DIR $OUT_FILE $OUT_FILE.pad
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
@@ -24,14 +25,16 @@
fi
# 3. gen signature of raw_table
-openssl dgst -sha256 -binary -sign $PRIV_KEY $VERITY_DIR/raw_table > $VERITY_DIR/sign
+#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
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/generate_squashfs_verity $OUT_FILE $VERITY_DIR/sign $VERITY_DIR/raw_table $VERITY_DIR/hash_tree
+$WORK_DIR/zxic_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