diff options
| -rw-r--r-- | meta/lib/oe/package_manager.py | 103 |
1 files changed, 51 insertions, 52 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 811ad09e68..139a6211ee 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
| @@ -7,58 +7,6 @@ import multiprocessing | |||
| 7 | import re | 7 | import re |
| 8 | import bb | 8 | import bb |
| 9 | 9 | ||
| 10 | DB_CONFIG_CONTENT = '''# ================ Environment | ||
| 11 | set_data_dir . | ||
| 12 | set_create_dir . | ||
| 13 | set_lg_dir ./log | ||
| 14 | set_tmp_dir ./tmp | ||
| 15 | set_flags db_log_autoremove on | ||
| 16 | |||
| 17 | # -- thread_count must be >= 8 | ||
| 18 | set_thread_count 64 | ||
| 19 | |||
| 20 | # ================ Logging | ||
| 21 | |||
| 22 | # ================ Memory Pool | ||
| 23 | set_cachesize 0 1048576 0 | ||
| 24 | set_mp_mmapsize 268435456 | ||
| 25 | |||
| 26 | # ================ Locking | ||
| 27 | set_lk_max_locks 16384 | ||
| 28 | set_lk_max_lockers 16384 | ||
| 29 | set_lk_max_objects 16384 | ||
| 30 | mutex_set_max 163840 | ||
| 31 | |||
| 32 | # ================ Replication | ||
| 33 | ''' | ||
| 34 | |||
| 35 | SCRIPTLET_FORMAT = '''#!/bin/bash | ||
| 36 | |||
| 37 | export PATH=%s | ||
| 38 | export D=%s | ||
| 39 | export OFFLINE_ROOT="$D" | ||
| 40 | export IPKG_OFFLINE_ROOT="$D" | ||
| 41 | export OPKG_OFFLINE_ROOT="$D" | ||
| 42 | export INTERCEPT_DIR=%s | ||
| 43 | export NATIVE_ROOT=%s | ||
| 44 | |||
| 45 | $2 $1/$3 $4 | ||
| 46 | if [ $? -ne 0 ]; then | ||
| 47 | if [ $4 -eq 1 ]; then | ||
| 48 | mkdir -p $1/etc/rpm-postinsts | ||
| 49 | num=100 | ||
| 50 | while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done | ||
| 51 | name=`head -1 $1/$3 | cut -d\' \' -f 2` | ||
| 52 | echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name} | ||
| 53 | echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name} | ||
| 54 | cat $1/$3 >> $1/etc/rpm-postinsts/${num}-${name} | ||
| 55 | chmod +x $1/etc/rpm-postinsts/${num}-${name} | ||
| 56 | else | ||
| 57 | echo "Error: pre/post remove scriptlet failed" | ||
| 58 | fi | ||
| 59 | fi | ||
| 60 | ''' | ||
| 61 | |||
| 62 | 10 | ||
| 63 | # this can be used by all PM backends to create the index files in parallel | 11 | # this can be used by all PM backends to create the index files in parallel |
| 64 | def create_index(arg): | 12 | def create_index(arg): |
| @@ -405,6 +353,31 @@ class RpmPM(PackageManager): | |||
| 405 | if not os.path.exists(rpmlib_log): | 353 | if not os.path.exists(rpmlib_log): |
| 406 | bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log')) | 354 | bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log')) |
| 407 | open(rpmlib_log, 'w+').close() | 355 | open(rpmlib_log, 'w+').close() |
| 356 | |||
| 357 | DB_CONFIG_CONTENT = "# ================ Environment\n" \ | ||
| 358 | "set_data_dir .\n" \ | ||
| 359 | "set_create_dir .\n" \ | ||
| 360 | "set_lg_dir ./log\n" \ | ||
| 361 | "set_tmp_dir ./tmp\n" \ | ||
| 362 | "set_flags db_log_autoremove on\n" \ | ||
| 363 | "\n" \ | ||
| 364 | "# -- thread_count must be >= 8\n" \ | ||
| 365 | "set_thread_count 64\n" \ | ||
| 366 | "\n" \ | ||
| 367 | "# ================ Logging\n" \ | ||
| 368 | "\n" \ | ||
| 369 | "# ================ Memory Pool\n" \ | ||
| 370 | "set_cachesize 0 1048576 0\n" \ | ||
| 371 | "set_mp_mmapsize 268435456\n" \ | ||
| 372 | "\n" \ | ||
| 373 | "# ================ Locking\n" \ | ||
| 374 | "set_lk_max_locks 16384\n" \ | ||
| 375 | "set_lk_max_lockers 16384\n" \ | ||
| 376 | "set_lk_max_objects 16384\n" \ | ||
| 377 | "mutex_set_max 163840\n" \ | ||
| 378 | "\n" \ | ||
| 379 | "# ================ Replication\n" | ||
| 380 | |||
| 408 | db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG') | 381 | db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG') |
| 409 | if not os.path.exists(db_config_dir): | 382 | if not os.path.exists(db_config_dir): |
| 410 | open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT) | 383 | open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT) |
| @@ -469,6 +442,32 @@ class RpmPM(PackageManager): | |||
| 469 | # If we ever run into needing more the 899 scripts, we'll have to. | 442 | # If we ever run into needing more the 899 scripts, we'll have to. |
| 470 | # change num to start with 1000. | 443 | # change num to start with 1000. |
| 471 | # | 444 | # |
| 445 | SCRIPTLET_FORMAT = "#!/bin/bash\n" \ | ||
| 446 | "\n" \ | ||
| 447 | "export PATH=%s\n" \ | ||
| 448 | "export D=%s\n" \ | ||
| 449 | 'export OFFLINE_ROOT="$D"\n' \ | ||
| 450 | 'export IPKG_OFFLINE_ROOT="$D"\n' \ | ||
| 451 | 'export OPKG_OFFLINE_ROOT="$D"\n' \ | ||
| 452 | "export INTERCEPT_DIR=%s\n" \ | ||
| 453 | "export NATIVE_ROOT=%s\n" \ | ||
| 454 | "\n" \ | ||
| 455 | "$2 $1/$3 $4\n" \ | ||
| 456 | "if [ $? -ne 0 ]; then\n" \ | ||
| 457 | " if [ $4 -eq 1 ]; then\n" \ | ||
| 458 | " mkdir -p $1/etc/rpm-postinsts\n" \ | ||
| 459 | " num=100\n" \ | ||
| 460 | " while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done\n" \ | ||
| 461 | " name=`head -1 $1/$3 | cut -d\' \' -f 2`\n" \ | ||
| 462 | ' echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name}\n' \ | ||
| 463 | ' echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name}\n' \ | ||
| 464 | " cat $1/$3 >> $1/etc/rpm-postinsts/${num}-${name}\n" \ | ||
| 465 | " chmod +x $1/etc/rpm-postinsts/${num}-${name}\n" \ | ||
| 466 | " else\n" \ | ||
| 467 | ' echo "Error: pre/post remove scriptlet failed"\n' \ | ||
| 468 | " fi\n" \ | ||
| 469 | "fi\n" | ||
| 470 | |||
| 472 | intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts') | 471 | intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts') |
| 473 | native_root = self.d.getVar('STAGING_DIR_NATIVE', True) | 472 | native_root = self.d.getVar('STAGING_DIR_NATIVE', True) |
| 474 | scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'], | 473 | scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'], |
