aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-03-06 16:38:07 +0000
committerneonloop2021-03-06 16:50:11 +0000
commit4ad5efd6071cefe6cc813d5d6b38869b54a44eaf (patch)
treeb81585e8a40fe4d01fa20c25064e73748e17cb97
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.
-rw-r--r--.gitignore3
-rw-r--r--Dockerfile7
-rw-r--r--Makefile3
-rw-r--r--README.md4
-rw-r--r--extras/include/.keep0
-rw-r--r--extras/lib/.keep0
-rwxr-xr-xutils/extract_rootfs.sh (renamed from extract_rootfs.sh)11
7 files changed, 19 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index b4d5d53..d713d0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
.build
-workspace/* \ No newline at end of file
+workspace/*
+extras/* \ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 2e1df97..7fb7e1e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -63,11 +63,12 @@ COPY *.patch .
RUN for patch in *.patch; do patch -p0 < $patch; done
RUN make
+
WORKDIR /home/trimui
-COPY extract_rootfs.sh .
-RUN ./extract_rootfs.sh
-RUN mkdir -p $BUILDROOT_SYSROOT/usr && cp -R trimui_rootfs/usr/trimui $BUILDROOT_SYSROOT/usr/trimui
+COPY extras extras
+
+RUN rsync -av extras/* $BUILDROOT_SYSROOT/usr/
VOLUME /home/trimui/workspace
WORKDIR /home/trimui/workspace
diff --git a/Makefile b/Makefile
index 6b1e355..c15fc2b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,12 @@
WORKSPACE_DIR := $(shell pwd)/workspace
CONFIG_FILES := $(shell find trimui_config -type f)
+EXTRA_FILES := $(shell find extras -type f)
shell: .build
docker run -it --rm -v $(WORKSPACE_DIR):/home/trimui/workspace trimui-toolchain /bin/bash
.PHONY: shell
-.build: Dockerfile extract_rootfs.sh *.patch $(CONFIG_FILES)
+.build: Dockerfile *.patch $(CONFIG_FILES) $(EXTRA_FILES)
docker build -t trimui-toolchain .
touch .build
diff --git a/README.md b/README.md
index b0d2ee0..cf180ae 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,10 @@ After building the first time, unless a dependency of the image has changed, `ma
- On your host machine, clone repositories into `./workspace` and make changes as usual.
- In the container shell, find the repository in `~/workspace` and build as usual.
+### Adding additional files to the toolchain sysroot
+
+Put files that you want included in the sysroot (libs and headers, you've built, etc.) in `./extras`. They will be copied to `$SYSROOT/usr` as the container is built.
+
### Changing the buildroot configuration
In `~/buildroot`:
diff --git a/extras/include/.keep b/extras/include/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/extras/include/.keep
diff --git a/extras/lib/.keep b/extras/lib/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/extras/lib/.keep
diff --git a/extract_rootfs.sh b/utils/extract_rootfs.sh
index d253d71..8edcc9b 100755
--- a/extract_rootfs.sh
+++ b/utils/extract_rootfs.sh
@@ -5,8 +5,9 @@ TRIMUI_RESTORE_IMAGE=http://www.trimui.com/download/Trimui_Factory_Recovery_mode
TRIMUI_IMG_FILE=trimui_model_S_dark_V0.105_en.img
AWUTILS_REVISION=3f1cbb2c67752b392a88b252c51158d13d8809b5
EXTFSTOOLS_REVISION=dac938546cc769eca6e57e35d7bb49d0ef458cd3
+WORKDIR="${TMPDIR:-/tmp}"/extract_rootfs
-mkdir -p extract_rootfs && cd 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 ..
@@ -18,8 +19,10 @@ curl -L $TRIMUI_RESTORE_IMAGE -o trimui_restore_image.zip && unzip trimui_restor
awutils-$AWUTILS_REVISION/awimage $TRIMUI_IMG_FILE
-mkdir -p ../trimui_rootfs
-extfstools-$EXTFSTOOLS_REVISION/ext2rd $TRIMUI_IMG_FILE.dump/RFSFAT16_ROOTFS_FEX000000 ./:../trimui_rootfs
+popd
-cd .. && rm -r extract_rootfs
+mkdir -p trimui_rootfs
+$WORKDIR/extfstools-$EXTFSTOOLS_REVISION/ext2rd $WORKDIR/$TRIMUI_IMG_FILE.dump/RFSFAT16_ROOTFS_FEX000000 ./:./trimui_rootfs
+
+rm -r $WORKDIR