File: device.sh

package info (click to toggle)
kickseed 0.64
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 304 kB
  • sloc: sh: 1,709; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 525 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh

device_handler () {
	opts=
	eval set -- "$(getopt -o '' -l opts: -- "$@")" || { warn_getopt device; return; }
	while :; do
		case $1 in
			--opts)
				opts="$2"
				shift 2
				;;
			--)	shift; break ;;
			*)	warn_getopt device; return ;;
		esac
	done

	if [ "$opts" ]; then
		if [ $# -ne 2 ]; then
			warn "device command requires type and modulename"
			return
		fi
		# type argument ($1) ignored
		modulename="$2"

		# requires hw-detect 1.17
		ks_preseed d-i "hw-detect/module_params/$2" string "$opts"
	fi
}