Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 202510
  • master
  • 202406
  • 202304
  • ci_docker_preperation
  • 202206
  • 202110
  • 202109
  • 202108
  • 202104
  • 202101
  • 202012
  • 202011
  • 202008
  • 202005
  • 202004
  • Aufteilung-Lohne
  • 202002
  • 20191001_hotfix
  • 201912
  • new-patch-to-solve-the-problems-with-ff05-address-foo
  • 20191020
  • update-modules
  • revert-a7fab921
  • ffms-abziehen
  • 201910
  • offline-ssid-jetzt-aber-wirklich
  • offline-ssid-neu2
  • offline-ssid-neu
  • 201909
  • 201908
  • 201906
  • 201905
  • 201904
  • 201903
  • remove-stefans-invalid-key
  • polygone-shaped-domains
  • patch-1
  • offline-ssid
  • 201807
  • add-lingen-to-hood-grafschaft-bentheim
  • 201804
  • 201803
  • 201802
  • tunneldigger-update
  • 201712
  • 201711
  • 201710
  • v2017.1.x-fix
  • 201708
  • 201706
  • 201705
  • hoodselector_IEEE802.11s
  • johannes/201704_2
  • 201704
  • johannes/201704
  • johannes/201703
  • 201702
  • 201701
  • 1.2.1
  • 1.2
  • 1.1.2
  • 1.1
  • 1.0
  • 0.9
  • 0.5.5.1
  • 0.5.5.2
  • 0.5.5.3
  • 0.5.5.4
  • 0.5.6
  • 0.5.6.1
  • 0.5.6.2
  • 0.5.6.3
  • 20170125
  • 20170222
  • 20170409
  • 20170410
  • 20170530
  • 20170629
  • 20170822
  • 20171211
  • 20171216
  • 20171220
  • 20180225
  • 20180318
  • 20180403
  • 20180413
  • 20180709
  • 20181124
  • 20190808
  • 20191001
  • 20191024
  • 20191224
  • 20200212
  • 20200525
  • 20200820
  • 20201102
  • 20201128
  • 20201207
  • 20210427
  • 20210915
  • rc/20201207
  • rc/20201221
  • rc/20210103
  • rc/20210427
  • rc/20210810
  • rc/20210915
  • rc/20211030
  • rc/20220608
  • rc/20230407
  • rc/20230409
  • rc/20230421
  • rc/20240617
  • rc/20251023
  • stable/20201128
  • stable/20201221
  • stable/20210103
  • stable/20210915
  • stable/20220608
  • v0.5.3
  • v0.5.6
  • v0.6
  • v0.6.1
  • v0.6.2
  • v0.6.3
  • v0.7.1
  • v0.8
  • v0.8.1
  • v0.8.2
  • v0.9
  • v1.0
  • v1.1
  • v1.1-RC0
  • v1.1-RC3
  • v1.1.1
  • v1.2
  • v1.2.1
137 results

Target

Select target project
  • Firmware / siteconf
  • picard / siteconf
  • Johannes Rudolph / siteconf
  • Netmon-SC / siteconf
  • Clemens John / siteconf
  • Lorenz Wenner / siteconf
  • Florian Lottes / siteconf
  • Jens Ellerbrock / siteconf
8 results
Select Git revision
  • master
  • 201906
  • 201905
  • Aufteilung-Lohne
  • 201904
  • 201903
  • remove-stefans-invalid-key
  • polygone-shaped-domains
  • offline-ssid-neu
  • patch-1
  • offline-ssid
  • 201807
  • add-lingen-to-hood-grafschaft-bentheim
  • 201804
  • 201803
  • 201802
  • tunneldigger-update
  • 201712
  • 201711
  • 201710
  • v2017.1.x-fix
  • 201708
  • 201706
  • 201705
  • hoodselector_IEEE802.11s
  • johannes/201704_2
  • 201704
  • johannes/201704
  • johannes/201703
  • 201702
  • 201701
  • 1.2.1
  • 1.2
  • 1.1.2
  • 1.1
  • 1.0
  • 0.9
  • 0.5.5.1
  • 0.5.5.2
  • 0.5.5.3
  • 0.5.5.4
  • 0.5.6
  • 0.5.6.1
  • 0.5.6.2
  • 0.5.6.3
  • 20170125
  • 20170222
  • 20170409
  • 20170410
  • 20170530
  • 20170629
  • 20170822
  • 20171211
  • 20171216
  • 20171220
  • 20180225
  • 20180318
  • 20180403
  • 20180413
  • 20180709
  • 20181124
  • 20190628
  • v0.5.3
  • v0.5.6
  • v0.6
  • v0.6.1
  • v0.6.2
  • v0.6.3
  • v0.7.1
  • v0.8
  • v0.8.1
  • v0.8.2
  • v0.9
  • v1.0
  • v1.1
  • v1.1-RC0
  • v1.1-RC3
  • v1.1.1
  • v1.2
  • v1.2.1
