From 4ad5efd6071cefe6cc813d5d6b38869b54a44eaf Mon Sep 17 00:00:00 2001 From: neonloop Date: Sat, 6 Mar 2021 16:38:07 +0000 Subject: Stops extracting rootfs and puts extra files in the sysroot trimui rootfs only contains .so files, not that helpful for development. The script is still useful, so it moves to utils. Extra libs and headers can now be put into `./extras` and are moved into `sysroot/usr` during the build process. --- utils/extract_rootfs.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 utils/extract_rootfs.sh (limited to 'utils/extract_rootfs.sh') diff --git a/utils/extract_rootfs.sh b/utils/extract_rootfs.sh new file mode 100755 index 0000000..8edcc9b --- /dev/null +++ b/utils/extract_rootfs.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -xe + +TRIMUI_RESTORE_IMAGE=http://www.trimui.com/download/Trimui_Factory_Recovery_model_S_dark_V0.105_en.zip +TRIMUI_IMG_FILE=trimui_model_S_dark_V0.105_en.img +AWUTILS_REVISION=3f1cbb2c67752b392a88b252c51158d13d8809b5 +EXTFSTOOLS_REVISION=dac938546cc769eca6e57e35d7bb49d0ef458cd3 +WORKDIR="${TMPDIR:-/tmp}"/extract_rootfs + +mkdir -p $WORKDIR && pushd $WORKDIR + +curl -L https://github.com/Ithamar/awutils/archive/$AWUTILS_REVISION.zip -o awutils.zip && unzip awutils.zip +cd awutils-$AWUTILS_REVISION && make awimage && cd .. + +curl -L https://github.com/petib/extfstools/archive/$EXTFSTOOLS_REVISION.zip -o extfstools.zip && unzip extfstools.zip +cd extfstools-$EXTFSTOOLS_REVISION && make && cd .. + +curl -L $TRIMUI_RESTORE_IMAGE -o trimui_restore_image.zip && unzip trimui_restore_image.zip + +awutils-$AWUTILS_REVISION/awimage $TRIMUI_IMG_FILE + +popd + +mkdir -p trimui_rootfs + +$WORKDIR/extfstools-$EXTFSTOOLS_REVISION/ext2rd $WORKDIR/$TRIMUI_IMG_FILE.dump/RFSFAT16_ROOTFS_FEX000000 ./:./trimui_rootfs + +rm -r $WORKDIR -- cgit v1.2.3