mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
update hooks: migrate paths to userpriv settings (part 2)
The previous upgrade hook didn't change all the perms on files in the host distdir because the default value expands to a symlink which `find` did not walk. Add the -H flag to make that happen. For people who haven't upgraded yet, stub out the existing 38 hook. BUG=chromium-os:3616 TEST=add a root owned file to host distdir, run ./update_chroot, see file owners fixed Change-Id: I3f5f88b4fb1d27ce588a342331ad10e957961bcc Reviewed-on: https://gerrit.chromium.org/gerrit/24459 Reviewed-by: Zdenek Behan <zbehan@chromium.org> Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
0e1709f295
commit
8b06bd5926
@ -2,16 +2,6 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
# Migrate to userpriv for building things. We need to clean out old
|
# The previous one had a bug, so we moved it to 39 and fixed the bug
|
||||||
# dirs that might have files owned by root:root.
|
# (missing -H flag to find).
|
||||||
|
exit 0
|
||||||
eval $(portageq envvar -v PORTAGE_{TMPDIR,USERNAME,GRPNAME} DISTDIR PKGDIR)
|
|
||||||
: ${PORTAGE_TMPDIR:=/var/tmp/portage}
|
|
||||||
: ${PORTAGE_USERNAME:=${USER}}
|
|
||||||
: ${PORTAGE_GRPNAME:=portage}
|
|
||||||
: ${DISTDIR:=/var/cache/distfiles/host}
|
|
||||||
: ${PKGDIR:=/var/lib/portage/pkgs}
|
|
||||||
|
|
||||||
exec sudo find "${PORTAGE_TMPDIR}" "${DISTDIR}" "${PKGDIR}" \
|
|
||||||
'(' -uid 0 -o -gid 0 ')' \
|
|
||||||
-exec chown -h "${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" {} +
|
|
||||||
|
17
chroot_version_hooks.d/39_host_userpriv_better
Normal file
17
chroot_version_hooks.d/39_host_userpriv_better
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
# Migrate to userpriv for building things. We need to clean out old
|
||||||
|
# dirs that might have files owned by root:root.
|
||||||
|
|
||||||
|
eval $(portageq envvar -v PORTAGE_{TMPDIR,USERNAME,GRPNAME} DISTDIR PKGDIR)
|
||||||
|
: ${PORTAGE_TMPDIR:=/var/tmp/portage}
|
||||||
|
: ${PORTAGE_USERNAME:=${USER}}
|
||||||
|
: ${PORTAGE_GRPNAME:=portage}
|
||||||
|
: ${DISTDIR:=/var/cache/distfiles/host}
|
||||||
|
: ${PKGDIR:=/var/lib/portage/pkgs}
|
||||||
|
|
||||||
|
exec sudo find -H "${PORTAGE_TMPDIR}" "${DISTDIR}" "${PKGDIR}" \
|
||||||
|
'(' -uid 0 -o -gid 0 ')' \
|
||||||
|
-exec chown -h "${PORTAGE_USERNAME}:${PORTAGE_GRPNAME}" {} +
|
Loading…
x
Reference in New Issue
Block a user