80 results
Show changes
48 files
+ 2613
1097
Compare changes
  • Side-by-side
  • Inline

Files

+32 −0
Original line number Diff line number Diff line
#!/bin/bash

# Exit script on error
set -e

# Required environment variables
required_env_vars=(
  "UPSTREAM_GLUON_BRANCH"
  "ECDSA_PRIVAT_KEY"
  "SSH_PRIVATE_KEY"
  "GLUON_COMMIT_ID_FROM_PREVIOUS_RUN"
  "ACCESS_TOKEN"
)

# Function to check if required environment variables are set
check_required_env_vars() {
  for var in "${required_env_vars[@]}"; do
    if [ -z "${!var}" ]; then
      echo "ENV Variable $var is unset"
      exit 1
    fi
  done
  echo "All ENV Variables are present"
}

echo ""
echo "##################################"
echo "Check required environment variables"
echo "##################################"
echo ""

check_required_env_vars
+48 −0
Original line number Diff line number Diff line
#!/bin/bash

# Determine parent directory
PARENT_DIR=$(dirname "$GIT_CLONE_PATH")

# Function to delete contents of the gluon directory except for the site directory
delete_gluon_contents() {
  find "$PARENT_DIR" -mindepth 1 -maxdepth 1 ! \( -name 'site' -o -name 'site.tmp' \) -exec rm -rf {} +
}

# Function to clone the Gluon repository
clone_gluon_repository() {
  git clone https://github.com/freifunk-gluon/gluon.git "$GIT_CLONE_PATH/gluon_temp"
  delete_gluon_contents
  local available_space
  available_space=$(df -h / | awk 'NR==2 {print $4}')  # Get available space in the root directory
  local required_space="200G"  # Set the required minimum space (adjust as needed)
  echo "Available space: $available_space"
  if [[ "$available_space" < "$required_space" ]]; then
    echo "Error: Insufficient disk space. Required at least $required_space, but only $available_space is available."
    exit 1
  fi
  rsync -a "$GIT_CLONE_PATH/gluon_temp/" "$PARENT_DIR"
  rm -rf "$GIT_CLONE_PATH/gluon_temp"

  # Checkout the specified branch
  cd "$PARENT_DIR" || exit
  git checkout "$UPSTREAM_GLUON_BRANCH"
}

# Clone or update Gluon repository
if [ ! -d "$PARENT_DIR/.git" ]; then
  clone_gluon_repository
else
  cd "$PARENT_DIR" || exit

  # Get the current branch in Gluon repository
  CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

  # Compare the current branch with the specified branch
  if [ "$CURRENT_BRANCH" != "$UPSTREAM_GLUON_BRANCH" ]; then
    # Re-clone the Gluon repository
    clone_gluon_repository
  else
    git fetch origin
    git reset --hard origin/"$UPSTREAM_GLUON_BRANCH"
  fi
fi

.ci/dependencies.sh

0 → 100755
+104 −0
Original line number Diff line number Diff line
#!/bin/bash

# Exit script on error
set -e

# OS Program lists
debian_progarr=(
  shellcheck
  yamllint
  git
  subversion
  python3
  python3-distutils
  build-essential
  gawk
  unzip
  libncurses5-dev
  zlib1g-dev
  libssl-dev
  libelf-dev
  wget
  qemu-utils
  time
  ecdsautils
  rsync
)

arch_progarr=(
  shellcheck
  yamllint
  git
  svn
  python
  python-distutils-extra
  gawk
  unzip
  ncurses
  zlib
  openssl
  wget
  time
  ecdsautils
  rsync
  qemu-base
)

echop() {
  echo "$1 detected ..."
}

command_exists() {
  command -v "$1" > /dev/null 2>&1
}

check_dependencies() {
  local os_name=$1
  local -a progarr=()
  local ret=0

  case $os_name in
    debian)
      progarr=("${debian_progarr[@]}")
      ;;
    arch)
      progarr=("${arch_progarr[@]}")
      ;;
    *)
      echo "OS is not supported"
      exit 1
      ;;
  esac

  for prog in "${progarr[@]}"; do
    if command_exists "$prog"; then
      echop "$prog"
    elif [ "$os_name" == "debian" ] && dpkg -s "$prog" > /dev/null 2>&1; then
      echop "$prog"
    elif [ "$os_name" == "arch" ] && pacman -Qi "$prog" > /dev/null 2>&1; then
      echop "$prog"
    else
      echo "$prog is not installed"
      ret=1
    fi
  done
  return $ret
}

