File: user-params

package info (click to toggle)
debian-installer-utils 1.156
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 944 kB
  • sloc: sh: 1,001; ansic: 160; makefile: 62
file content (85 lines) | stat: -rwxr-xr-x 1,873 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh
if [ -z "$TESTSUITE" ]; then
	CMDLINE=/proc/cmdline
	ALIASES=/etc/preseed_aliases
else
	CMDLINE=user-params.in
	ALIASES=user-params.aliases
fi

# sed out multi-word quoted value settings
for item in $(sed -e 's/[^ =]*="[^"]*[ ][^"]*"//g' \
		  -e "s/[^ =]*='[^']*[ ][^']*'//g" $CMDLINE); do
	var="${item%=*}"
	# Remove trailing '?' for debconf variables set with '?='
	var="${var%\?}"

	if [ "$item" = "--" ] || [ "$item" = "---" ]; then
		inuser=1
		collect=""
	elif [ "$inuser" ]; then
		# BOOT_IMAGE and BOOTIF are added by syslinux
		if [ "$var" = "BOOT_IMAGE" ] || [ "$var" = "BOOTIF" ]; then
			continue
		fi

		# init is not generally useful to pass on
		if [ "$var" = init ]; then
			continue
		fi

		# suppress installer-specific parameters
		if [ "$var" = BOOT_DEBUG ] || [ "$var" = DEBIAN_FRONTEND ] || \
		   [ "$var" = INSTALL_MEDIA_DEV ] || [ "$var" = lowmem ] || \
		   [ "$var" = noshell ]; then
			continue
		fi

		# brltty settings shouldn't be passed since
		# they are already recorded in /etc/brltty.conf
		if [ "$var" = brltty ]; then
			continue
		fi

		# ks is only useful to kickseed in the first stage.
		if [ "$var" = ks ]; then
			continue
		fi

		# initrd is sometimes appended after "---" by syslinux, and
		# isn't useful to pass on.
		if [ "$var" = initrd ]; then
			continue
		fi

		# Skip debconf variables
		varnoslash="${var##*/*}"
		if [ "$varnoslash" = "" ]; then
			continue
		fi

		# Skip preseed aliases
		if [ -e "$ALIASES" ] && \
		   grep -q "^$var[[:space:]]" "$ALIASES"; then
			continue
		fi

		if [ -z "$collect" ]; then
			collect="$item"
		else
			collect="$collect $item"
		fi
	fi
done

if [ -z "$TESTSUITE" ]; then
	# Include default parameters
	RET=`debconf-get debian-installer/add-kernel-opts || true`
	if [ "$RET" ]; then
	        collect="$collect $RET"
	fi
fi

for word in $collect; do
	echo "$word"
done