logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

Raw Paste Créer un nouveau Paste

Sans titre - #3B8CF926CC

  1. #!/bin/bash
  2. #install google repo
  3. ####################
  4. mkdir ~/bin 2>/dev/null
  5. PATH="$HOME/bin:$PATH"
  6. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  7. chmod a+x ~/bin/repo
  8.  
  9. # Environment variables
  10. #######################
  11. #######################
  12. export MIRROR_DIR=/srv/e/mirror
  13. export SRC_DIR=/srv/e/src
  14. export TMP_DIR=/srv/e/tmp
  15. export CCACHE_DIR=/srv/e/ccache
  16. export ZIP_DIR=/srv/e/zips
  17. export LMANIFEST_DIR=/srv/e/local_manifests
  18. export DELTA_DIR=/srv/e/delta
  19. export KEYS_DIR=/srv/e/keys
  20. export LOGS_DIR=/srv/e/logs
  21. export USERSCRIPTS_DIR=/srv/e/userscripts
  22.  
  23. export DEBIAN_FRONTEND=noninteractive
  24. export USER=root
  25.  
  26. # Configurable environment variables
  27. ####################################
  28. # By default we want to use CCACHE, you can disable this
  29. # WARNING: disabling this may slow down a lot your builds!
  30. export USE_CCACHE=1
  31.  
  32. # ccache maximum size. It should be a number followed by an optional suffix: k,
  33. # M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0
  34. # for no limit.
  35. export CCACHE_SIZE=100
  36.  
  37. # Clean artifacts output after each build
  38. export CLEAN_AFTER_BUILD=false
  39.  
  40. # If you want to preserve old ZIPs set this to 'false'
  41. export CLEAN_OUTDIR=false
  42.  
  43. # Include proprietary files, downloaded automatically from github.com/TheMuppets/
  44. # Only some branches are supported
  45. export INCLUDE_PROPRIETARY=false
  46.  
  47. # Environment for the LineageOS branches name
  48. # See https://github.com/LineageOS/android_vendor_cm/branches for possible options
  49. export BRANCH_NAME='v1-pie'
  50.  
  51. # Environment for the device list (separate by comma if more than one)
  52. # eg. DEVICE_LIST=hammerhead,bullhead,angler
  53. export DEVICE_LIST='nitrogen'
  54.  
  55. # Release type string
  56. export RELEASE_TYPE='UNOFFICIAL'
  57.  
  58. # Repo use for build
  59. export REPO='https://gitlab.e.foundation/e/os/android.git'
  60.  
  61. # Repo use for build
  62. export MIRROR=''
  63.  
  64. # OTA URL that will be used inside CMUpdater
  65. # Use this in combination with LineageOTA to make sure your device can auto-update itself from this buildbot
  66. export OTA_URL=''
  67.  
  68. # User identity
  69. export USER_NAME='user'
  70. export USER_MAIL='user@email.edu'
  71.  
  72. # Mount an overlay filesystem over the source dir to do each build on a clean source
  73. export BUILD_OVERLAY=false
  74.  
  75. # Clone the full LineageOS mirror (> 200 GB)
  76. export LOCAL_MIRROR=false
  77.  
  78. # Change this cron rule to what fits best for you
  79. # Use 'now' to start the build immediately
  80. # For example, '0 10 * * *' means 'Every day at 10:00 UTC'
  81. export CRONTAB_TIME='now'
  82.  
  83. # Provide root capabilities builtin inside the ROM (see http://lineageos.org/Update-and-Build-Prep/)
  84. export WITH_SU=false
  85.  
  86. # Provide a default JACK configuration in order to avoid out-of-memory issues
  87. export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
  88.  
  89. # Custom packages to be installed
  90. export CUSTOM_PACKAGES='MuPDF GmsCore GsfProxy FakeStore com.google.android.maps.jar Mail BlissLauncher BlissIconPack MozillaNlpBackend OpenWeatherMapWeatherProvider AccountManager OpenCamera eDrive Weather NominatimNlpBackend DroidGuard OpenKeychain Message Browser BrowserWebView Apps LibreOfficeViewer'
  91.  
  92. # Sign the builds with the keys in $KEYS_DIR
  93. export SIGN_BUILDS=false
  94.  
  95. # When SIGN_BUILDS = true but no keys have been provided, generate a new set with this subject
  96. export KEYS_SUBJECT='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/emailAddress=android@android.com'
  97.  
  98. # Move the resulting zips to $ZIP_DIR/$codename instead of $ZIP_DIR/
  99. export ZIP_SUBDIR=true
  100.  
  101. # Write the verbose logs to $LOGS_DIR/$codename instead of $LOGS_DIR/
  102. export LOGS_SUBDIR=true
  103.  
  104. # Apply the MicroG's signature spoofing patch
  105. # Valid values are "no", "yes" (for the original MicroG's patch) and
  106. # "restricted" (to grant the permission only to the system privileged apps).
  107. #
  108. # The original ("yes") patch allows user apps to gain the ability to spoof
  109. # themselves as other apps, which can be a major security threat. Using the
  110. # restricted patch and embedding the apps that requires it as system privileged
  111. # apps is a much secure option. See the README.md ("Custom mode") for an
  112. # example.
  113. ## export SIGNATURE_SPOOFING="restricted"
  114.  
  115. # Generate delta files
  116. export BUILD_DELTA=false
  117.  
  118. # Delete old zips in $ZIP_DIR, keep only the N latest one (0 to disable)
  119. export DELETE_OLD_ZIPS=0
  120.  
  121. # Delete old deltas in $DELTA_DIR, keep only the N latest one (0 to disable)
  122. export DELETE_OLD_DELTAS=0
  123.  
  124. # Delete old logs in $LOGS_DIR, keep only the N latest one (0 to disable)
  125. export DELETE_OLD_LOGS=0
  126.  
  127. # Create a JSON file that indexes the build zips at the end of the build process
  128. # (for the updates in OpenDelta). The file will be created in $ZIP_DIR with the
  129. # specified name; leave empty to skip it.
  130. # Requires ZIP_SUBDIR.
  131. export OPENDELTA_BUILDS_JSON=''
  132.  
  133. # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts:
  134. # * begin.sh, run at the very beginning
  135. # * before.sh, run after the syncing and patching, before starting the builds
  136. # * pre-build.sh, run before the build of every device
  137. # * post-build.sh, run after the build of every device
  138. # * end.sh, run at the very end
  139. # Each script will be run in $SRC_DIR and must be owned and writeable only by
  140. # root
  141.  
  142. # Create missing directories
  143. ############################
  144. mkdir -p $MIRROR_DIR
  145. mkdir -p $SRC_DIR
  146. mkdir -p $TMP_DIR
  147. mkdir -p $CCACHE_DIR
  148. mkdir -p $ZIP_DIR
  149. mkdir -p $LMANIFEST_DIR
  150. mkdir -p $DELTA_DIR
  151. mkdir -p $KEYS_DIR
  152. mkdir -p $LOGS_DIR
  153. mkdir -p $USERSCRIPTS_DIR
  154.  
  155. # Copy build files to /root/
  156. ############################
  157. rm -rf $TMP_DIR/buildscripts
  158.  
  159. if [[ $BRANCH_NAME =~ pie$ ]]; then
  160. if [ "$1" = "--nosync" ]; then
  161. git clone --branch dev https://github.com/picomatic/docker-lineage-cicd.git $TMP_DIR/buildscripts
  162. else
  163. git clone --branch dev https://gitlab.e.foundation/e/os/docker-lineage-cicd.git $TMP_DIR/buildscripts
  164. fi
  165. else
  166. if [ "$1" = "--nosync" ]; then
  167. git clone https://github.com/picomatic/docker-lineage-cicd.git $TMP_DIR/buildscripts
  168. else
  169. git clone https://gitlab.e.foundation/e/os/docker-lineage-cicd.git $TMP_DIR/buildscripts
  170. fi
  171. fi
  172.  
  173. cp -rf $TMP_DIR/buildscripts/src/* /root/
  174. cp $TMP_DIR/buildscripts/apt_preferences /etc/apt/preferences
  175. # Download and build delta tools
  176. ################################
  177. cd /root/ && \
  178. mkdir delta && \
  179. echo "cloning"
  180. git clone --depth=1 https://github.com/omnirom/android_packages_apps_OpenDelta.git OpenDelta && \
  181. gcc -o delta/zipadjust OpenDelta/jni/zipadjust.c OpenDelta/jni/zipadjust_run.c -lz && \
  182. cp OpenDelta/server/minsignapk.jar OpenDelta/server/opendelta.sh delta/ && \
  183. chmod +x delta/opendelta.sh && \
  184. rm -rf OpenDelta/ && \
  185. sed -i -e "s|^\s*HOME=.*|HOME=/root|; \
  186. s|^\s*BIN_XDELTA=.*|BIN_XDELTA=xdelta3|; \
  187. s|^\s*FILE_MATCH=.*|FILE_MATCH=lineage-\*.zip|; \
  188. s|^\s*PATH_CURRENT=.*|PATH_CURRENT=$SRC_DIR/out/target/product/$DEVICE|; \
  189. s|^\s*PATH_LAST=.*|PATH_LAST=$SRC_DIR/delta_last/$DEVICE|; \
  190. s|^\s*KEY_X509=.*|KEY_X509=$KEYS_DIR/releasekey.x509.pem|; \
  191. s|^\s*KEY_PK8=.*|KEY_PK8=$KEYS_DIR/releasekey.pk8|; \
  192. s|publish|$DELTA_DIR|g" /root/delta/opendelta.sh
  193.  
  194. # Set the work directory
  195. ########################
  196. cd $SRC_DIR
  197.  
  198. # Allow redirection of stdout to docker logs
  199. ############################################
  200. ln -sf /proc/1/fd/1 /var/log/docker.log
  201.  
  202. # Set the entry point to init.sh
  203. ################################
  204. /root/init.sh
  205.  
  206. #end script

Pied de page des forums

Propulsé par FluxBB