# Main script
echo ""
echo "##################################"
echo "Check dependencies"
echo "##################################"
echo ""


# Determine OS and check dependencies
if [ -f /etc/debian_version ]; then
  check_dependencies "debian"
elif [ -f /etc/arch-release ]; then
  check_dependencies "arch"
else
  echo "OS is not supported"
  exit 1
fi

.ci/deploy.sh

0 → 100755
+25 −0
Original line number Diff line number Diff line
#!/bin/bash

CI_BUILD_REF_NAME="$1"

if ! [ -e ".GLUON_RELEASE" ]; then
	  exit 1
fi
GLUON_RELEASE="$(cat ".GLUON_RELEASE")"
if ! [ -e ".GLUON_AUTOUPDATER_BRANCH" ]; then
		exit 1
fi
GLUON_AUTOUPDATER_BRANCH="$(cat ".GLUON_AUTOUPDATER_BRANCH")"

ssh runner@firmware.ffnw.de -C "rm -rf /var/www/dev/firmware/fastd/nightly/$CI_BUILD_REF_NAME"
ssh runner@firmware.ffnw.de -C "rm -rf /var/www/dev/firmware/l2tp/nightly/$CI_BUILD_REF_NAME"

rsync -av ../output/images/fastd/"$GLUON_RELEASE"/factory/* runner@firmware.ffnw.de:/var/www/dev/firmware/fastd/nightly/"$CI_BUILD_REF_NAME"
rsync -av ../output/images/fastd/"$GLUON_RELEASE"/other/* runner@firmware.ffnw.de:/var/www/dev/firmware/fastd/nightly/"$CI_BUILD_REF_NAME"
rsync -av ../output/images/fastd/"$GLUON_RELEASE"/sysupgrade/* runner@firmware.ffnw.de:/var/www/dev/firmware/fastd/nightly/"$CI_BUILD_REF_NAME"
ssh runner@firmware.ffnw.de -C "ln -sr /var/www/dev/firmware/fastd/nightly/$CI_BUILD_REF_NAME/$GLUON_AUTOUPDATER_BRANCH.manifest /var/www/dev/firmware/fastd/nightly/$CI_BUILD_REF_NAME/manifest"

rsync -av ../output/images/l2tp/"$GLUON_RELEASE"/factory/* runner@firmware.ffnw.de:/var/www/dev/firmware/l2tp/nightly/"$CI_BUILD_REF_NAME"
rsync -av ../output/images/l2tp/"$GLUON_RELEASE"/other/* runner@firmware.ffnw.de:/var/www/dev/firmware/l2tp/nightly/"$CI_BUILD_REF_NAME"
rsync -av ../output/images/l2tp/"$GLUON_RELEASE"/sysupgrade/* runner@firmware.ffnw.de:/var/www/dev/firmware/l2tp/nightly/"$CI_BUILD_REF_NAME"
ssh runner@firmware.ffnw.de -C "ln -sr /var/www/dev/firmware/l2tp/nightly/$CI_BUILD_REF_NAME/$GLUON_AUTOUPDATER_BRANCH.manifest /var/www/dev/firmware/l2tp/nightly/$CI_BUILD_REF_NAME/manifest"

.ci/pre-commit-hook

0 → 100755
+8 −0
Original line number Diff line number Diff line
#!/bin/sh

echo "Executing pre-commit hook..."
gitRootDir=$(git rev-parse --show-toplevel)
if ! "$gitRootDir"/.ci/dependencies.sh ; then exit 1; fi
if ! "$gitRootDir"/.ci/shelllint.sh ; then exit 1; fi
if ! "$gitRootDir"/.ci/yamllint.sh ; then exit 1; fi
exit 0

.ci/shelllint.sh

0 → 100755
+11 −0
Original line number Diff line number Diff line
#!/bin/sh

echo "Running ShellLint..."
ret=0

filelist="$(find . -type d -name .git -prune -o -type f -exec sh -c 'for file do file "$file" | grep -q -E "shell|bash|dash|ksh" && echo "$file"; done' sh {} +)"
for line in $filelist; do
	shellcheck "$line"
	[ $? -eq 1 ] && ret=1
done
exit $ret

.ci/sign.sh

0 → 100755
+36 −0
Original line number Diff line number Diff line
#!/bin/bash

if ! [ -e ".GLUON_RELEASE" ]; then
	exit 1
fi
GLUON_RELEASE="$(cat ".GLUON_RELEASE")"

if ! [ -e ".GLUON_AUTOUPDATER_BRANCH" ]; then
	exit 1
fi
GLUON_AUTOUPDATER_BRANCH="$(cat ".GLUON_AUTOUPDATER_BRANCH")"

ECDSA_PRIVAT_KEY="$1"
echo "$ECDSA_PRIVAT_KEY" > ecdsa.priv
ret=0

echo "$PWD"/ecdsa.priv

if [ -d "../output/images/fastd" ]; then
	echo "Signing fastd manifest..."
	../contrib/sign.sh "$PWD"/ecdsa.priv "$PWD/../output/images/fastd/$GLUON_RELEASE/sysupgrade/$GLUON_AUTOUPDATER_BRANCH.manifest"
	ret=$?
else
	echo "Fastd directory not found."
fi

if [ -d "../output/images/l2tp" ]; then
	echo "Signing l2tp manifest..."
	../contrib/sign.sh "$PWD"/ecdsa.priv "$PWD/../output/images/l2tp/$GLUON_RELEASE/sysupgrade/$GLUON_AUTOUPDATER_BRANCH.manifest"
	ret=$?
else
	echo "L2tp directory not found."
fi

rm ecdsa.priv
exit $ret

.ci/yaml_rules.yaml

0 → 100644
+9 −0
Original line number Diff line number Diff line
---

extends: default

rules:
  line-length:
    level: error
    max: 100
    allow-non-breakable-inline-mappings: true

.ci/yamllint.sh

0 → 100755
+14 −0
Original line number Diff line number Diff line
#!/bin/sh

echo "Running yamllint..."
ret=0

filelist="$(find . -type d -name .git -prune -o -type f -name '*.yaml' -o -name '*.yml')"
for file in $filelist; do
	lint_output="$(yamllint --strict -d ./.ci/yaml_rules.yaml "$file")"
	if [ -n "$lint_output" ]; then
		echo "$lint_output"
		ret=1
	fi
done
exit $ret
+1 −1
Original line number Diff line number Diff line
.GLUON_BRANCH
.GLUON_AUTOUPDATER_BRANCH
.GLUON_RELEASE
.patched
.prepare

.gitlab-ci.yml

0 → 100644
+140 −0
Original line number Diff line number Diff line
---
variables:
  GIT_CLONE_PATH: $CI_BUILDS_DIR/gluon/site

stages:
  - dependencies
  - lint
  - patch
  - parameters
  - build
  - sign
  - deploy
  - cleanup

# check all needed dependencies.
dependencies:
  stage: dependencies
  tags:
    - firmware
  before_script:
    # check for required environment variables
    - ./.ci/check_env_variables.sh
    # Clone or update Gluon repository
    - ./.ci/clone_or_update_gluon.sh
    - |
      (
        if [[ "$CI_PIPELINE_SOURCE" == "schedule" ]]; then
          cd ..
          HEAD_COMMIT_ID=$(git rev-parse HEAD)
          cd $GIT_CLONE_PATH
          if [ "$HEAD_COMMIT_ID" == "$GLUON_COMMIT_ID_FROM_PREVIOUS_RUN" ]; then
            touch skip_pipeline
          fi
        fi
      )
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./.ci/dependencies.sh
  artifacts:
    paths:
      - skip_pipeline
    expire_in: 1 day

# lint all common shell scripts
shelllint:
  stage: lint
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./.ci/shelllint.sh

# lint all common yamel files
yamllint:
  stage: lint
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./.ci/yamllint.sh

# update and patch gluon
prepare_gluon:
  stage: patch
  tags:
    - firmware
  artifacts:
    paths:
      - .patched
    expire_in: 1 day
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - touch .patched
    - ./buildscript.sh clean_patches
    - ./buildscript.sh patch

parameters:
  stage: parameters
  tags:
    - firmware
  artifacts:
    paths:
      - .GLUON_AUTOUPDATER_BRANCH
      - .GLUON_RELEASE
    expire_in: 1 day
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./buildscript.sh prepare GLUON_AUTOUPDATER_BRANCH nightly_master
    - ./buildscript.sh prepare GLUON_RELEASE $(date +%Y%m%d)

build:
  stage: build
  only:
    - master
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - touch .prepare
    - ./buildscript.sh build all

sign:
  stage: sign
  only:
    - master
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./.ci/sign.sh $ECDSA_PRIVAT_KEY

deploy:
  stage: deploy
  only:
    - master
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - ./.ci/deploy.sh $CI_COMMIT_REF_NAME

cleanup:
  stage: cleanup
  only:
    - master
  tags:
    - firmware
  script:
    - if [ -f skip_pipeline ]; then exit 0; fi  # Exit the job if marker file exists
    - touch .patched
    - ./buildscript.sh clean_patches
    - rm -rf ../output
    - |
      (
        cd ..
        export HEAD_COMMIT_ID=$(git rev-parse HEAD)
        cd $GIT_CLONE_PATH
        curl --request PUT --header "PRIVATE-TOKEN: $ACCESS_TOKEN" \
             "https://git.ffnw.de/api/v4/projects/$CI_PROJECT_ID/variables/GLUON_COMMIT_ID_FROM_PREVIOUS_RUN?value=$HEAD_COMMIT_ID"
      )
+14 −15
Original line number Diff line number Diff line
## Als Entwickler tätig werden

Falls dich das Thema der Software entwicklung begeistert und du gerne bereit bist dich in komplexe strukturen einzuarbeiten, sowie gerne einen beitreg zu Freifunk leisten möchtes kannst du dich unter folgenden Link über einen einstieg erkundigen:
Falls dich das Thema der Softwareentwicklung begeistert und du gerne bereit bist dich in komplexe Strukturen einzuarbeiten, sowie gerne einen Beitrag zu Freifunk leisten möchtest kannst du dich unter folgendem Link über einen Einstieg erkundigen:
https://wiki.ffnw.de/Entwicklung/Als\_Entwickler\_t%C3%A4tig\_werden

## Firmware Kompilieren

### Voraussetzungen (Stand Gluon v2016.2.x):
### Voraussetzungen (Stand Gluon v2023.2.x):

Muss auf dem Rechner installiert sein. Hier Beispiel Debian:
Folgende Pakete müssen auf dem Rechner installiert sein. Hier Beispiel Debian:

    apt-get install git subversion python build-essential gawk unzip libncurses-dev libz-dev libssl-dev
    apt-get install git subversion python build-essential gawk unzip libncurses-dev libz-dev libssl-dev wget time

### Gluon kompilieren

@@ -17,20 +17,19 @@ Auf dieser Seite wird beschrieben, wie man die Gluon Firmware für das Freifunk

*Wichtig* Je nach Entwicklungsstand muss die Branch Version angepasst werden.

    git clone https://github.com/freifunk-gluon/gluon.git ./freifunk_build -b v2016.2.x && cd ./freifunk_build
    git clone https://git.ffnw.de/ffnw-firmware/siteconf.git site -b 20170502 && de site
./prepare.sh patch
    cd ..
    make update
    # GLUON_BRANCH: gibt den zu verwendenden Gluon-Branch an
    # GLUON_TARGET: gibt die Gruppe der zu bauenden Images an (siehe Gluon Doku)
    # V: wenn V=s dann wird debug Output beim Kompilieren eingeschaltet
    make -j $(($(grep -c processor /proc/cpuinfo)*2)) GLUON_BRANCH=stable GLUON_TARGET=ar71xx-generic V=s
    git clone https://github.com/freifunk-gluon/gluon.git -b v2023.2.x && cd gluon
    git clone https://git.ffnw.de/ffnw-firmware/siteconf.git site && cd site
    ./buildscript.sh patch
    ./buildscript.sh prepare GLUON_AUTOUPDATER_BRANCH <autoupdater-branch, also zB "stable" oder "testing">
    ./buildscript.sh prepare GLUON_RELEASE <Releasecodename, zB das aktuelle Datum im Format YYYYMMDD>
    ./buildscript.sh prepare <vpn, zB "fastd" oder "l2tp">
    ./buildscript.sh build <target, zB "x86-generic"> fast

### Manifest und initiale Signatur erstellen
*Hinweis* Auf Multicoresystemen sorgt die option `fast` dafür, dass alle vefügbaren CPU-Kerne für den Build genutzt werden.

    make manifest GLUON_BRANCH=stable
### Manifest und initiale Signatur erstellen

    ./buildscript.sh create_manifest manifest
    ./contrib/sign.sh ../firmware/release_keys/ecdsa-privatekey ./output/images/sysupgrade/stable.manifest

Weitere Informationen z.B. zu automatischen Builds auch unter https://gluon.readthedocs.org/en/latest/features/autoupdater.html