Compare commits
3 Commits
93013a925a
...
4254190a14
| Author | SHA1 | Date | |
|---|---|---|---|
|
4254190a14
|
|||
|
50a2e25a9b
|
|||
|
c96db27895
|
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
./sstate
|
deploy_rpms
|
||||||
./sstate-cache
|
sstate-cache
|
||||||
./download
|
downloads
|
||||||
|
|||||||
148
README.md
148
README.md
@@ -1,6 +1,148 @@
|
|||||||
# CAROS
|
# CaROS
|
||||||
# _C_ar _R_ealtime _O_perating _S_ystem.
|
# Car Realtime Operating System.
|
||||||
|
|
||||||
A yocto base distro for DIY car radio
|
A yocto base distro for DIY car radio
|
||||||
|
|
||||||
the CaROS specific software is found in meta-caros
|
The CaROS specific software is found in meta-caros
|
||||||
|
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
### Preliminaries
|
||||||
|
|
||||||
|
Install required packages:
|
||||||
|
|
||||||
|
- podman
|
||||||
|
|
||||||
|
### Get yocto-build
|
||||||
|
```shell
|
||||||
|
git clone git@git.larsniesen.de:caros/caros.git
|
||||||
|
```
|
||||||
|
|
||||||
|
### User Namespace Mapping
|
||||||
|
|
||||||
|
Ensure, that /etc/subgid and /etc/subuid contain corresponding
|
||||||
|
and sane entries for your account (podman run user).
|
||||||
|
If not you might need to run the following setup script (requires restart):
|
||||||
|
```shell
|
||||||
|
$ sudo ./dev/AddUserToSubgidAndSubuid.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## Start development build container
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./dev/bootstrap.sh [--deploy] [--sstate]
|
||||||
|
```
|
||||||
|
|
||||||
|
By adding the parameter --deploy, bootstraph.sh maps a deploy folder into the build container.
|
||||||
|
Built RPMs will be placed in this folder.
|
||||||
|
|
||||||
|
The parameter --sstate maps the build cache directory. This allows the cache to be preserved when the container
|
||||||
|
is closed thus significantly reducing build time.
|
||||||
|
|
||||||
|
You will end up in the yocto build container as user yocto e.g.:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
[yocto@1453b5f0ab01 build]$
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Collaboration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Working with branches
|
||||||
|
|
||||||
|
Every contributor should use his/her initials (eg. Max Mustermann uses 'mm') as the branch prefix.
|
||||||
|
After the prefix comes the issue ID and a short name describing the work.
|
||||||
|
|
||||||
|
The branch of Max Mustermann regarding the issue "#13 Integrate Fancy UI into the new web server"
|
||||||
|
should be named:
|
||||||
|
|
||||||
|
```
|
||||||
|
mm/13-integrate-new-web-ui
|
||||||
|
```
|
||||||
|
|
||||||
|
### Pull requests
|
||||||
|
|
||||||
|
The pull request is to be opened **after** testing the branch feature.
|
||||||
|
The exception to this are draft PRs
|
||||||
|
|
||||||
|
Before merging each PR needs to be reviewed from at least one other contributor
|
||||||
|
|
||||||
|
### Merging
|
||||||
|
|
||||||
|
Merges are to be done the following:
|
||||||
|
|
||||||
|
1. Update main.
|
||||||
|
```
|
||||||
|
$ git pull origin
|
||||||
|
```
|
||||||
|
2. Rebase main onto your feature branches.
|
||||||
|
In your feature branch do:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git rebase origin/main
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Test Again if the rebase broke something.
|
||||||
|
4. Squash your commits into one.
|
||||||
|
```
|
||||||
|
$ git rebase -i HEAD~<num of commits>
|
||||||
|
```
|
||||||
|
In the now open editor replace `pick` with `squash` on all of your commits except the first.
|
||||||
|
After that quit the editor and another editor should pop up. Now enter the new commit message.
|
||||||
|
The commit message should look like this:
|
||||||
|
```
|
||||||
|
<issue id>: Description
|
||||||
|
```
|
||||||
|
For the above example it would be:
|
||||||
|
```
|
||||||
|
13: Integrate the new web-UI to improve the experience for new users.
|
||||||
|
```
|
||||||
|
The Description should be **why** the commit was made and not **what** the commit does.
|
||||||
|
|
||||||
|
5. Now we add the hash at the start of the commit with:
|
||||||
|
```
|
||||||
|
git commit --amend -m "#13: Integrate the new web-UI to improve the experience for new users."
|
||||||
|
```
|
||||||
|
The amend flag lets you _change_ your last commit message. You have to enter your complete commit message but with a hash at the start.
|
||||||
|
|
||||||
|
6. Now force push your branch to the remote.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git push --force
|
||||||
|
```
|
||||||
|
7. Fast-forward merge on GitLab without merge commit.
|
||||||
|
|
||||||
|
|
||||||
|
For those who are not comfortable with git rebase please follow these steps.
|
||||||
|
It is still recommended to do the squashing on the terminal.
|
||||||
|
|
||||||
|
|
||||||
|
1. Update main.
|
||||||
|
```
|
||||||
|
$ git pull origin/main
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Rebase main onto your feature branches.
|
||||||
|
In your feature branch do:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git rebase origin/main
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Test Again if the rebase broke something.
|
||||||
|
|
||||||
|
4. Now force push your branch to the remote.
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git push --force
|
||||||
|
```
|
||||||
|
|
||||||
|
5. In the PR now fast-forward merge with squashing and without merge commit.
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ YOCTO_UID="2000"
|
|||||||
YOCTO_USER="yocto"
|
YOCTO_USER="yocto"
|
||||||
YOCTO_WORKDIR="/opt/${YOCTO_USER}"
|
YOCTO_WORKDIR="/opt/${YOCTO_USER}"
|
||||||
|
|
||||||
[[ -d "$PWD"/download ]] || mkdir "$PWD"/download
|
[[ -d "$PWD"/downloads ]] || mkdir "$PWD"/downloads
|
||||||
[[ -d "$PWD"/sstate-cache ]] || mkdir "$PWD"/sstate-cache
|
[[ -d "$PWD"/sstate-cache ]] || mkdir "$PWD"/sstate-cache
|
||||||
|
|
||||||
#sudo chmod -R 775 "${PWD}"/{download,sstate-cache}
|
|
||||||
|
|
||||||
subgidSize=$(( $(podman info --format "{{ range .Host.IDMappings.GIDMap }}+{{.Size }}{{end }}" ) - 1 ))
|
subgidSize=$(( $(podman info --format "{{ range .Host.IDMappings.GIDMap }}+{{.Size }}{{end }}" ) - 1 ))
|
||||||
subuidSize=$(( $(podman info --format "{{ range .Host.IDMappings.UIDMap }}+{{.Size }}{{end }}" ) - 1 ))
|
subuidSize=$(( $(podman info --format "{{ range .Host.IDMappings.UIDMap }}+{{.Size }}{{end }}" ) - 1 ))
|
||||||
@@ -57,9 +57,10 @@ fi
|
|||||||
|
|
||||||
if $DO_DEPLOY ; then
|
if $DO_DEPLOY ; then
|
||||||
DEPLOY_PATH="deploy_rpms"
|
DEPLOY_PATH="deploy_rpms"
|
||||||
mkdir -p $DEPLOAY_PATH
|
mkdir -p $DEPLOY_PATH
|
||||||
|
rm -rf "$DEPLOY_PATH"/*
|
||||||
deploy_param1="-v"
|
deploy_param1="-v"
|
||||||
deploy_param2="${PWD}"/"${DEPOLY_PATH}":"${YOCTO_WORKDIR}"/"${DEPLOY_PATH}"
|
deploy_param2="${PWD}"/"${DEPLOY_PATH}":"${YOCTO_WORKDIR}"/"${DEPLOY_PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -81,10 +82,9 @@ podman run \
|
|||||||
-v "${PWD}"/default.xml:"${YOCTO_WORKDIR}"/default.xml \
|
-v "${PWD}"/default.xml:"${YOCTO_WORKDIR}"/default.xml \
|
||||||
-v "${PWD}"/meta-caros:"${YOCTO_WORKDIR}"/meta-caros:Z \
|
-v "${PWD}"/meta-caros:"${YOCTO_WORKDIR}"/meta-caros:Z \
|
||||||
-v "${PWD}"/dev:"${YOCTO_WORKDIR}"/dev:Z \
|
-v "${PWD}"/dev:"${YOCTO_WORKDIR}"/dev:Z \
|
||||||
-v "${PWD}"/download:"${YOCTO_WORKDIR}"/download:Z \
|
-v "${PWD}"/downloads:"${YOCTO_WORKDIR}"/downloads:Z \
|
||||||
-v "${PWD}"/sstate-cache:"${YOCTO_WORKDIR}"/sstate-cache:Z \
|
|
||||||
--env TEMPLATECONF="${YOCTO_WORKDIR}"/meta-caros/conf/templates \
|
--env TEMPLATECONF="${YOCTO_WORKDIR}"/meta-caros/conf/templates \
|
||||||
--env SSTATE_PATH="${SSTATE_PATH}" \
|
--env SSTATE_PATH="${SSTATE_PATH}" \
|
||||||
${CONTAINER_NAME} \
|
${CONTAINER_NAME} \
|
||||||
ghcr.io/jhnc-oss/yocto-image/yocto:38 \
|
ghcr.io/jhnc-oss/yocto-image/yocto:37 \
|
||||||
bash -c "dev/init_env.sh "
|
bash -c "dev/init_env.sh "
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
MACHINE ?= "genericx86-64"
|
MACHINE ?= "genericx86-64"
|
||||||
|
|
||||||
DL_DIR ?= "${TOPDIR}/downloads"
|
DL_DIR ?= "${TOPDIR}/../downloads"
|
||||||
|
|
||||||
SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
|
SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"
|
||||||
|
|
||||||
DISTRO ?= "caros"
|
DISTRO ?= "caros"
|
||||||
|
|
||||||
@@ -118,4 +118,4 @@ BB_DISKMON_DIRS ??= "\
|
|||||||
# this doesn't mean anything to you.
|
# this doesn't mean anything to you.
|
||||||
CONF_VERSION = "2"
|
CONF_VERSION = "2"
|
||||||
|
|
||||||
DEPLOY_DIR_RPM = "${TOPDIR}../deploy_rpms"
|
DEPLOY_DIR_RPM = "${TOPDIR}/../deploy_rpms"
|
||||||
|
|||||||
Reference in New Issue
Block a user