summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Kryszyn <j.kryszyn@samsung.com>2023-08-21 15:52:45 +0200
committerJacek Kryszyn <j.kryszyn@samsung.com>2023-08-21 15:52:45 +0200
commitad62a14c88e8f7ad7044bd64841f33369c0e6ff2 (patch)
tree0ab1062fe180793750841cebddc7d1ab299d7990
parenta95e0d24e532a85d42412613e2c97f4336ba399d (diff)
downloaddynpart-tools-ad62a14c88e8f7ad7044bd64841f33369c0e6ff2.tar.gz
dynpart-tools-ad62a14c88e8f7ad7044bd64841f33369c0e6ff2.tar.bz2
dynpart-tools-ad62a14c88e8f7ad7044bd64841f33369c0e6ff2.zip
cleanup
-rwxr-xr-xREADME.md24
-rwxr-xr-xlpmake_non_sparse.sh2
-rwxr-xr-xlpmake_sparse.sh2
-rwxr-xr-xmake.sh241
4 files changed, 144 insertions, 125 deletions
diff --git a/README.md b/README.md
index 1dca6b9..492d13a 100755
--- a/README.md
+++ b/README.md
@@ -1,14 +1,22 @@
+Original project: https://github.com/LonelyFool/lpunpack_and_lpmake
+Copied from commit 7ec860cfa95ed83dec579ab0459aad1c35ad48e4
+
# lpunpack and lpmake
To cross-compile you need `crossbuild-essential-arm64`/`crossbuild-essential-armel`/`crossbuild-essential-armhf` (sudo apt install $package).
+``
build:
-./make.sh $ARCH
-where $ARCH:
-- x86_64 (default, can be ommited)
-- i686
-- arm7hf
-- arm7vl (though it doesn't compile for now)
-- aarch64
+```
+mkdir build
+cd build
+cmake ../
+make
+
+```
+
+or you can use original makefile:
-source code from aosp
+```
+make
+``` \ No newline at end of file
diff --git a/lpmake_non_sparse.sh b/lpmake_non_sparse.sh
deleted file mode 100755
index ce3e9db..0000000
--- a/lpmake_non_sparse.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-./x86_64/lpmake --device-size=3221225472 --metadata-size=65536 --metadata-slots=2 -o=/tmp/super.img -g "tizen_a:1609564160" -p "rootfs_a:none:1341128704:tizen_a" -p "hal_a:none:268435456:tizen_a" -g "tizen_b:1609564160" -p "rootfs_b:none:1341128704:tizen_b" -p "hal_b:none:268435456:tizen_b"
diff --git a/lpmake_sparse.sh b/lpmake_sparse.sh
deleted file mode 100755
index c7b2a69..0000000
--- a/lpmake_sparse.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/bash
-./x86_64/lpmake -S --device-size=3221225472 --metadata-size=65536 --metadata-slots=2 -o=/tmp/super_sparse.img -g "tizen_a:1610547200" -p "rootfs_a:none:1237254144:tizen_a" -p "hal_a:none:268435456:tizen_a" -g "tizen_b:1610547200" -p "rootfs_b:none:1237254144:tizen_b" -p "hal_b:none:268435456:tizen_b" -i "rootfs_a=plik.txt" -i "rootfs_b=plik.txt" -i "hal_a=plik.txt" -i "hal_b=plik.txt"
diff --git a/make.sh b/make.sh
index dce53e3..bad817a 100755
--- a/make.sh
+++ b/make.sh
@@ -1,38 +1,10 @@
#!/bin/bash
set -x -e
-
-if [ "$#" -eq 0 ]; then
- ARCH="x86_64"
-else
- ARCH=$1
-fi
-
-if [ "$ARCH" = "aarch64" ]; then
- CC=aarch64-linux-gnu-gcc
- CPP=aarch64-linux-gnu-g++
- AR=aarch64-linux-gnu-ar
- STRIP=aarch64-linux-gnu-strip
-elif [ "$ARCH" = "arm7vl" ]; then
- CC=arm-linux-gnueabi-gcc
- CPP=arm-linux-gnueabi-g++
- AR=arm-linux-gnueabi-ar
- STRIP=arm-linux-gnueabi-strip
-elif [ "$ARCH" = "arm7hf" ]; then
- CC=arm-linux-gnueabihf-gcc
- CPP=arm-linux-gnueabihf-g++
- AR=arm-linux-gnueabihf-ar
- STRIP=arm-linux-gnueabihf-strip
-elif [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "i686" ]; then
- CC=clang
- CPP=clang++
- AR=ar
- STRIP=strip
-else
- echo "Unknown architecture. Goodbye."
- exit 1
-fi
-
-mkdir -p lib/lib "bin/$ARCH"
+mkdir -p lib/lib bin
+CC=clang
+CPP=clang++
+AR=ar
+STRIP=strip
CFLAGS=-static
cd lib
@@ -103,76 +75,119 @@ case "$OSTYPE" in
;;
esac
-case "$ARCH" in
- arm7vl|arm7hf)
- src="linux-arm/crypto/chacha/chacha-armv4.S \
- linux-arm/crypto/fipsmodule/aes-armv4.S \
- linux-arm/crypto/fipsmodule/aesv8-armx32.S \
- linux-arm/crypto/fipsmodule/armv4-mont.S \
- linux-arm/crypto/fipsmodule/bsaes-armv7.S \
- linux-arm/crypto/fipsmodule/ghash-armv4.S \
- linux-arm/crypto/fipsmodule/ghashv8-armx32.S \
- linux-arm/crypto/fipsmodule/sha1-armv4-large.S \
- linux-arm/crypto/fipsmodule/sha256-armv4.S \
- linux-arm/crypto/fipsmodule/sha512-armv4.S \
- linux-arm/crypto/fipsmodule/vpaes-armv7.S \
- linux-arm/crypto/test/trampoline-armv4.S \
- src/crypto/curve25519/asm/x25519-asm-arm.S \
- src/crypto/poly1305/poly1305_arm_asm.S"
- ;;
- aarch64)
- src="linux-aarch64/crypto/chacha/chacha-armv8.S \
- linux-aarch64/crypto/fipsmodule/aesv8-armx64.S \
- linux-aarch64/crypto/fipsmodule/armv8-mont.S \
- linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S \
- linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S \
- linux-aarch64/crypto/fipsmodule/sha1-armv8.S \
- linux-aarch64/crypto/fipsmodule/sha256-armv8.S \
- linux-aarch64/crypto/fipsmodule/sha512-armv8.S \
- linux-aarch64/crypto/fipsmodule/vpaes-armv8.S \
- linux-aarch64/crypto/test/trampoline-armv8.S"
- ;;
- i686)
- src="linux-x86/crypto/chacha/chacha-x86.S \
- linux-x86/crypto/fipsmodule/aes-586.S \
- linux-x86/crypto/fipsmodule/aesni-x86.S \
- linux-x86/crypto/fipsmodule/bn-586.S \
- linux-x86/crypto/fipsmodule/co-586.S \
- linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S \
- linux-x86/crypto/fipsmodule/ghash-x86.S \
- linux-x86/crypto/fipsmodule/md5-586.S \
- linux-x86/crypto/fipsmodule/sha1-586.S \
- linux-x86/crypto/fipsmodule/sha256-586.S \
- linux-x86/crypto/fipsmodule/sha512-586.S \
- linux-x86/crypto/fipsmodule/vpaes-x86.S \
- linux-x86/crypto/fipsmodule/x86-mont.S \
- linux-x86/crypto/test/trampoline-x86.S"
- ;;
- x86_64)
- src="linux-x86_64/crypto/chacha/chacha-x86_64.S \
- linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S \
- linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S \
- linux-x86_64/crypto/fipsmodule/aes-x86_64.S \
- linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S \
- linux-x86_64/crypto/fipsmodule/aesni-x86_64.S \
- linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S \
- linux-x86_64/crypto/fipsmodule/ghash-x86_64.S \
- linux-x86_64/crypto/fipsmodule/md5-x86_64.S \
- linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S \
- linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S \
- linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S \
- linux-x86_64/crypto/fipsmodule/rsaz-avx2.S \
- linux-x86_64/crypto/fipsmodule/sha1-x86_64.S \
- linux-x86_64/crypto/fipsmodule/sha256-x86_64.S \
- linux-x86_64/crypto/fipsmodule/sha512-x86_64.S \
- linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S \
- linux-x86_64/crypto/fipsmodule/x86_64-mont.S \
- linux-x86_64/crypto/fipsmodule/x86_64-mont5.S \
- linux-x86_64/crypto/test/trampoline-x86_64.S \
- src/crypto/hrss/asm/poly_rq_mul.S"
- ;;
-esac
-
+if [ -z "$OS"];then
+ case "$HOSTTYPE" in
+ arm)
+ src="linux-arm/crypto/chacha/chacha-armv4.S \
+ linux-arm/crypto/fipsmodule/aes-armv4.S \
+ linux-arm/crypto/fipsmodule/aesv8-armx32.S \
+ linux-arm/crypto/fipsmodule/armv4-mont.S \
+ linux-arm/crypto/fipsmodule/bsaes-armv7.S \
+ linux-arm/crypto/fipsmodule/ghash-armv4.S \
+ linux-arm/crypto/fipsmodule/ghashv8-armx32.S \
+ linux-arm/crypto/fipsmodule/sha1-armv4-large.S \
+ linux-arm/crypto/fipsmodule/sha256-armv4.S \
+ linux-arm/crypto/fipsmodule/sha512-armv4.S \
+ linux-arm/crypto/fipsmodule/vpaes-armv7.S \
+ linux-arm/crypto/test/trampoline-armv4.S \
+ src/crypto/curve25519/asm/x25519-asm-arm.S \
+ src/crypto/poly1305/poly1305_arm_asm.S"
+ ;;
+ aarch64)
+ src="linux-aarch64/crypto/chacha/chacha-armv8.S \
+ linux-aarch64/crypto/fipsmodule/aesv8-armx64.S \
+ linux-aarch64/crypto/fipsmodule/armv8-mont.S \
+ linux-aarch64/crypto/fipsmodule/ghash-neon-armv8.S \
+ linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S \
+ linux-aarch64/crypto/fipsmodule/sha1-armv8.S \
+ linux-aarch64/crypto/fipsmodule/sha256-armv8.S \
+ linux-aarch64/crypto/fipsmodule/sha512-armv8.S \
+ linux-aarch64/crypto/fipsmodule/vpaes-armv8.S \
+ linux-aarch64/crypto/test/trampoline-armv8.S"
+ ;;
+ i686)
+ src="linux-x86/crypto/chacha/chacha-x86.S \
+ linux-x86/crypto/fipsmodule/aes-586.S \
+ linux-x86/crypto/fipsmodule/aesni-x86.S \
+ linux-x86/crypto/fipsmodule/bn-586.S \
+ linux-x86/crypto/fipsmodule/co-586.S \
+ linux-x86/crypto/fipsmodule/ghash-ssse3-x86.S \
+ linux-x86/crypto/fipsmodule/ghash-x86.S \
+ linux-x86/crypto/fipsmodule/md5-586.S \
+ linux-x86/crypto/fipsmodule/sha1-586.S \
+ linux-x86/crypto/fipsmodule/sha256-586.S \
+ linux-x86/crypto/fipsmodule/sha512-586.S \
+ linux-x86/crypto/fipsmodule/vpaes-x86.S \
+ linux-x86/crypto/fipsmodule/x86-mont.S \
+ linux-x86/crypto/test/trampoline-x86.S"
+ ;;
+ x86_64)
+ src="linux-x86_64/crypto/chacha/chacha-x86_64.S \
+ linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S \
+ linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S \
+ linux-x86_64/crypto/fipsmodule/aes-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/aesni-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/ghash-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/md5-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S \
+ linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S \
+ linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/rsaz-avx2.S \
+ linux-x86_64/crypto/fipsmodule/sha1-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/sha256-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/sha512-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S \
+ linux-x86_64/crypto/fipsmodule/x86_64-mont.S \
+ linux-x86_64/crypto/fipsmodule/x86_64-mont5.S \
+ linux-x86_64/crypto/test/trampoline-x86_64.S \
+ src/crypto/hrss/asm/poly_rq_mul.S"
+ ;;
+ esac
+else
+ case "$HOSTTYPE" in
+ i686)
+ src="win-x86/crypto/chacha/chacha-x86.asm \
+ win-x86/crypto/fipsmodule/aes-586.asm \
+ win-x86/crypto/fipsmodule/aesni-x86.asm \
+ win-x86/crypto/fipsmodule/bn-586.asm \
+ win-x86/crypto/fipsmodule/co-586.asm \
+ win-x86/crypto/fipsmodule/ghash-ssse3-x86.asm \
+ win-x86/crypto/fipsmodule/ghash-x86.asm \
+ win-x86/crypto/fipsmodule/md5-586.asm \
+ win-x86/crypto/fipsmodule/sha1-586.asm \
+ win-x86/crypto/fipsmodule/sha256-586.asm \
+ win-x86/crypto/fipsmodule/sha512-586.asm \
+ win-x86/crypto/fipsmodule/vpaes-x86.asm \
+ win-x86/crypto/fipsmodule/x86-mont.asm \
+ win-x86/crypto/test/trampoline-x86.asm"
+ ;;
+ x86_64)
+ src="win-x86_64/crypto/chacha/chacha-x86_64.asm \
+ win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm \
+ win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm \
+ win-x86_64/crypto/fipsmodule/aes-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/aesni-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/ghash-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/md5-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/p256-x86_64-asm.asm \
+ win-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.asm \
+ win-x86_64/crypto/fipsmodule/rdrand-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/rsaz-avx2.asm \
+ win-x86_64/crypto/fipsmodule/sha1-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/sha256-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/sha512-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm \
+ win-x86_64/crypto/fipsmodule/x86_64-mont.asm \
+ win-x86_64/crypto/fipsmodule/x86_64-mont5.asm \
+ win-x86_64/crypto/test/trampoline-x86_64.asm"
+ ;;
+ esac
+fi
+
$CC -Iinclude -std=c99 \
${CFLAGS} \
${CFLAGS_CRYPTO} \
@@ -515,20 +530,20 @@ case "$OSTYPE" in
;;
esac
-${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o "../bin/$ARCH/lpmake" lpmake.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
+${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o ../bin/lpmake lpmake.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
-${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o "../bin/$ARCH/lpadd" lpadd.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
+${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o ../bin/lpadd lpadd.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
-${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o "../bin/$ARCH/lpflash" lpflash.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
+${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o ../bin/lpflash lpflash.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
-${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o "../bin/$ARCH/lpunpack" lpunpack.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
+${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o ../bin/lpunpack lpunpack.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a -lpthread ${LDFLAGS}
-${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o "../bin/$ARCH/lpdump" lpdump.cc dynamic_partitions_device_info.pb.cc lpdump_host.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a ../lib/lib/libjsonpbparse.a ../lib/lib/libprotobuf-cpp-full.a -lpthread ${LDFLAGS}
+${CPP} -std=c++17 -I../lib/include ${CFLAGS} -D_FILE_OFFSET_BITS=64 -o ../bin/lpdump lpdump.cc dynamic_partitions_device_info.pb.cc lpdump_host.cc ../lib/lib/liblp.a ../lib/lib/libsparse.a ../lib/lib/libext4_utils.a ../lib/lib/libz.a ../lib/lib/libbase.a ../lib/lib/fmtlib.a ../lib/lib/liblog.a ../lib/lib/libcrypto_utils.a ../lib/lib/libcrypto.a ../lib/lib/libjsonpbparse.a ../lib/lib/libprotobuf-cpp-full.a -lpthread ${LDFLAGS}
cd ..
rm -rf lib/lib
-$STRIP "bin/$ARCH/lpmake"
-$STRIP "bin/$ARCH/lpadd"
-$STRIP "bin/$ARCH/lpflash"
-$STRIP "bin/$ARCH/lpunpack"
-$STRIP "bin/$ARCH/lpdump"
+$STRIP bin/lpmake
+$STRIP bin/lpadd
+$STRIP bin/lpflash
+$STRIP bin/lpunpack
+$STRIP bin/lpdump \ No newline at end of file