mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
make_chroot: remove unneeded modifications
These are assorted tweaks that are already setup in the tarball.
This commit is contained in:
parent
81ce75300f
commit
ae9d6252bc
@ -154,15 +154,9 @@ init_setup () {
|
|||||||
ln -sf "${CHROOT_TRUNK_DIR}/src/third_party/portage-stable" \
|
ln -sf "${CHROOT_TRUNK_DIR}/src/third_party/portage-stable" \
|
||||||
"${FLAGS_chroot}"/"${PORTAGE_STABLE_OVERLAY}"
|
"${FLAGS_chroot}"/"${PORTAGE_STABLE_OVERLAY}"
|
||||||
|
|
||||||
# Some operations need an mtab.
|
|
||||||
ln -sfT /proc/mounts "${FLAGS_chroot}/etc/mtab"
|
|
||||||
|
|
||||||
# Set up sudoers. Inside the chroot, the user can sudo without a password.
|
# Set up sudoers. Inside the chroot, the user can sudo without a password.
|
||||||
# (Safe enough, since the only way into the chroot is to 'sudo chroot', so
|
# (Safe enough, since the only way into the chroot is to 'sudo chroot', so
|
||||||
# the user's already typed in one sudo password...)
|
# the user's already typed in one sudo password...)
|
||||||
# Make sure the sudoers.d subdir exists as older stage3 base images lack it.
|
|
||||||
mkdir -p "${FLAGS_chroot}/etc/sudoers.d"
|
|
||||||
|
|
||||||
# Setup proxied vars.
|
# Setup proxied vars.
|
||||||
load_environment_whitelist
|
load_environment_whitelist
|
||||||
local extended_whitelist=(
|
local extended_whitelist=(
|
||||||
@ -173,14 +167,10 @@ init_setup () {
|
|||||||
|
|
||||||
cat > "${FLAGS_chroot}/etc/sudoers.d/90_cros" <<EOF
|
cat > "${FLAGS_chroot}/etc/sudoers.d/90_cros" <<EOF
|
||||||
Defaults env_keep += "${extended_whitelist[*]}"
|
Defaults env_keep += "${extended_whitelist[*]}"
|
||||||
%adm ALL=(ALL) ALL
|
|
||||||
root ALL=(ALL) ALL
|
|
||||||
${SUDO_USER} ALL=NOPASSWD: ALL
|
${SUDO_USER} ALL=NOPASSWD: ALL
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
find "${FLAGS_chroot}/etc/"sudoers* -type f -exec chmod 0440 {} +
|
chmod 0440 "${FLAGS_chroot}/etc/sudoers.d/90_cros"
|
||||||
# Fix bad group for some.
|
|
||||||
chown -R root:root "${FLAGS_chroot}/etc/"sudoers*
|
|
||||||
|
|
||||||
# Create directories referred to by our conf files.
|
# Create directories referred to by our conf files.
|
||||||
mkdir -p -m 775 "${FLAGS_chroot}/var/lib/portage/pkgs" \
|
mkdir -p -m 775 "${FLAGS_chroot}/var/lib/portage/pkgs" \
|
||||||
@ -222,20 +212,6 @@ EOF
|
|||||||
sudo ln -s "${CHROOT_TRUNK_DIR}"/chromite "${python_path}"
|
sudo ln -s "${CHROOT_TRUNK_DIR}"/chromite "${python_path}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Select a small set of locales for the user if they haven't done so
|
|
||||||
# already. This makes glibc upgrades cheap by only generating a small
|
|
||||||
# set of locales. The ones listed here are basically for the buildbots
|
|
||||||
# which always assume these are available. This works in conjunction
|
|
||||||
# with `cros_sdk --enter`.
|
|
||||||
# http://crosbug.com/20378
|
|
||||||
local localegen="$FLAGS_chroot/etc/locale.gen"
|
|
||||||
if ! grep -q -v -e '^#' -e '^$' "${localegen}" ; then
|
|
||||||
cat <<EOF >> "${localegen}"
|
|
||||||
en_US ISO-8859-1
|
|
||||||
en_US.UTF-8 UTF-8
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create ~/trunk symlink, it must point to CHROOT_TRUNK_DIR
|
# Create ~/trunk symlink, it must point to CHROOT_TRUNK_DIR
|
||||||
ln -sfT "${CHROOT_TRUNK_DIR}" "$FLAGS_chroot/home/${SUDO_USER}/trunk"
|
ln -sfT "${CHROOT_TRUNK_DIR}" "$FLAGS_chroot/home/${SUDO_USER}/trunk"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user