aboutsummaryrefslogtreecommitdiff
path: root/utils/extract_rootfs.sh
diff options
context:
space:
mode:
authorneonloop2021-03-06 16:38:07 +0000
committerneonloop2021-03-06 16:50:11 +0000
commit4ad5efd6071cefe6cc813d5d6b38869b54a44eaf (patch)
treeb81585e8a40fe4d01fa20c25064e73748e17cb97 /utils/extract_rootfs.sh
parent9428d4c280242235a952cbeb985f9af79f6306fe (diff)
downloadtrimui-toolchain-4ad5efd6071cefe6cc813d5d6b38869b54a44eaf.tar.gz
trimui-toolchain-4ad5efd6071cefe6cc813d5d6b38869b54a44eaf.tar.bz2
trimui-toolchain-4ad5efd6071cefe6cc813d5d6b38869b54a44eaf.zip
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.
Diffstat (limited to 'utils/extract_rootfs.sh')
-rwxr-xr-xutils/extract_rootfs.sh28
1 files changed, 28 insertions, 0 deletions
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