scripts/dev-needs.sh
Source file repositories/reference/linux-study-clean/scripts/dev-needs.sh
File Facts
- System
- Linux kernel
- Corpus path
scripts/dev-needs.sh- Extension
.sh- Size
- 6219 bytes
- Lines
- 316
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: scripts
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function helpfunction detail_compatfunction detail_chosen
Annotated Snippet
function help() {
cat << EOF
Usage: $(basename $0) [-c|-d|-m|-f] [filter options] <list of devices>
This script needs to be run on the target device once it has booted to a
shell.
The script takes as input a list of one or more device directories under
/sys/devices and then lists the probe dependency chain (suppliers and
parents) of these devices. It does a breadth first search of the dependency
chain, so the last entry in the output is close to the root of the
dependency chain.
By default it lists the full path to the devices under /sys/devices.
It also takes an optional modifier flag as the first parameter to change
what information is listed in the output. If the requested information is
not available, the device name is printed.
-c lists the compatible string of the dependencies
-d lists the driver name of the dependencies that have probed
-m lists the module name of the dependencies that have a module
-f list the firmware node path of the dependencies
-g list the dependencies as edges and nodes for graphviz
-t list the dependencies as edges for tsort
The filter options provide a way to filter out some dependencies:
--allow-no-driver By default dependencies that don't have a driver
attached are ignored. This is to avoid following
device links to "class" devices that are created
when the consumer probes (as in, not a probe
dependency). If you want to follow these links
anyway, use this flag.
--exclude-devlinks Don't follow device links when tracking probe
dependencies.
--exclude-parents Don't follow parent devices when tracking probe
dependencies.
EOF
}
function dev_to_detail() {
local i=0
while [ $i -lt ${#OUT_LIST[@]} ]
do
local C=${OUT_LIST[i]}
local S=${OUT_LIST[i+1]}
local D="'$(detail_chosen $C $S)'"
if [ ! -z "$D" ]
then
# This weirdness is needed to work with toybox when
# using the -t option.
printf '%05u\t%s\n' ${i} "$D" | tr -d \'
fi
i=$((i+2))
done
}
function already_seen() {
local i=0
while [ $i -lt ${#OUT_LIST[@]} ]
do
if [ "$1" = "${OUT_LIST[$i]}" ]
then
# if-statement treats 0 (no-error) as true
return 0
fi
i=$(($i+2))
Annotation
- Detected declarations: `function help`, `function detail_compat`, `function detail_chosen`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.