Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Side by Side Diff: chrome/installer/linux/sysroot_scripts/sysroot-creator-debian.wheezy.sh

Issue 101033002: Add sysroot script for armhf linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 # 2 #
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 #@ This script builds a Debian Wheezy sysroot for building Google Chrome. 7 #@ This script builds a Debian Wheezy sysroot for building Google Chrome.
8 #@ 8 #@
9 #@ Generally this script is invoked as: 9 #@ Generally this script is invoked as:
10 #@ sysroot-creator-debian.wheezy.sh <mode> <args>* 10 #@ sysroot-creator-debian.wheezy.sh <mode> <args>*
11 #@ Available modes are shown below. 11 #@ Available modes are shown below.
12 #@ 12 #@
13 #@ List of modes: 13 #@ List of modes:
14 14
15 ###################################################################### 15 ######################################################################
16 # Config 16 # Config
17 ###################################################################### 17 ######################################################################
18 18
19 set -o nounset 19 set -o nounset
20 set -o errexit 20 set -o errexit
21 21
22 readonly SCRIPT_DIR=$(dirname $0) 22 readonly SCRIPT_DIR=$(dirname $0)
23 23
24 # This is where the staging sysroot is. 24 # This is where the staging sysroot is.
25 readonly INSTALL_ROOT_AMD64=$(pwd)/debian_wheezy_amd64_staging 25 readonly INSTALL_ROOT_AMD64=$(pwd)/debian_wheezy_amd64_staging
26 readonly INSTALL_ROOT_I386=$(pwd)/debian_wheezy_i386_staging 26 readonly INSTALL_ROOT_I386=$(pwd)/debian_wheezy_i386_staging
27 readonly INSTALL_ROOT_ARM=$(pwd)/debian_wheezy_arm_staging
27 28
28 readonly REQUIRED_TOOLS="wget" 29 readonly REQUIRED_TOOLS="wget"
29 30
30 ###################################################################### 31 ######################################################################
31 # Package Config 32 # Package Config
32 ###################################################################### 33 ######################################################################
33 34
34 # This is where we get all the debian packages from. 35 # This is where we get all the debian packages from.
35 readonly DEBIAN_REPO=http://http.us.debian.org/debian 36 readonly DEBIAN_REPO=http://http.us.debian.org/debian
36 readonly REPO_BASEDIR="${DEBIAN_REPO}/dists/wheezy" 37 readonly REPO_BASEDIR="${DEBIAN_REPO}/dists/wheezy"
37 38
38 readonly RELEASE_FILE="Release" 39 readonly RELEASE_FILE="Release"
39 readonly RELEASE_FILE_GPG="Release.gpg" 40 readonly RELEASE_FILE_GPG="Release.gpg"
40 readonly RELEASE_LIST="${REPO_BASEDIR}/${RELEASE_FILE}" 41 readonly RELEASE_LIST="${REPO_BASEDIR}/${RELEASE_FILE}"
41 readonly RELEASE_LIST_GPG="${REPO_BASEDIR}/${RELEASE_FILE_GPG}" 42 readonly RELEASE_LIST_GPG="${REPO_BASEDIR}/${RELEASE_FILE_GPG}"
42 readonly PACKAGE_FILE_AMD64="main/binary-amd64/Packages.bz2" 43 readonly PACKAGE_FILE_AMD64="main/binary-amd64/Packages.bz2"
43 readonly PACKAGE_FILE_I386="main/binary-i386/Packages.bz2" 44 readonly PACKAGE_FILE_I386="main/binary-i386/Packages.bz2"
45 readonly PACKAGE_FILE_ARM="main/binary-armhf/Packages.bz2"
44 readonly PACKAGE_LIST_AMD64="${REPO_BASEDIR}/${PACKAGE_FILE_AMD64}" 46 readonly PACKAGE_LIST_AMD64="${REPO_BASEDIR}/${PACKAGE_FILE_AMD64}"
45 readonly PACKAGE_LIST_I386="${REPO_BASEDIR}/${PACKAGE_FILE_I386}" 47 readonly PACKAGE_LIST_I386="${REPO_BASEDIR}/${PACKAGE_FILE_I386}"
48 readonly PACKAGE_LIST_ARM="${REPO_BASEDIR}/${PACKAGE_FILE_ARM}"
46 49
47 # Sysroot packages: these are the packages needed to build chrome. 50 # Sysroot packages: these are the packages needed to build chrome.
48 # NOTE: When DEBIAN_PACKAGES is modified, the packagelist files must be updated 51 # NOTE: When DEBIAN_PACKAGES is modified, the packagelist files must be updated
49 # by running this script in GeneratePackageList mode. 52 # by running this script in GeneratePackageList mode.
50 readonly DEBIAN_PACKAGES="\ 53 readonly DEBIAN_PACKAGES="\
51 comerr-dev \ 54 comerr-dev \
52 gcc-4.6 \ 55 gcc-4.6 \
53 krb5-multidev \ 56 krb5-multidev \
54 libasound2 \ 57 libasound2 \
55 libasound2-dev \ 58 libasound2-dev \
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 libpcre3 \ 138 libpcre3 \
136 libpcre3-dev \ 139 libpcre3-dev \
137 libpcrecpp0 \ 140 libpcrecpp0 \
138 libpixman-1-0 \ 141 libpixman-1-0 \
139 libpixman-1-dev \ 142 libpixman-1-dev \
140 libpng12-0 \ 143 libpng12-0 \
141 libpng12-dev \ 144 libpng12-dev \
142 libpulse0 \ 145 libpulse0 \
143 libpulse-dev \ 146 libpulse-dev \
144 libpulse-mainloop-glib0 \ 147 libpulse-mainloop-glib0 \
145 libquadmath0 \
146 libselinux1 \ 148 libselinux1 \
147 libspeechd2 \ 149 libspeechd2 \
148 libspeechd-dev \ 150 libspeechd-dev \
149 libssl1.0.0 \ 151 libssl1.0.0 \
150 libssl-dev \ 152 libssl-dev \
151 libstdc++6 \ 153 libstdc++6 \
152 libstdc++6-4.6-dev \ 154 libstdc++6-4.6-dev \
153 libtasn1-3 \ 155 libtasn1-3 \
154 libudev0 \ 156 libudev0 \
155 libudev-dev \ 157 libudev-dev \
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 x11proto-input-dev \ 203 x11proto-input-dev \
202 x11proto-kb-dev \ 204 x11proto-kb-dev \
203 x11proto-randr-dev \ 205 x11proto-randr-dev \
204 x11proto-record-dev \ 206 x11proto-record-dev \
205 x11proto-render-dev \ 207 x11proto-render-dev \
206 x11proto-scrnsaver-dev \ 208 x11proto-scrnsaver-dev \
207 x11proto-xext-dev \ 209 x11proto-xext-dev \
208 zlib1g \ 210 zlib1g \
209 zlib1g-dev" 211 zlib1g-dev"
210 212
211 readonly DEBIAN_DEP_LIST_AMD64="${SCRIPT_DIR}/packagelist.debian.wheezy.amd64" 213 DEBIAN_PACKAGES_X86="libquadmath0"
212 readonly DEBIAN_DEP_LIST_I386="${SCRIPT_DIR}/packagelist.debian.wheezy.i386" 214
215 readonly DEBIAN_DEP_LIST_AMD64="packagelist.debian.wheezy.amd64"
216 readonly DEBIAN_DEP_LIST_I386="packagelist.debian.wheezy.i386"
217 readonly DEBIAN_DEP_LIST_ARM="packagelist.debian.wheezy.arm"
213 218
214 ###################################################################### 219 ######################################################################
215 # Helper 220 # Helper
216 ###################################################################### 221 ######################################################################
217 222
218 Banner() { 223 Banner() {
219 echo "######################################################################" 224 echo "######################################################################"
220 echo $* 225 echo $*
221 echo "######################################################################" 226 echo "######################################################################"
222 } 227 }
(...skipping 28 matching lines...) Expand all
251 fi 256 fi
252 } 257 }
253 258
254 259
255 SetEnvironmentVariables() { 260 SetEnvironmentVariables() {
256 ARCH="" 261 ARCH=""
257 echo $1 | grep -qs Amd64$ && ARCH=AMD64 262 echo $1 | grep -qs Amd64$ && ARCH=AMD64
258 if [ -z "$ARCH" ]; then 263 if [ -z "$ARCH" ]; then
259 echo $1 | grep -qs I386$ && ARCH=I386 264 echo $1 | grep -qs I386$ && ARCH=I386
260 fi 265 fi
266 if [ -z "$ARCH" ]; then
267 echo $1 | grep -qs ARM$ && ARCH=ARM
268 fi
261 case "$ARCH" in 269 case "$ARCH" in
270 ARM)
271 INSTALL_ROOT="$INSTALL_ROOT_ARM";
272 ;;
262 AMD64) 273 AMD64)
263 INSTALL_ROOT="$INSTALL_ROOT_AMD64"; 274 INSTALL_ROOT="$INSTALL_ROOT_AMD64";
264 ;; 275 ;;
265 I386) 276 I386)
266 INSTALL_ROOT="$INSTALL_ROOT_I386"; 277 INSTALL_ROOT="$INSTALL_ROOT_I386";
267 ;; 278 ;;
268 *) 279 *)
269 echo "ERROR: Unexpected bad architecture." 280 echo "ERROR: Unexpected bad architecture."
270 exit 1 281 exit 1
271 ;; 282 ;;
272 esac 283 esac
273 } 284 }
274 285
275 Cleanup() { 286 Cleanup() {
287 echo "Cleaning: $TMP"
276 rm -rf "$TMP" 288 rm -rf "$TMP"
277 } 289 }
278 290
279 # some sanity checks to make sure this script is run from the right place 291 # some sanity checks to make sure this script is run from the right place
280 # with the right tools 292 # with the right tools
281 SanityCheck() { 293 SanityCheck() {
282 Banner "Sanity Checks" 294 Banner "Sanity Checks"
283 295
284 if [ "$(basename $(pwd))" != "sysroot_scripts" ] ; then 296 if [ "$(basename $(pwd))" != "sysroot_scripts" ] ; then
285 echo -n "ERROR: run this script from " 297 echo -n "ERROR: run this script from "
286 echo "src/chrome/installer/linux/sysroot_scripts" 298 echo "src/chrome/installer/linux/sysroot_scripts"
287 exit 1 299 exit 1
288 fi 300 fi
289 301
290 if ! mkdir -p "${INSTALL_ROOT}" ; then 302 if ! mkdir -p "${INSTALL_ROOT}" ; then
291 echo "ERROR: ${INSTALL_ROOT} can't be created." 303 echo "ERROR: ${INSTALL_ROOT} can't be created."
292 exit 1 304 exit 1
293 fi 305 fi
294 306
295 TMP=$(mktemp -q -t -d debian-wheezy-XXXXXX) 307 TMP=/tmp/$USER/debian-wheezy-sysroot
Lei Zhang 2014/05/12 21:45:37 Is this intention or for local testing?
Sam Clegg 2014/05/12 22:25:32 I can revert this for now, but I really wanted a d
Lei Zhang 2014/05/12 22:34:17 It does mean a lot less downloads. I've done it fo
308 mkdir -p $TMP
296 if [ -z "$TMP" ]; then 309 if [ -z "$TMP" ]; then
297 echo "ERROR: temp dir can't be created." 310 echo "ERROR: temp dir can't be created."
298 exit 1 311 exit 1
299 fi 312 fi
300 trap Cleanup 0 313 trap Cleanup 0
301 314
302 for tool in ${REQUIRED_TOOLS} ; do 315 for tool in ${REQUIRED_TOOLS} ; do
303 if ! which ${tool} ; then 316 if ! which ${tool} ; then
304 echo "Required binary $tool not found." 317 echo "Required binary $tool not found."
305 echo "Exiting." 318 echo "Exiting."
306 exit 1 319 exit 1
307 fi 320 fi
308 done 321 done
309 } 322 }
310 323
311 324
312 ChangeDirectory() { 325 ChangeDirectory() {
313 # Change directory to where this script is. 326 # Change directory to where this script is.
314 cd $(dirname "$0") 327 cd ${SCRIPT_DIR}
315 } 328 }
316 329
317 330
318 ClearInstallDir() { 331 ClearInstallDir() {
319 Banner "Clearing dirs in ${INSTALL_ROOT}" 332 Banner "Clearing dirs in ${INSTALL_ROOT}"
320 rm -rf ${INSTALL_ROOT}/* 333 rm -rf ${INSTALL_ROOT}/*
321 } 334 }
322 335
323 336
324 CreateTarBall() { 337 CreateTarBall() {
(...skipping 14 matching lines...) Expand all
339 fi 352 fi
340 } 353 }
341 354
342 ExtractPackageBz2() { 355 ExtractPackageBz2() {
343 bzcat "$1" | egrep '^(Package:|Filename:|SHA256:) ' > "$2" 356 bzcat "$1" | egrep '^(Package:|Filename:|SHA256:) ' > "$2"
344 } 357 }
345 358
346 GeneratePackageListAmd64() { 359 GeneratePackageListAmd64() {
347 local output_file="$1" 360 local output_file="$1"
348 local package_list="${TMP}/Packages.wheezy_amd64.bz2" 361 local package_list="${TMP}/Packages.wheezy_amd64.bz2"
362 local tmp_package_list="${TMP}/Packages.wheezy_amd64"
349 DownloadOrCopy ${PACKAGE_LIST_AMD64} ${package_list} 363 DownloadOrCopy ${PACKAGE_LIST_AMD64} ${package_list}
350 VerifyPackageListing ${PACKAGE_FILE_AMD64} ${package_list} 364 VerifyPackageListing ${PACKAGE_FILE_AMD64} ${package_list}
351 ExtractPackageBz2 "$package_list" "${TMP}/Packages" 365 ExtractPackageBz2 $package_list $tmp_package_list
Lei Zhang 2014/05/12 21:45:37 Generally quoting is preferred: https://google-sty
Sam Clegg 2014/05/12 22:25:32 Done.
352 366
353 GeneratePackageList "$output_file" "${DEBIAN_PACKAGES}" 367 GeneratePackageList $tmp_package_list $output_file "${DEBIAN_PACKAGES}
368 ${DEBIAN_PACKAGES_X86}"
354 } 369 }
355 370
356 GeneratePackageListI386() { 371 GeneratePackageListI386() {
357 local output_file="$1" 372 local output_file="$1"
358 local package_list="${TMP}/Packages.wheezy_i386.bz2" 373 local package_list="${TMP}/Packages.wheezy_i386.bz2"
374 local tmp_package_list="${TMP}/Packages.wheezy_amd64"
359 DownloadOrCopy ${PACKAGE_LIST_I386} ${package_list} 375 DownloadOrCopy ${PACKAGE_LIST_I386} ${package_list}
360 VerifyPackageListing ${PACKAGE_FILE_I386} ${package_list} 376 VerifyPackageListing ${PACKAGE_FILE_I386} ${package_list}
361 ExtractPackageBz2 "$package_list" "${TMP}/Packages" 377 ExtractPackageBz2 $package_list $tmp_package_list
362 378
363 GeneratePackageList "$output_file" "${DEBIAN_PACKAGES}" 379 GeneratePackageList $tmp_package_list $output_file "${DEBIAN_PACKAGES}
380 ${DEBIAN_PACKAGES_X86}"
381 }
382
383 GeneratePackageListARM() {
384 local output_file="$1"
385 local package_list="${TMP}/Packages.wheezy_arm.bz2"
386 local tmp_package_list="${TMP}/Packages.wheezy_arm"
387 DownloadOrCopy ${PACKAGE_LIST_ARM} ${package_list}
388 VerifyPackageListing ${PACKAGE_FILE_ARM} ${package_list}
389 ExtractPackageBz2 $package_list $tmp_package_list
390
391 GeneratePackageList $tmp_package_list $output_file "${DEBIAN_PACKAGES}"
364 } 392 }
365 393
366 StripChecksumsFromPackageList() { 394 StripChecksumsFromPackageList() {
367 local package_file="$1" 395 local package_file="$1"
368 sed -i 's/ [a-f0-9]\{64\}$//' "$package_file" 396 sed -i 's/ [a-f0-9]\{64\}$//' "$package_file"
369 } 397 }
370 398
371 VerifyPackageFilesMatch() { 399 VerifyPackageFilesMatch() {
372 local downloaded_package_file="$1" 400 local downloaded_package_file="$1"
373 local stored_package_file="$2" 401 local stored_package_file="$2"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 mkdir -p ${INSTALL_ROOT}/usr/share 452 mkdir -p ${INSTALL_ROOT}/usr/share
425 ln -s ../lib/i386-linux-gnu/pkgconfig ${INSTALL_ROOT}/usr/share/pkgconfig 453 ln -s ../lib/i386-linux-gnu/pkgconfig ${INSTALL_ROOT}/usr/share/pkgconfig
426 454
427 SubBanner "Adding an additional ld.conf include" 455 SubBanner "Adding an additional ld.conf include"
428 LD_SO_HACK_CONF="${INSTALL_ROOT}/etc/ld.so.conf.d/zz_hack.conf" 456 LD_SO_HACK_CONF="${INSTALL_ROOT}/etc/ld.so.conf.d/zz_hack.conf"
429 echo /usr/lib/gcc/i486-linux-gnu/4.6 > "$LD_SO_HACK_CONF" 457 echo /usr/lib/gcc/i486-linux-gnu/4.6 > "$LD_SO_HACK_CONF"
430 echo /usr/lib >> "$LD_SO_HACK_CONF" 458 echo /usr/lib >> "$LD_SO_HACK_CONF"
431 } 459 }
432 460
433 461
462 HacksAndPatchesARM() {
463 Banner "Misc Hacks & Patches"
464 # these are linker scripts with absolute pathnames in them
465 # which we rewrite here
466 lscripts="${INSTALL_ROOT}/usr/lib/arm-linux-gnueabihf/libpthread.so \
467 ${INSTALL_ROOT}/usr/lib/arm-linux-gnueabihf/libc.so"
468
469 #SubBanner "Rewriting Linker Scripts"
470 sed -i -e 's|/usr/lib/arm-linux-gnueabihf/||g' ${lscripts}
471 sed -i -e 's|/lib/arm-linux-gnueabihf/||g' ${lscripts}
472
473 # This is for chrome's ./build/linux/pkg-config-wrapper
474 # which overwrites PKG_CONFIG_PATH internally
475 SubBanner "Package Configs Symlink"
476 mkdir -p ${INSTALL_ROOT}/usr/share
477 ln -s ../lib/arm-linux-gnueabihf/pkgconfig ${INSTALL_ROOT}/usr/share/pkgconfig
478 }
479
480
434 InstallIntoSysroot() { 481 InstallIntoSysroot() {
435 Banner "Install Libs And Headers Into Jail" 482 Banner "Install Libs And Headers Into Jail"
436 483
437 mkdir -p ${TMP}/debian-packages 484 mkdir -p ${TMP}/debian-packages
438 mkdir -p ${INSTALL_ROOT} 485 mkdir -p ${INSTALL_ROOT}
439 while (( "$#" )); do 486 while (( "$#" )); do
440 local file="$1" 487 local file="$1"
441 local package="${TMP}/debian-packages/${file##*/}" 488 local package="${TMP}/debian-packages/${file##*/}"
442 shift 489 shift
443 local sha256sum="$1" 490 local sha256sum="$1"
(...skipping 22 matching lines...) Expand all
466 CleanupJailSymlinks() { 513 CleanupJailSymlinks() {
467 Banner "Jail symlink cleanup" 514 Banner "Jail symlink cleanup"
468 515
469 SAVEDPWD=$(pwd) 516 SAVEDPWD=$(pwd)
470 cd ${INSTALL_ROOT} 517 cd ${INSTALL_ROOT}
471 find lib lib64 usr/lib -type l -printf '%p %l\n' | while read link target; do 518 find lib lib64 usr/lib -type l -printf '%p %l\n' | while read link target; do
472 # skip links with non-absolute paths 519 # skip links with non-absolute paths
473 echo "${target}" | grep -qs ^/ || continue 520 echo "${target}" | grep -qs ^/ || continue
474 echo "${link}: ${target}" 521 echo "${link}: ${target}"
475 case "${link}" in 522 case "${link}" in
476 usr/lib/gcc/x86_64-linux-gnu/4.*/* | usr/lib/gcc/i486-linux-gnu/4.*/*) 523 usr/lib/gcc/x86_64-linux-gnu/4.*/* | usr/lib/gcc/i486-linux-gnu/4.*/* | \
524 usr/lib/gcc/arm-linux-gnueabihf/4.*/*)
477 # Relativize the symlink. 525 # Relativize the symlink.
478 ln -snfv "../../../../..${target}" "${link}" 526 ln -snfv "../../../../..${target}" "${link}"
479 ;; 527 ;;
480 usr/lib/x86_64-linux-gnu/* | usr/lib/i386-linux-gnu/*) 528 usr/lib/x86_64-linux-gnu/* | usr/lib/i386-linux-gnu/* | \
529 usr/lib/arm-linux-gnueabihf/*)
481 # Relativize the symlink. 530 # Relativize the symlink.
482 ln -snfv "../../..${target}" "${link}" 531 ln -snfv "../../..${target}" "${link}"
483 ;; 532 ;;
484 usr/lib/*) 533 usr/lib/*)
485 # Relativize the symlink. 534 # Relativize the symlink.
486 ln -snfv "../..${target}" "${link}" 535 ln -snfv "../..${target}" "${link}"
487 ;; 536 ;;
488 lib64/* | lib/*) 537 lib64/* | lib/*)
489 # Relativize the symlink. 538 # Relativize the symlink.
490 ln -snfv "..${target}" "${link}" 539 ln -snfv "..${target}" "${link}"
(...skipping 30 matching lines...) Expand all
521 CreateTarBall "$1" 570 CreateTarBall "$1"
522 } 571 }
523 572
524 #@ 573 #@
525 #@ BuildSysrootI386 <tarball-name> 574 #@ BuildSysrootI386 <tarball-name>
526 #@ 575 #@
527 #@ Build everything and package it 576 #@ Build everything and package it
528 BuildSysrootI386() { 577 BuildSysrootI386() {
529 CheckBuildSysrootArgs $@ 578 CheckBuildSysrootArgs $@
530 ClearInstallDir 579 ClearInstallDir
531 local package_file="$TMP/package_with_sha256sum_amd64" 580 local package_file="$TMP/package_with_sha256sum_i386"
532 GeneratePackageListI386 "$package_file" 581 GeneratePackageListI386 "$package_file"
533 local files_and_sha256sums="$(cat ${package_file})" 582 local files_and_sha256sums="$(cat ${package_file})"
534 StripChecksumsFromPackageList "$package_file" 583 StripChecksumsFromPackageList "$package_file"
535 VerifyPackageFilesMatch "$package_file" "$DEBIAN_DEP_LIST_I386" 584 VerifyPackageFilesMatch "$package_file" "$DEBIAN_DEP_LIST_I386"
536 InstallIntoSysroot ${files_and_sha256sums} 585 InstallIntoSysroot ${files_and_sha256sums}
537 CleanupJailSymlinks 586 CleanupJailSymlinks
538 HacksAndPatchesI386 587 HacksAndPatchesI386
539 CreateTarBall "$1" 588 CreateTarBall "$1"
540 } 589 }
541 590
591 #@
592 #@ BuildSysrootARM <tarball-name>
593 #@
594 #@ Build everything and package it
595 BuildSysrootARM() {
596 CheckBuildSysrootArgs $@
597 ClearInstallDir
598 local package_file="$TMP/package_with_sha256sum_arm"
599 GeneratePackageListARM "$package_file"
600 local files_and_sha256sums="$(cat ${package_file})"
601 StripChecksumsFromPackageList "$package_file"
602 VerifyPackageFilesMatch "$package_file" "$DEBIAN_DEP_LIST_ARM"
603 InstallIntoSysroot ${files_and_sha256sums}
604 CleanupJailSymlinks
605 HacksAndPatchesARM
606 CreateTarBall "$1"
607 }
608
542 # 609 #
543 # CheckForDebianGPGKeys 610 # CheckForDebianGPGKeyring
544 # 611 #
545 # Make sure the Debian GPG keys exist. Otherwise print a helpful message. 612 # Make sure the Debian GPG keys exist. Otherwise print a helpful message.
546 # 613 #
547 CheckForDebianGPGKeys() { 614 CheckForDebianGPGKeyring() {
548 if [ ! -e "/etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg" ] || 615 if [ ! -e "/usr/share/keyrings/debian-archive-keyring.gpg" ]; then
549 [ ! -e "/etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg" ]; then
550 echo "Debian GPG keys missing. Install the debian-archive-keyring package." 616 echo "Debian GPG keys missing. Install the debian-archive-keyring package."
551 exit 1 617 exit 1
552 fi 618 fi
553 } 619 }
554 620
555 # 621 #
556 # VerifyPackageListing 622 # VerifyPackageListing
557 # 623 #
558 # Verifies the downloaded Packages.bz2 file has the right checksums. 624 # Verifies the downloaded Packages.bz2 file has the right checksums.
559 # 625 #
560 VerifyPackageListing() { 626 VerifyPackageListing() {
561 local file_path=$1 627 local file_path=$1
562 local output_file=$2 628 local output_file=$2
563 local release_file="${TMP}/${RELEASE_FILE}" 629 local release_file="${TMP}/${RELEASE_FILE}"
564 local release_file_gpg="${TMP}/${RELEASE_FILE_GPG}" 630 local release_file_gpg="${TMP}/${RELEASE_FILE_GPG}"
565 631
566 CheckForDebianGPGKeys 632 CheckForDebianGPGKeyring
567 633
568 DownloadOrCopy ${RELEASE_LIST} ${release_file} 634 DownloadOrCopy ${RELEASE_LIST} ${release_file}
569 DownloadOrCopy ${RELEASE_LIST_GPG} ${release_file_gpg} 635 DownloadOrCopy ${RELEASE_LIST_GPG} ${release_file_gpg}
570 echo "Verifying: ${release_file} with ${release_file_gpg}" 636 echo "Verifying: ${release_file} with ${release_file_gpg}"
571 gpgv --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg \ 637 gpgv --keyring /usr/share/keyrings/debian-archive-keyring.gpg \
572 --keyring /etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg \
573 ${release_file_gpg} ${release_file} 638 ${release_file_gpg} ${release_file}
574 639
575 echo "Verifying: ${output_file}" 640 echo "Verifying: ${output_file}"
576 local checksums=$(grep ${file_path} ${release_file} | cut -d " " -f 2) 641 local checksums=$(grep ${file_path} ${release_file} | cut -d " " -f 2)
577 local sha256sum=$(echo ${checksums} | cut -d " " -f 3) 642 local sha256sum=$(echo ${checksums} | cut -d " " -f 3)
578 643
579 if [ "${#sha256sum}" -ne "64" ]; then 644 if [ "${#sha256sum}" -ne "64" ]; then
580 echo "Bad sha256sum from ${RELEASE_LIST}" 645 echo "Bad sha256sum from ${RELEASE_LIST}"
581 exit 1 646 exit 1
582 fi 647 fi
583 648
584 echo "${sha256sum} ${output_file}" | sha256sum --quiet -c 649 echo "${sha256sum} ${output_file}" | sha256sum --quiet -c
585 } 650 }
586 651
587 # 652 #
588 # GeneratePackageList 653 # GeneratePackageList
589 # 654 #
590 # Looks up package names in ${TMP}/Packages and write list of URLs 655 # Looks up package names in ${TMP}/Packages and write list of URLs
591 # to output file. 656 # to output file.
592 # 657 #
593 GeneratePackageList() { 658 GeneratePackageList() {
594 local output_file="$1" 659 local input_file="$1"
595 echo "Updating: ${output_file}" 660 local output_file="$2"
661 echo "Updating: ${output_file} from ${input_file}"
596 /bin/rm -f "${output_file}" 662 /bin/rm -f "${output_file}"
597 shift 663 shift
664 shift
598 for pkg in $@ ; do 665 for pkg in $@ ; do
599 local pkg_full=$(grep -A 1 " ${pkg}\$" "${TMP}/Packages" | \ 666 local pkg_full=$(grep -A 1 " ${pkg}\$" "$input_file" | \
600 egrep -o "pool/.*") 667 egrep -o "pool/.*")
601 if [ -z "${pkg_full}" ]; then 668 if [ -z "${pkg_full}" ]; then
602 echo "ERROR: missing package: $pkg" 669 echo "ERROR: missing package: $pkg"
603 exit 1 670 exit 1
604 fi 671 fi
605 local pkg_nopool=$(echo "$pkg_full" | sed "s/^pool\///") 672 local pkg_nopool=$(echo "$pkg_full" | sed "s/^pool\///")
606 local sha256sum=$(grep -A 4 " ${pkg}\$" "${TMP}/Packages" | \ 673 local sha256sum=$(grep -A 4 " ${pkg}\$" "$input_file" | \
607 grep ^SHA256: | sed 's/^SHA256: //') 674 grep ^SHA256: | sed 's/^SHA256: //')
608 if [ "${#sha256sum}" -ne "64" ]; then 675 if [ "${#sha256sum}" -ne "64" ]; then
609 echo "Bad sha256sum from Packages" 676 echo "Bad sha256sum from Packages"
610 exit 1 677 exit 1
611 fi 678 fi
612 echo $pkg_nopool $sha256sum >> "$output_file" 679 echo $pkg_nopool $sha256sum >> "$output_file"
613 done 680 done
614 # sort -o does an in-place sort of this file 681 # sort -o does an in-place sort of this file
615 sort "$output_file" -o "$output_file" 682 sort "$output_file" -o "$output_file"
616 } 683 }
(...skipping 11 matching lines...) Expand all
628 #@ 695 #@
629 #@ UpdatePackageListsI386 696 #@ UpdatePackageListsI386
630 #@ 697 #@
631 #@ Regenerate the package lists such that they contain an up-to-date 698 #@ Regenerate the package lists such that they contain an up-to-date
632 #@ list of URLs within the Debian archive. (For i386) 699 #@ list of URLs within the Debian archive. (For i386)
633 UpdatePackageListsI386() { 700 UpdatePackageListsI386() {
634 GeneratePackageListI386 "$DEBIAN_DEP_LIST_I386" 701 GeneratePackageListI386 "$DEBIAN_DEP_LIST_I386"
635 StripChecksumsFromPackageList "$DEBIAN_DEP_LIST_I386" 702 StripChecksumsFromPackageList "$DEBIAN_DEP_LIST_I386"
636 } 703 }
637 704
705 #@
706 #@ UpdatePackageListsARM
707 #@
708 #@ Regenerate the package lists such that they contain an up-to-date
709 #@ list of URLs within the Debian archive. (For arm)
710 UpdatePackageListsARM() {
711 GeneratePackageListARM "$DEBIAN_DEP_LIST_ARM"
712 StripChecksumsFromPackageList "$DEBIAN_DEP_LIST_ARM"
713 }
714
638 if [ $# -eq 0 ] ; then 715 if [ $# -eq 0 ] ; then
639 echo "ERROR: you must specify a mode on the commandline" 716 echo "ERROR: you must specify a mode on the commandline"
640 echo 717 echo
641 Usage 718 Usage
642 exit 1 719 exit 1
643 elif [ "$(type -t $1)" != "function" ]; then 720 elif [ "$(type -t $1)" != "function" ]; then
644 echo "ERROR: unknown function '$1'." >&2 721 echo "ERROR: unknown function '$1'." >&2
645 echo "For help, try:" 722 echo "For help, try:"
646 echo " $0 help" 723 echo " $0 help"
647 exit 1 724 exit 1
648 else 725 else
649 ChangeDirectory 726 ChangeDirectory
650 SetEnvironmentVariables "$1" 727 SetEnvironmentVariables "$1"
651 SanityCheck 728 SanityCheck
652 "$@" 729 "$@"
653 fi 730 fi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698