Skip to content

Commit

Permalink
scripts, tools: drop amlpkg building
Browse files Browse the repository at this point in the history
  • Loading branch information
kszaq authored and MilhouseVH committed Jun 19, 2019
1 parent 68a053b commit f0b6c13
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 110 deletions.
3 changes: 0 additions & 3 deletions Makefile
Expand Up @@ -14,9 +14,6 @@ image:
noobs:
./scripts/image noobs

amlpkg:
./scripts/image amlpkg

clean:
rm -rf $(BUILD_DIRS)/* $(BUILD_DIRS)/.stamps

Expand Down
83 changes: 3 additions & 80 deletions scripts/image
Expand Up @@ -34,7 +34,6 @@ function do_mkimage() {
TARGET_IMG="$TARGET_IMG" \
BUILD_NAME="$IMAGE_NAME" \
IMAGE_NAME="${1:-$IMAGE_NAME}" \
INSTALL_SRC_DIR="$INSTALL_SRC_DIR" \
BOOTLOADER="$BOOTLOADER" \
KERNEL_NAME="$KERNEL_NAME" \
TARGET_KERNEL_ARCH="$TARGET_KERNEL_ARCH" \
Expand Down Expand Up @@ -242,7 +241,7 @@ rm -rf $FAKEROOT_SCRIPT
# Set permissions
chmod 0644 $TARGET_IMG/$IMAGE_NAME.system

if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]; then
if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "noobs" ]; then

RELEASE_DIR="target/$IMAGE_NAME"

Expand Down Expand Up @@ -305,14 +304,7 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]
)

# Create image files if requested
if [[ ( "$1" = "amlpkg" || "$1" = "noobs" || "$1" = "mkimage" ) && -n "$BOOTLOADER" ]]; then
# INSTALL_SRC_DIR can be board specific
if [ -n "$DEVICE" -a -d "$PROJECT_DIR/$PROJECT/devices/$DEVICE/install" ]; then
INSTALL_SRC_DIR="$PROJECT_DIR/$PROJECT/devices/$DEVICE/install"
else
INSTALL_SRC_DIR="$PROJECT_DIR/$PROJECT/install"
fi

if [[ ( "$1" = "noobs" || "$1" = "mkimage" ) && -n "$BOOTLOADER" ]]; then
UUID_SYSTEM="$(date '+%d%m')-$(date '+%M%S')"
UUID_STORAGE="$(uuidgen)"

Expand Down Expand Up @@ -341,76 +333,7 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ]
# Cleanup release dir
rm -rf $RELEASE_DIR

# Create WeTek Play (Amlogic) ZIP update and auto-install packages if requested
if [ "$1" = "amlpkg" ]; then
echo "Creating Amlogic ZIP update package"

AML_PKG_DIR="$RELEASE_DIR/ampl-pkg"

# Create package directory
mkdir -p "$AML_PKG_DIR"

# Copy system and kernel images
mkdir -p "$AML_PKG_DIR/system"
cp $TARGET_IMG/$IMAGE_NAME.system $AML_PKG_DIR/system/SYSTEM
cp $TARGET_IMG/$IMAGE_NAME.kernel $AML_PKG_DIR/KERNEL

# Copy update-binary and updater-script
META_INF_DIR="$AML_PKG_DIR/META-INF/com/google/android"
mkdir -p "$META_INF_DIR"
cp $INSTALL_SRC_DIR/update-binary $META_INF_DIR
cp $INSTALL_SRC_DIR/updater-script $META_INF_DIR

# Copy other files if any
if [ -d "$INSTALL_SRC_DIR/files" ]; then
cp -PR $INSTALL_SRC_DIR/files/* $AML_PKG_DIR
fi

# Copy device tree image if any
if [ -f "$INSTALL/usr/share/bootloader/dtb.img" ]; then
cp "$INSTALL/usr/share/bootloader/dtb.img" $AML_PKG_DIR/dtb.img
fi

# Create the update package
pushd "$AML_PKG_DIR" > /dev/null
zip -rq update.zip *

# Sign the update package
echo "Signing the update package"
mkdir -p sign
SIGNAPK_DIR="$ROOT/tools/signapk"
java -Xmx1024m -jar $SIGNAPK_DIR/signapk.jar -w $SIGNAPK_DIR/testkey.x509.pem $SIGNAPK_DIR/testkey.pk8 update.zip sign/$IMAGE_NAME-update.zip

# Create the auto-install package
echo "Creating Amlogic ZIP auto-install package"
pushd sign > /dev/null
echo --update_package=/sdcard/$IMAGE_NAME-update.zip > factory_update_param.aml
echo --wipe_data >> factory_update_param.aml
echo --wipe_cache >> factory_update_param.aml
if [ -f "$INSTALL_SRC_DIR/files/recovery.img" ]; then
cp $INSTALL_SRC_DIR/files/recovery.img .
fi

if [ -f $INSTALL_SRC_DIR/files/aml_autoscript ]; then
cp $INSTALL_SRC_DIR/files/aml_autoscript .
fi

# Copy device tree image if any
if [ -f "$INSTALL/usr/share/bootloader/dtb.img" ]; then
cp "$INSTALL/usr/share/bootloader/dtb.img" .
fi

zip -q $TARGET_IMG/$IMAGE_NAME.zip *

# Create sha256 checksum of zip
( cd $TARGET_IMG
sha256sum ${IMAGE_NAME}.zip > ${IMAGE_NAME}.zip.sha256
)

popd > /dev/null
popd > /dev/null

elif [ "$1" = "noobs" ]; then
if [ "$1" = "noobs" ]; then
echo "Creating \"$1\" release tarball..."

RELEASE_DIR="$TARGET_IMG/${IMAGE_NAME}-$1"
Expand Down
Binary file removed tools/signapk/signapk.jar
Binary file not shown.
Binary file removed tools/signapk/testkey.pk8
Binary file not shown.
27 changes: 0 additions & 27 deletions tools/signapk/testkey.x509.pem

This file was deleted.

0 comments on commit f0b6c13

Please sign in to comment.