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

build e os script debian bookworm - #34D92C475C

  1. builde.sh
  2.  
  3. #!/bin/bash
  4. #clear
  5. #while true; do
  6. # read -p "When you flash the ROM be aware that lock screen and fingerprint can be removed easily, to prevent this encrypt your phone. Check community.e.foundation if your model supports encryption. I understand this message and want to coninue:(y/n)" yn
  7. # case $yn in
  8. # [Yy]* ) break;;
  9. # [Nn]* ) exit;;
  10. # * ) echo "Please answer yes or no.";;
  11. # esac
  12. #done
  13.  
  14. # Install build dependencies
  15. ############################
  16. #apt-get -qq update
  17. #apt-get -qqy upgrade
  18.  
  19. apt-get install -y bc bison bsdmainutils build-essential ccache cgpt clang cron \
  20. curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick kmod \
  21. curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick kmod \
  22. lib32ncurses5-dev libncurses5 lib32readline-dev lib32z1-dev libtinfo5 liblz4-tool \
  23. libncurses5-dev libsdl1.2-dev libssl-dev libxml2 \
  24. libxml2-utils lsof lzop maven pngcrush \
  25. procps python python3 rsync schedtool squashfs-tools software-properties-common wget xdelta3 xsltproc yasm \
  26. zip zlib1g-dev
  27.  
  28. #install google repo
  29. ####################
  30. mkdir ~/bin 2>/dev/null
  31. PATH="$HOME/bin:$PATH"
  32. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
  33. chmod a+x ~/bin/repo
  34.  
  35. # Environment variables
  36. #######################
  37.  
  38. mkdir -p root
  39.  
  40. export WORKDIRR=/smartphone_builde_e_os//htc_one_m8_v1.13-q
  41.  
  42. export TMP_DIR=$WORKDIRR/tmp
  43.  
  44. export SRC_DIR=$WORKDIRR/src
  45. export CCACHE_DIR=$WORKDIRR/ccache
  46. export ZIP_DIR=$WORKDIRR/zips
  47. export LMANIFEST_DIR=$WORKDIRR/local_manifests
  48. export DELTA_DIR=$WORKDIRR/delta
  49. export KEYS_DIR=$WORKDIRR/keys
  50. export LOGS_DIR=$WORKDIRR/logs
  51. export USERSCRIPTS_DIR=$WORKDIRR/userscripts
  52.  
  53. export DEBIAN_FRONTEND=noninteractive
  54. export USER=root
  55.  
  56. ####################################
  57. # MES MODIFS PERSO #
  58. ####################################
  59.  
  60. # Environment for the LineageOS branches name
  61. # See https://github.com/LineageOS/android_vendor_cm/branches for possible options
  62. #
  63. export BRANCH_NAME='v1.13-q'
  64.  
  65. # Environment for the device
  66. # eg. DEVICE=hammerhead
  67. export DEVICE_LIST='m8'
  68.  
  69. # Repo use for build
  70. export REPO='https://gitlab.e.foundation/e/os/releases.git'
  71.  
  72. # Repo use for build
  73. export MIRROR=''
  74.  
  75. # OTA URL that will be used inside CMUpdater
  76. # Use this in combination with LineageOTA to make sure your device can auto-update itself from this buildbot
  77. export OTA_URL=''
  78.  
  79. # NE COMPILE QUE LE MINIMUM DES APPLICATIONS
  80. #export MINIMAL_APPS=false
  81.  
  82. # ON NE PEUT QU'AJOUTER DES APPLICATIONS, mais avant, les ajouter dans le dossier prebuiltapk
  83. # Custom packages to be installed
  84.  
  85.  
  86. # Include proprietary files, downloaded automatically from github.com/TheMuppets/
  87. # Only some branches are supported
  88. export INCLUDE_PROPRIETARY=false
  89.  
  90. # User identity
  91. export USER_NAME=''
  92. export USER_MAIL=''
  93.  
  94. #export SIGNATURE_SPOOFING=restricted
  95.  
  96. ####################################
  97. # Configurable environment variables
  98. ####################################
  99.  
  100. # By default we want to use CCACHE, you can disable this
  101. # WARNING: disabling this may slow down a lot your builds!
  102. export USE_CCACHE=1
  103.  
  104. # ccache maximum size. It should be a number followed by an optional suffix: k,
  105. # M, G, T (decimal), Ki, Mi, Gi or Ti (binary). The default suffix is G. Use 0
  106. # for no limit.
  107. export CCACHE_SIZE=100G
  108.  
  109. # Clean artifacts output after each build
  110. export CLEAN_AFTER_BUILD=true
  111.  
  112. # If you want to preserve old ZIPs set this to 'false'
  113. export CLEAN_OUTDIR=false
  114.  
  115. # Release type string
  116. export RELEASE_TYPE='UNOFFICIAL'
  117. #export LLVM_ENABLE_THREADS=1
  118.  
  119. # Change this cron rule to what fits best for you
  120. # Use 'now' to start the build immediately
  121. # For example, '0 10 * * *' means 'Every day at 10:00 UTC'
  122. export CRONTAB_TIME='now'
  123.  
  124. # Provide a default JACK configuration in order to avoid out-of-memory issues
  125. #export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
  126.  
  127. # Custom packages to be installed
  128. #export CUSTOM_PACKAGES='PdfViewer GmsCore GsfProxy FakeStore com.google.android.maps.jar Mail BlissLauncher BlissIconPack MozillaNlpBackend OpenWeatherMapWeatherProvider AccountManager MagicEarth Camera eDrive Weather Notes Tasks NominatimNlpBackend DroidGuard OpenKeychain Message Browser BrowserWebView Apps LibreOfficeViewer'
  129.  
  130. # Sign the builds with the keys in $KEYS_DIR
  131. export SIGN_BUILDS=true
  132.  
  133. # When SIGN_BUILDS = true but no keys have been provided, generate a new set with this subject
  134. export KEYS_SUBJECT='/C=FR/ST=French/L=Paris View/O=Android/OU=Android/CN=Android/emailAddress='
  135.  
  136. # Move the resulting zips to $ZIP_DIR/$codename instead of $ZIP_DIR/
  137. export ZIP_SUBDIR=true
  138.  
  139. # Write the verbose logs to $LOGS_DIR/$codename instead of $LOGS_DIR/
  140. export LOGS_SUBDIR=true
  141.  
  142. # Generate delta files
  143. export BUILD_DELTA=false
  144.  
  145. # Backup the .img in addition to zips
  146. export BACKUP_IMG=false
  147.  
  148. # Delete old zips in $ZIP_DIR, keep only the N latest one (0 to disable)
  149. export DELETE_OLD_ZIPS=0
  150.  
  151. # Delete old deltas in $DELTA_DIR, keep only the N latest one (0 to disable)
  152. export DELETE_OLD_DELTAS=0
  153.  
  154. # Delete old logs in $LOGS_DIR, keep only the N latest one (0 to disable)
  155. export DELETE_OLD_LOGS=0
  156.  
  157. # Create a JSON file that indexes the build zips at the end of the build process
  158. # (for the updates in OpenDelta). The file will be created in $ZIP_DIR with the
  159. # specified name; leave empty to skip it.
  160. # Requires ZIP_SUBDIR.
  161. export OPENDELTA_BUILDS_JSON=''
  162.  
  163. # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts:
  164. # * begin.sh, run at the very beginning
  165. # * before.sh, run after the syncing and patching, before starting the builds
  166. # * pre-build.sh, run before the build of every device
  167. # * post-build.sh, run after the build of every device
  168. # * end.sh, run at the very end
  169. # Each script will be run in $SRC_DIR and must be owned and writeable only by
  170. # root
  171.  
  172. # Create missing directories
  173. ############################
  174. mkdir -p $TMP_DIR
  175.  
  176. mkdir -p $SRC_DIR
  177. mkdir -p $CCACHE_DIR
  178. mkdir -p $ZIP_DIR
  179. mkdir -p $LMANIFEST_DIR
  180. mkdir -p $DELTA_DIR
  181. mkdir -p $KEYS_DIR
  182. mkdir -p $LOGS_DIR
  183. mkdir -p $USERSCRIPTS_DIR
  184.  
  185. # Copy build files to /home/jo/compile
  186. ############################
  187. rm -rf $TMP_DIR/buildscripts
  188. git clone https://gitlab.e.foundation/e/os/docker-lineage-cicd.git $TMP_DIR/buildscripts
  189.  
  190. rm -rf $WORKDIRR/root/*
  191. cp -rf $TMP_DIR/buildscripts/src/* $WORKDIRR/root/
  192. cp -rf $TMP_DIR/buildscripts/build-community.sh $WORKDIRR/root/build.sh
  193.  
  194. # Install build dependencies
  195. ############################
  196. cp $TMP_DIR/buildscripts/apt_preferences /etc/apt/preferences
  197.  
  198. # Download and build delta tools
  199. ################################
  200. cd $WORKDIRR/root/ && \
  201. mkdir delta && \
  202. echo "cloning"
  203. git clone --depth=1 https://gitlab.e.foundation/e/os/android_packages_apps_OpenDelta.git OpenDelta && \
  204. gcc -o delta/zipadjust OpenDelta/jni/zipadjust.c OpenDelta/jni/zipadjust_run.c -lz && \
  205. cp OpenDelta/server/minsignapk.jar OpenDelta/server/opendelta.sh delta/ && \
  206. chmod +x delta/opendelta.sh && \
  207. rm -rf OpenDelta/ && \
  208. sed -i -e "s|^\s*HOME=.*|HOME=$WORKDIRR/root|; \
  209. s|^\s*BIN_XDELTA=.*|BIN_XDELTA=xdelta3|; \
  210. s|^\s*FILE_MATCH=.*|FILE_MATCH=lineage-\*.zip|; \
  211. s|^\s*PATH_CURRENT=.*|PATH_CURRENT=$SRC_DIR/out/target/product/$DEVICE|; \
  212. s|^\s*PATH_LAST=.*|PATH_LAST=$SRC_DIR/delta_last/$DEVICE|; \
  213. s|^\s*KEY_X509=.*|KEY_X509=$KEYS_DIR/releasekey.x509.pem|; \
  214. s|^\s*KEY_PK8=.*|KEY_PK8=$KEYS_DIR/releasekey.pk8|; \
  215. s|publish|$DELTA_DIR|g" $WORKDIRR/root/delta/opendelta.sh
  216.  
  217. # Set the work directory
  218. ########################
  219. cd $SRC_DIR
  220.  
  221. # Allow redirection of stdout to docker logs
  222. ############################################
  223. #ln -sf /proc/1/fd/1 /var/log/docker.log
  224.  
  225.  
  226. #sed -i 's/\/root;/$WORKDIRR/root;/g' init.sh
  227. sed -i 's#/root#$WORKDIRR/root#g' $WORKDIRR/root/init.sh
  228. sed -i 's#/root#$WORKDIRR/root#g' $WORKDIRR/root/build.sh
  229. # Set the entry point to init.sh
  230. ################################
  231. $WORKDIRR/root/init.sh
  232.  
  233. #end script

Pied de page des forums

Propulsé par FluxBB