refactor(build_image_util): Move prod specific code to prod_image_util

This commit is contained in:
Michael Marineau 2014-03-27 19:56:53 -07:00
parent 56b550dc21
commit 17bde8aa12
2 changed files with 22 additions and 22 deletions

View File

@ -104,28 +104,6 @@ emerge_to_image() {
sudo -E ROOT="${root_fs_dir}" env-update sudo -E ROOT="${root_fs_dir}" env-update
} }
# The GCC package includes both its libraries and the compiler.
# In prod images we only need the shared libraries.
emerge_prod_gcc() {
local root_fs_dir="$1"; shift
local mask="${INSTALL_MASK:-$(portageq-$BOARD envvar PROD_INSTALL_MASK)}"
test -n "$mask" || die "PROD_INSTALL_MASK not defined"
mask="${mask}
/usr/bin
/usr/*/gcc-bin
/usr/lib/gcc/*/*/*.o
/usr/lib/gcc/*/*/include
/usr/lib/gcc/*/*/include-fixed
/usr/lib/gcc/*/*/plugin
/usr/libexec
/usr/share/gcc-data/*/*/c89
/usr/share/gcc-data/*/*/c99
/usr/share/gcc-data/*/*/python"
INSTALL_MASK="${mask}" emerge_to_image "${root_fs_dir}" --nodeps sys-devel/gcc "$@"
}
start_image() { start_image() {
local image_name="$1" local image_name="$1"
local disk_layout="$2" local disk_layout="$2"

View File

@ -3,6 +3,28 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# The GCC package includes both its libraries and the compiler.
# In prod images we only need the shared libraries.
emerge_prod_gcc() {
local root_fs_dir="$1"; shift
local mask="${INSTALL_MASK:-$(portageq-$BOARD envvar PROD_INSTALL_MASK)}"
test -n "$mask" || die "PROD_INSTALL_MASK not defined"
mask="${mask}
/usr/bin
/usr/*/gcc-bin
/usr/lib/gcc/*/*/*.o
/usr/lib/gcc/*/*/include
/usr/lib/gcc/*/*/include-fixed
/usr/lib/gcc/*/*/plugin
/usr/libexec
/usr/share/gcc-data/*/*/c89
/usr/share/gcc-data/*/*/c99
/usr/share/gcc-data/*/*/python"
INSTALL_MASK="${mask}" emerge_to_image "${root_fs_dir}" --nodeps sys-devel/gcc "$@"
}
create_prod_image() { create_prod_image() {
local image_name="$1" local image_name="$1"
local disk_layout="$2" local disk_layout="$2"