Commit c8ec82ec authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Commit Bot

Fix rpm and deb installer for MIPS and ARM

Add support to generate rpm for MIPS and ARM.
To prevent confusion, we also removed build_script_arch
and use the deb/rpm arch directly as the build script argument.

Change-Id: Ifb44e4831e67a256e13bd02a1bfae09279448484
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053783Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Jiaxun Yang <jiaxun.yang@flygoat.com>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744913}
parent 5ffbc9a1
...@@ -358,13 +358,6 @@ template("linux_package") { ...@@ -358,13 +358,6 @@ template("linux_package") {
assert(defined(invoker.channel)) assert(defined(invoker.channel))
channel = invoker.channel channel = invoker.channel
if (current_cpu == "x86") {
# The shell scripts use "ia32" instead of "x86".
build_script_arch = "ia32"
} else {
build_script_arch = current_cpu
}
deb_target_name = "${target_name}_deb" deb_target_name = "${target_name}_deb"
action(deb_target_name) { action(deb_target_name) {
visibility = [ ":*" ] visibility = [ ":*" ]
...@@ -375,7 +368,7 @@ template("linux_package") { ...@@ -375,7 +368,7 @@ template("linux_package") {
} else if (current_cpu == "x64") { } else if (current_cpu == "x64") {
deb_arch = "amd64" deb_arch = "amd64"
} else if (current_cpu == "arm") { } else if (current_cpu == "arm") {
deb_arch = "arm" deb_arch = "armhf"
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
deb_arch = "arm64" deb_arch = "arm64"
} else if (current_cpu == "mipsel") { } else if (current_cpu == "mipsel") {
...@@ -397,7 +390,7 @@ template("linux_package") { ...@@ -397,7 +390,7 @@ template("linux_package") {
args = [ args = [
rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir), rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir),
"-a", "-a",
build_script_arch, deb_arch,
"-b", "-b",
rebase_path(root_out_dir, root_build_dir), rebase_path(root_out_dir, root_build_dir),
"-c", "-c",
...@@ -431,9 +424,9 @@ template("linux_package") { ...@@ -431,9 +424,9 @@ template("linux_package") {
} else if (current_cpu == "x64") { } else if (current_cpu == "x64") {
rpm_arch = "x86_64" rpm_arch = "x86_64"
} else if (current_cpu == "arm") { } else if (current_cpu == "arm") {
rpm_arch = "arm" rpm_arch = "armhf"
} else if (current_cpu == "arm64") { } else if (current_cpu == "arm64") {
rpm_arch = "arm64" rpm_arch = "aarch64"
} else if (current_cpu == "mipsel") { } else if (current_cpu == "mipsel") {
rpm_arch = "mipsel" rpm_arch = "mipsel"
} else if (current_cpu == "mips64el") { } else if (current_cpu == "mips64el") {
...@@ -453,7 +446,7 @@ template("linux_package") { ...@@ -453,7 +446,7 @@ template("linux_package") {
args = [ args = [
rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir), rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir),
"-a", "-a",
build_script_arch, rpm_arch,
"-b", "-b",
rebase_path(root_out_dir, root_build_dir), rebase_path(root_out_dir, root_build_dir),
"-c", "-c",
......
...@@ -305,6 +305,14 @@ get_lib_dir() { ...@@ -305,6 +305,14 @@ get_lib_dir() {
LIBDIR=lib/i386-linux-gnu LIBDIR=lib/i386-linux-gnu
elif [ "$DEFAULT_ARCH" = "amd64" ]; then elif [ "$DEFAULT_ARCH" = "amd64" ]; then
LIBDIR=lib/x86_64-linux-gnu LIBDIR=lib/x86_64-linux-gnu
elif [ "$DEFAULT_ARCH" = "armhf" ]; then
LIBDIR=lib/arm-linux-gnueabihf
elif [ "$DEFAULT_ARCH" = "arm64" ]; then
LIBDIR=lib/aarch64-linux-gnu
elif [ "$DEFAULT_ARCH" = "mipsel" ]; then
LIBDIR=lib/mipsel-linux-gnu
elif [ "$DEFAULT_ARCH" = "mips64el" ]; then
LIBDIR=lib/mips64el-linux-gnuabi64
else else
echo Unknown CPU Architecture: "$DEFAULT_ARCH" echo Unknown CPU Architecture: "$DEFAULT_ARCH"
exit 1 exit 1
......
...@@ -476,9 +476,11 @@ update_urpmi_cfg() { ...@@ -476,9 +476,11 @@ update_urpmi_cfg() {
DEFAULT_ARCH="@@ARCHITECTURE@@" DEFAULT_ARCH="@@ARCHITECTURE@@"
get_lib_dir() { get_lib_dir() {
if [ "$DEFAULT_ARCH" = "i386" ]; then if [ "$DEFAULT_ARCH" = "i386" ] || [ "$DEFAULT_ARCH" = "armhf" ] || \
[ "$DEFAULT_ARCH" = "mipsel" ]; then
LIBDIR=lib LIBDIR=lib
elif [ "$DEFAULT_ARCH" = "x86_64" ]; then elif [ "$DEFAULT_ARCH" = "x86_64" ] || [ "$DEFAULT_ARCH" = "aarch64" ] || \
[ "$DEFAULT_ARCH" = "mips64el" ]; then
LIBDIR=lib64 LIBDIR=lib64
else else
echo Unknown CPU Architecture: "$DEFAULT_ARCH" echo Unknown CPU Architecture: "$DEFAULT_ARCH"
......
...@@ -137,7 +137,7 @@ cleanup() { ...@@ -137,7 +137,7 @@ cleanup() {
usage() { usage() {
echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel" echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel"
echo " -d branding [-f] [-o 'dir'] -s 'dir' -t target_os" echo " -d branding [-f] [-o 'dir'] -s 'dir' -t target_os"
echo "-a arch package architecture (ia32 or x64)" echo "-a arch deb package architecture"
echo "-b dir build input directory [${BUILDDIR}]" echo "-b dir build input directory [${BUILDDIR}]"
echo "-c channel the package channel (unstable, beta, stable)" echo "-c channel the package channel (unstable, beta, stable)"
echo "-d brand either chromium or google_chrome" echo "-d brand either chromium or google_chrome"
...@@ -177,7 +177,7 @@ process_opts() { ...@@ -177,7 +177,7 @@ process_opts() {
do do
case $OPTNAME in case $OPTNAME in
a ) a )
TARGETARCH="$OPTARG" ARCHITECTURE="$OPTARG"
;; ;;
b ) b )
BUILDDIR=$(readlink -f "${OPTARG}") BUILDDIR=$(readlink -f "${OPTARG}")
...@@ -225,12 +225,6 @@ process_opts() { ...@@ -225,12 +225,6 @@ process_opts() {
SCRIPTDIR=$(readlink -f "$(dirname "$0")") SCRIPTDIR=$(readlink -f "$(dirname "$0")")
OUTPUTDIR="${PWD}" OUTPUTDIR="${PWD}"
# Default target architecture to same as build host.
if [ "$(uname -m)" = "x86_64" ]; then
TARGETARCH="x64"
else
TARGETARCH="ia32"
fi
# call cleanup() on exit # call cleanup() on exit
trap cleanup 0 trap cleanup 0
...@@ -264,6 +258,7 @@ verify_channel ...@@ -264,6 +258,7 @@ verify_channel
# Some Debian packaging tools want these set. # Some Debian packaging tools want these set.
export DEBFULLNAME="${MAINTNAME}" export DEBFULLNAME="${MAINTNAME}"
export DEBEMAIL="${MAINTMAIL}" export DEBEMAIL="${MAINTMAIL}"
export ARCHITECTURE="${ARCHITECTURE}"
DEB_COMMON_DEPS="${BUILDDIR}/deb_common.deps" DEB_COMMON_DEPS="${BUILDDIR}/deb_common.deps"
COMMON_DEPS=$(sed ':a;N;$!ba;s/\n/, /g' "${DEB_COMMON_DEPS}") COMMON_DEPS=$(sed ':a;N;$!ba;s/\n/, /g' "${DEB_COMMON_DEPS}")
...@@ -274,33 +269,6 @@ COMMON_RECOMMENDS=$(grep -v ^$ "${MANUAL_RECOMMENDS}" | grep -v ^# | ...@@ -274,33 +269,6 @@ COMMON_RECOMMENDS=$(grep -v ^$ "${MANUAL_RECOMMENDS}" | grep -v ^# |
# Make everything happen in the OUTPUTDIR. # Make everything happen in the OUTPUTDIR.
cd "${OUTPUTDIR}" cd "${OUTPUTDIR}"
case "$TARGETARCH" in
arm )
export ARCHITECTURE="armhf"
;;
arm64 )
export ARCHITECTURE="arm64"
;;
ia32 )
export ARCHITECTURE="i386"
;;
x64 )
export ARCHITECTURE="amd64"
;;
mipsel )
export ARCHITECTURE="mipsel"
;;
mips64el )
export ARCHITECTURE="mips64el"
;;
* )
echo
echo "ERROR: Don't know how to build DEBs for '$TARGETARCH'."
echo
exit 1
;;
esac
BASEREPOCONFIG="dl.google.com/linux/chrome/deb/ stable main" BASEREPOCONFIG="dl.google.com/linux/chrome/deb/ stable main"
# Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have # Only use the default REPOCONFIG if it's unset (e.g. verify_channel might have
# set it to an empty string) # set it to an empty string)
......
...@@ -128,7 +128,7 @@ cleanup() { ...@@ -128,7 +128,7 @@ cleanup() {
usage() { usage() {
echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel" echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel"
echo " -d branding [-f] [-o 'dir'] -t target_os" echo " -d branding [-f] [-o 'dir'] -t target_os"
echo "-a arch package architecture (ia32 or x64)" echo "-a arch rpm package architecture"
echo "-b dir build input directory [${BUILDDIR}]" echo "-b dir build input directory [${BUILDDIR}]"
echo "-c channel the package channel (unstable, beta, stable)" echo "-c channel the package channel (unstable, beta, stable)"
echo "-d brand either chromium or google_chrome" echo "-d brand either chromium or google_chrome"
...@@ -164,7 +164,7 @@ process_opts() { ...@@ -164,7 +164,7 @@ process_opts() {
do do
case $OPTNAME in case $OPTNAME in
a ) a )
TARGETARCH="$OPTARG" ARCHITECTURE="$OPTARG"
;; ;;
b ) b )
BUILDDIR=$(readlink -f "${OPTARG}") BUILDDIR=$(readlink -f "${OPTARG}")
...@@ -210,16 +210,11 @@ process_opts() { ...@@ -210,16 +210,11 @@ process_opts() {
SCRIPTDIR=$(readlink -f "$(dirname "$0")") SCRIPTDIR=$(readlink -f "$(dirname "$0")")
OUTPUTDIR="${PWD}" OUTPUTDIR="${PWD}"
# Default target architecture to same as build host.
if [ "$(uname -m)" = "x86_64" ]; then
TARGETARCH="x64"
else
TARGETARCH="ia32"
fi
# call cleanup() on exit # call cleanup() on exit
trap cleanup 0 trap cleanup 0
process_opts "$@" process_opts "$@"
export ARCHITECTURE="${ARCHITECTURE}"
BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")}
IS_OFFICIAL_BUILD=${IS_OFFICIAL_BUILD:=0} IS_OFFICIAL_BUILD=${IS_OFFICIAL_BUILD:=0}
...@@ -247,36 +242,5 @@ REPOCONFIG="http://dl.google.com/linux/${PACKAGE#google-}/rpm/stable" ...@@ -247,36 +242,5 @@ REPOCONFIG="http://dl.google.com/linux/${PACKAGE#google-}/rpm/stable"
verify_channel verify_channel
export USR_BIN_SYMLINK_NAME="${PACKAGE}-${CHANNEL}" export USR_BIN_SYMLINK_NAME="${PACKAGE}-${CHANNEL}"
# Make everything happen in the OUTPUTDIR. stage_install_rpm
cd "${OUTPUTDIR}"
case "$TARGETARCH" in
arm )
export ARCHITECTURE="armhf"
stage_install_rpm
;;
ia32 )
export ARCHITECTURE="i386"
stage_install_rpm
;;
x64 )
export ARCHITECTURE="x86_64"
stage_install_rpm
;;
mipsel )
export ARCHITECTURE="mipsel"
stage_install_rpm
;;
mips64el )
export ARCHITECTURE="mips64el"
stage_install_rpm
;;
* )
echo
echo "ERROR: Don't know how to build RPMs for '$TARGETARCH'."
echo
exit 1
;;
esac
do_package do_package
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment