Skip to content

Commit

Permalink
Add support for Docker image for building
Browse files Browse the repository at this point in the history
  • Loading branch information
SteadyQuad committed Sep 19, 2020
1 parent 6193486 commit 924d099
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set up build stage
FROM ubuntu:18.04 AS buildstage
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Amsterdam

RUN dpkg --add-architecture i386

RUN apt-get update && \
apt-get -y install zip wget git build-essential make \
libc6:i386 libncurses5:i386 libstdc++6:i386

ENV ROOTDIR=/pocketbook-jailbreak
WORKDIR ${ROOTDIR}

RUN wget https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2
RUN tar -xvf armv7-eabihf--musl--stable-2018.11-1.tar.bz2

RUN wget https://github.com/ezdiy/pocketbook-sdk5/archive/master.tar.gz
RUN tar -xvf master.tar.gz

ENV PATH="${ROOTDIR}/pocketbook-sdk5-master/bin:${ROOTDIR}/armv7-eabihf--musl--stable-2018.11-1/bin:${PATH}"

WORKDIR /pbjb

CMD make
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,37 @@ Use https://www.mobileread.com/forums/showthread.php?p=3921722 if you have an is

по русски: http://4pda.ru/forum/index.php?s=&showtopic=886480&view=findpost&p=92768601

This tree uses both Pocketbook SDK for dynamic linking, as well as static musl libc cross comppiler
This tree uses both Pocketbook SDK for dynamic linking, as well as static musl libc cross compiler
for critical services (ssh and smb). The SDK has poor portability between firmware versions, but allows
for using ncurses or openssl (those are not suitable for static linking).

For static musl cross compier: https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2
For static musl cross compiler: https://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--musl--stable-2018.11-1.tar.bz2
For SDK cross compiler: https://github.com/ezdiy/pocketbook-sdk5/archive/master.tar.gz

Unpack, and point your $PATH to 'bin' folder in both SDKs (gcc are differentiated by cross prefix, cc and cc5 in makefile).

Alternatively you can use a Docker image for compiling and linking, it contains the necessary (i386) packages and the above compilers/toolchains.

Requirements: [installed Docker environment](https://docs.docker.com/get-docker)

To prepare the Docker image, clone this repository with its submodule(s), if you haven't yet:

```console
git clone https://github.com/ezdiy/pbjb.git --recurse-submodules
```

build the image:
```console
cd pbjb
docker build -t pbjb .
```

To build pbjb, run the image (from within the same pbjb directory), this runs 'make':
```console
./rundocker.sh
```

You can also specify a command to run, e.g. to run a 'make clean':
```console
./rundocker.sh make clean
```
2 changes: 2 additions & 0 deletions rundocker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker run --rm -it --volume=$(pwd):/pbjb pbjb "$@"

0 comments on commit 924d099

Please sign in to comment.