mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 05:56:58 +02:00
Adds gmergefs. A method of remoting to a target and pushing new
packages using emerge from the host Review URL: http://codereview.chromium.org/1515011
This commit is contained in:
parent
e9e585f330
commit
aa1a7fd63d
@ -237,8 +237,8 @@ sudo cp -a "${BOARD_ROOT}"/lib/libgcc_s.so* "${ROOT_FS_DIR}/lib"
|
|||||||
sudo cp -a "${BOARD_ROOT}"/usr/lib/libstdc++.so* "${ROOT_FS_DIR}/usr/lib"
|
sudo cp -a "${BOARD_ROOT}"/usr/lib/libstdc++.so* "${ROOT_FS_DIR}/usr/lib"
|
||||||
|
|
||||||
INSTALL_MASK=""
|
INSTALL_MASK=""
|
||||||
if [[ $FLAGS_installmask -eq $FLAGS_TRUE ]] ; then
|
if [[ $FLAGS_installmask -eq $FLAGS_FALSE ]] ; then
|
||||||
INSTALL_MASK="/usr/include/ /usr/man /usr/share/man /usr/share/doc /usr/share/gtk-doc /usr/share/gtk-2.0 /usr/lib/gtk-2.0/include /usr/share/info /usr/share/aclocal /usr/lib/gcc /usr/lib/pkgconfig /usr/share/pkgconfig /usr/share/gettext /usr/share/readline /etc/runlevels /usr/share/openrc /lib/rc *.a *.la"
|
INSTALL_MASK="$DEFAULT_INSTALL_MASK"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $FLAGS_jobs -ne -1 ]]; then
|
if [[ $FLAGS_jobs -ne -1 ]]; then
|
||||||
|
28
common.sh
28
common.sh
@ -116,6 +116,13 @@ fi
|
|||||||
# Directory locations inside the dev chroot
|
# Directory locations inside the dev chroot
|
||||||
CHROOT_TRUNK_DIR="/home/$USER/trunk"
|
CHROOT_TRUNK_DIR="/home/$USER/trunk"
|
||||||
|
|
||||||
|
# Install make for portage ebuilds. Used by build_image and gmergefs.
|
||||||
|
DEFAULT_INSTALL_MASK="/usr/include/ /usr/man /usr/share/man /usr/share/doc \
|
||||||
|
/usr/share/gtk-doc /usr/share/gtk-2.0 /usr/lib/gtk-2.0/include \
|
||||||
|
/usr/share/info /usr/share/aclocal /usr/lib/gcc /usr/lib/pkgconfig \
|
||||||
|
/usr/share/pkgconfig /usr/share/gettext /usr/share/readline /etc/runlevels \
|
||||||
|
/usr/share/openrc /lib/rc *.a *.la"
|
||||||
|
|
||||||
# Check to ensure not running old scripts
|
# Check to ensure not running old scripts
|
||||||
V_REVERSE='[7m'
|
V_REVERSE='[7m'
|
||||||
V_VIDOFF='[m'
|
V_VIDOFF='[m'
|
||||||
@ -295,3 +302,24 @@ function die {
|
|||||||
error "$1"
|
error "$1"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Retry an emerge command according to $FLAGS_retries
|
||||||
|
# The $EMERGE_JOBS flags will only be added the first time the command is run
|
||||||
|
function eretry () {
|
||||||
|
$* $EMERGE_JOBS && return 0
|
||||||
|
local i=
|
||||||
|
for i in $(seq $FLAGS_retries); do
|
||||||
|
echo Retrying $*
|
||||||
|
$* && return 0
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Removes single quotes around parameter
|
||||||
|
# Arguments:
|
||||||
|
# $1 - string which optionally has surrounding quotes
|
||||||
|
# Returns:
|
||||||
|
# None, but prints the string without quotes.
|
||||||
|
function remove_quotes() {
|
||||||
|
echo "$1" | sed -e "s/^'//; s/'$//"
|
||||||
|
}
|
||||||
|
@ -25,7 +25,8 @@ DEFINE_string build_number "" \
|
|||||||
DEFINE_string chrome_root "" \
|
DEFINE_string chrome_root "" \
|
||||||
"The root of your chrome browser source. Should contain a 'src' subdir."
|
"The root of your chrome browser source. Should contain a 'src' subdir."
|
||||||
|
|
||||||
DEFINE_boolean official_build $FLAGS_FALSE "Set CHROMEOS_OFFICIAL=1 for release builds."
|
DEFINE_boolean official_build $FLAGS_FALSE \
|
||||||
|
"Set CHROMEOS_OFFICIAL=1 for release builds."
|
||||||
DEFINE_boolean mount $FLAGS_FALSE "Only set up mounts."
|
DEFINE_boolean mount $FLAGS_FALSE "Only set up mounts."
|
||||||
DEFINE_boolean unmount $FLAGS_FALSE "Only tear down mounts."
|
DEFINE_boolean unmount $FLAGS_FALSE "Only tear down mounts."
|
||||||
|
|
||||||
@ -64,6 +65,8 @@ set -e
|
|||||||
INNER_CHROME_ROOT="/home/$USER/chrome_root" # inside chroot
|
INNER_CHROME_ROOT="/home/$USER/chrome_root" # inside chroot
|
||||||
CHROME_ROOT_CONFIG="/var/cache/chrome_root" # inside chroot
|
CHROME_ROOT_CONFIG="/var/cache/chrome_root" # inside chroot
|
||||||
INNER_DEPOT_TOOLS_ROOT="/home/$USER/depot_tools" # inside chroot
|
INNER_DEPOT_TOOLS_ROOT="/home/$USER/depot_tools" # inside chroot
|
||||||
|
KERNEL_MODULES_ROOT="/lib/modules/$( uname -r )" # inside and outside chroot
|
||||||
|
FUSE_DEVICE="/dev/fuse"
|
||||||
|
|
||||||
sudo chmod 0777 "$FLAGS_chroot/var/lock"
|
sudo chmod 0777 "$FLAGS_chroot/var/lock"
|
||||||
|
|
||||||
@ -138,7 +141,29 @@ function setup_env {
|
|||||||
echo "This may impact chromium build."
|
echo "This may impact chromium build."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Mount fuse device from host machine into chroot and copy over
|
||||||
|
# corresponding kernel modules.
|
||||||
|
MOUNTED_PATH="$(readlink -f "${FLAGS_chroot}${FUSE_DEVICE}")"
|
||||||
|
if [ -z "$(mount | grep -F "on ${MOUNTED_PATH} ")" ]
|
||||||
|
then
|
||||||
|
if [ -c "${FUSE_DEVICE}" ] ; then
|
||||||
|
echo "Mounting fuse device"
|
||||||
|
sudo touch "${MOUNTED_PATH}"
|
||||||
|
sudo mount --bind "${FUSE_DEVICE}" "${MOUNTED_PATH}"
|
||||||
|
INNER_MOD_PATH="$(readlink -f "${FLAGS_chroot}${KERNEL_MODULES_ROOT}")"
|
||||||
|
if [ ! -f "${INNER_MOD_PATH}/modules.dep" ] ; then
|
||||||
|
sudo mkdir -p "${INNER_MOD_PATH}/kernel/fs/fuse"
|
||||||
|
sudo cp -fu "${KERNEL_MODULES_ROOT}/modules.dep" "${INNER_MOD_PATH}"
|
||||||
|
sudo cp -fu "${KERNEL_MODULES_ROOT}/kernel/fs/fuse/fuse.ko" \
|
||||||
|
"${INNER_MOD_PATH}/kernel/fs/fuse"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Warning: Fuse device not found. gmergefs will not work"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
) 200>>"$LOCKFILE" || die "setup_env failed"
|
) 200>>"$LOCKFILE" || die "setup_env failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,15 +79,6 @@ function is_successful_test() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Removes single quotes around parameter
|
|
||||||
# Arguments:
|
|
||||||
# $1 - string which optionally has surrounding quotes
|
|
||||||
# Returns:
|
|
||||||
# None, but prints the string without quotes.
|
|
||||||
function remove_quotes() {
|
|
||||||
echo "$1" | sed -e "s/^'//; s/'$//"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Adds attributes to all tests run
|
# Adds attributes to all tests run
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 - results directory
|
# $1 - results directory
|
||||||
|
Loading…
Reference in New Issue
Block a user