mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-10-01 06:21:56 -09:00
support/scripts; teach check-merged what to check
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Romain Naour <romain.naour@smile.fr>
This commit is contained in:
committed by
Romain Naour
parent
0eb873bda0
commit
fc3cdc6d1e
3
Makefile
3
Makefile
@@ -781,12 +781,11 @@ endif
|
|||||||
|
|
||||||
# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
|
# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
|
||||||
# counterparts are appropriately setup as symlinks ones to the others.
|
# counterparts are appropriately setup as symlinks ones to the others.
|
||||||
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
|
|
||||||
@$(call MESSAGE,"Sanity check in overlays $(call qstrip,$(BR2_ROOTFS_OVERLAY))")
|
@$(call MESSAGE,"Sanity check in overlays $(call qstrip,$(BR2_ROOTFS_OVERLAY))")
|
||||||
support/scripts/check-merged \
|
support/scripts/check-merged \
|
||||||
--type overlay \
|
--type overlay \
|
||||||
|
$(if $(BR2_ROOTFS_MERGED_USR),--merged-usr) \
|
||||||
$(call qstrip,$(BR2_ROOTFS_OVERLAY))
|
$(call qstrip,$(BR2_ROOTFS_OVERLAY))
|
||||||
endif # merged /usr
|
|
||||||
|
|
||||||
$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
|
$(foreach d, $(call qstrip,$(BR2_ROOTFS_OVERLAY)), \
|
||||||
@$(call MESSAGE,"Copying overlay $(d)")$(sep) \
|
@$(call MESSAGE,"Copying overlay $(d)")$(sep) \
|
||||||
|
|||||||
@@ -23,19 +23,12 @@ $(error No path specified for the custom skeleton)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
|
define SKELETON_CUSTOM_CONFIGURE_CMDS
|
||||||
# counterparts are appropriately setup as symlinks ones to the others.
|
|
||||||
ifeq ($(BR2_ROOTFS_MERGED_USR),y)
|
|
||||||
define SKELETON_CUSTOM_NOT_MERGED_USR_DIRS
|
|
||||||
support/scripts/check-merged \
|
support/scripts/check-merged \
|
||||||
--type skeleton \
|
--type skeleton \
|
||||||
|
$(if $(BR2_ROOTFS_MERGED_USR),--merged-usr) \
|
||||||
$(SKELETON_CUSTOM_PATH)
|
$(SKELETON_CUSTOM_PATH)
|
||||||
endef
|
endef
|
||||||
endif # merged /usr
|
|
||||||
|
|
||||||
define SKELETON_CUSTOM_CONFIGURE_CMDS
|
|
||||||
$(SKELETON_CUSTOM_NOT_MERGED_USR_DIRS)
|
|
||||||
endef
|
|
||||||
|
|
||||||
# The target-dir-warning file and the lib{32,64} symlinks are the only
|
# The target-dir-warning file and the lib{32,64} symlinks are the only
|
||||||
# things we customise in the custom skeleton.
|
# things we customise in the custom skeleton.
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#
|
#
|
||||||
# Input:
|
# Input:
|
||||||
# --type TYPE the type of root to check: 'skeleton' or 'overlay'
|
# --type TYPE the type of root to check: 'skeleton' or 'overlay'
|
||||||
|
# --merged-usr check for merged /usr
|
||||||
# $*: the root directories (skeleton, overlays) to check
|
# $*: the root directories (skeleton, overlays) to check
|
||||||
# Output:
|
# Output:
|
||||||
# stdout: the list of non-compliant paths (empty if compliant).
|
# stdout: the list of non-compliant paths (empty if compliant).
|
||||||
@@ -21,17 +22,22 @@
|
|||||||
# !0: if any directory to check is improperly merged
|
# !0: if any directory to check is improperly merged
|
||||||
#
|
#
|
||||||
|
|
||||||
opts="type:"
|
opts="type:,merged-usr"
|
||||||
ARGS="$(getopt -n check-merged -o "" -l "${opts}" -- "${@}")" || exit 1
|
ARGS="$(getopt -n check-merged -o "" -l "${opts}" -- "${@}")" || exit 1
|
||||||
eval set -- "${ARGS}"
|
eval set -- "${ARGS}"
|
||||||
|
|
||||||
type=
|
type=
|
||||||
|
merged_usr=false
|
||||||
while :; do
|
while :; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
(--type)
|
(--type)
|
||||||
type="${2}"
|
type="${2}"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
(--merged-usr)
|
||||||
|
merged_usr=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
(--)
|
(--)
|
||||||
shift
|
shift
|
||||||
break
|
break
|
||||||
@@ -101,12 +107,14 @@ test_dir() {
|
|||||||
is_success=true
|
is_success=true
|
||||||
for root; do
|
for root; do
|
||||||
first=true
|
first=true
|
||||||
test_dir "${type}" "${root}" "/" "usr/bin"
|
if ${merged_usr}; then
|
||||||
test_dir "${type}" "${root}" "/" "usr/lib"
|
test_dir "${type}" "${root}" "/" "usr/bin"
|
||||||
test_dir "${type}" "${root}" "/" "usr/sbin"
|
test_dir "${type}" "${root}" "/" "usr/lib"
|
||||||
test_merged "${type}" "${root}" "/" "bin" "usr/bin"
|
test_dir "${type}" "${root}" "/" "usr/sbin"
|
||||||
test_merged "${type}" "${root}" "/" "lib" "usr/lib"
|
test_merged "${type}" "${root}" "/" "bin" "usr/bin"
|
||||||
test_merged "${type}" "${root}" "/" "sbin" "usr/sbin"
|
test_merged "${type}" "${root}" "/" "lib" "usr/lib"
|
||||||
|
test_merged "${type}" "${root}" "/" "sbin" "usr/sbin"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
${is_success}
|
${is_success}
|
||||||
|
|||||||
Reference in New Issue
Block a user