Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 4.4-kitkat branch to include configuring uid fix #38

Open
wants to merge 46 commits into
base: 4.4-kitkat
Choose a base branch
from

Conversation

jcormier
Copy link

Merged master branch into the 4.4-kitkat branch and then reverted several commits which break building for kitkat.

Note because oracle stopped allowing downloading of the jdk 6u45 installer this commit is much bigger than it would otherwise have to be. Don't know of another way around this.

Note this should make it easy to merge future commits to master back into the 4.4-kitkat branch.

kylemanna and others added 30 commits March 2, 2015 14:47
* Upstream uses OpenJDK 7, no more Oracle Java!
* Create a lollipop test script.
* Call bash to avoid issue where user didn't `chmod +x` the script.
* Error without chmod:

        exec: "run.sh": executable file not found in $PATH
…call

Now directories are owned by aosp user, there is not need to explicitly
chmod to 777. Current user will create and own the folder.
The image now provides both openjdk-7 and openjdk-8
…id/gid

This commit introduces the "docker_entrypoint" script that will create
a user with uid/gid matching given `USER_ID` and `GROUP_ID` (or default to
`1000` if not provided).

Fixes kylemanna#9

This approach works around missing docker feature discussed in
moby/moby#7198 and allow to have executable in the docker container
manipulating files in the shared volume owned by the `USER_ID:GROUP_ID`

The utility script `aosp` has also been updated to automatically
set `USER_ID` and `GROUP_ID` to the value matching the current user
by invoking "docker run" with

```
-e USER_ID=$(id -u) -e GROUP_ID=$(id -g)
```

Finally, the output has also been updated to be more verbose. For example:

```
$ AOSP_VOL=/home/jcfr/Projects/aosp-root/ aosp id
aosp: Checking if /home/jcfr/Projects/aosp-root/aosp exists
aosp: Checking if /home/jcfr/Projects/aosp-root/aosp exists - ok
aosp: Checking if /home/jcfr/Projects/aosp-root/ccache exists
aosp: Checking if /home/jcfr/Projects/aosp-root/ccache exists - ok

docker_entrypoint: Creating user UID/GID [1000/1000]
docker_entrypoint: Creating user UID/GID [1000/1000] - done
docker_entrypoint: Copying .gitconfig and .ssh/config to new user home
docker_entrypoint: Copying .gitconfig and .ssh/config to new user home - done
docker_entrypoint: Creating /tmp/ccache and /asop directory
docker_entrypoint: Creating /tmp/ccache and /asop directory - done

uid=1000(aosp) gid=1000(aosp) groups=1000(aosp)
```
The script should not attempt to create a folder "/vol0" in the filesystem
of the host, instead the directory "~/aosp-root" is created.
…rbitrary-uid-gid

Update `Dockerfile` and `utils/aosp` to work with arbitrary uid gid
* For street credit and style points
* Doesn't work, hangs-up with a java error.
* Work in progress.
* Apparently my last build had left over artifacts from another build.
* Nougat appears to work just fine.
A few ENV variables are set in the Docker file, most notably those
related to ccache.  The move to a docker entrypoint script  called
sudo to switch to the AOSP user and reset the ENV varibles.

Preserve these variables so that things set in the Dockerfile are
inherited by the environment as expected.
* Use the microbadger service instead.
* Fix the apparently missing space.
* Running as root will (among other things) try to re-create the root
  user in the container.  Avoid this by not passing the arguments and
  letting the container use its defaults.
* This enables the `make product-graph` command to build a PDF
* Closes kylemanna#16
* Only setup the volume mount if it points to a socket.
* Resolves kylemanna#14
* Warn about macOS performance and suggest workaround
* Closes kylemanna#20 kylemanna#19
@kylemanna
Copy link
Owner

This pull request is wayyy too big of a mess. Pull requests need to be clear and concise. Unfortunately this looks like it merges everything and then breaks it and then attempts to unbreak it.

@jcormier
Copy link
Author

That's fair. Would you prefer a rebase, excluding all the patches which don't work for the 4.4-kitkat build?

@kylemanna
Copy link
Owner

Cherry-picking the exact fixes would be preferred like the way the linux mainline and linux-stable kernl operates.

@jcormier
Copy link
Author

The thing is there are a large number of fixes in the main branch which could apply to the 4.4 branch. In fact pretty much every commit except the 3 I reverted which is why I went with this approach. Otherwise, I'm pretty much cherry-picking every commit which is similar to a rebase.

I'm not sure if these branches really apply to the kernel backporting workflow. I see the 4.4 branch not as an older version of the software but instead as an alternative configuration which should mostly be kept in sync with the master branch.

List of applicable commits starting from oldest. I'm ignoring all the README changes as they don't directly affect the build.

tests: Update bash script to call bash
Dockerfile: Add "aosp" group
Add convenience Makefile to easily rebuild image
Dockerfile: Prefer COPY instead of ADD
Dockerfile: Fix ownership of .gitconfig and .ssh
Dockerfile: Change ownership of /tmp/cache and /aosp directories
utils/aosp: trim trailing slash of directories
utils/aosp: Refactor code to display status message and remove chmod call
utils/aosp: Update script and Dockerfile to work with any host user uid/gid
docker_entrypoint: Default to 'bash' if no arguments are provided
utils/aosp: If no AOSP_VOL is set, create aosp volume in current home
Update `Dockerfile` and `utils/aosp` to work with arbitrary uid gid
utils: Fix harmless entrypoint msg typo
entrypoint: Preserve ENV variables
utils/aosp: Only pass UID and GID arguments if NOT root
Dockerfile: Install graphviz to enable product-graph
aosp: Check that SSH_AUTH_SOCK points to a socket
Add docker compose file and update README
CCache doesn't seem to be working -- add this in the entrypoint
store ccache volume in the source directory
[master] CCache doesn't seem to be working -- add this in the entrypoint

Its your project so I'll do it however you think works best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants