Move dev_to_partman() to lib/auto-shared.sh
dev_to_partman() was defined and used in display.d/initial_auto.
To be shared among other partman-auto-*, it is now defined in
lib/auto-shared.sh.
Based on a patch by Grégory Oestreicher.
r55250
Jérémy Bobbio
15 years ago
|
0 |
partman-auto (81) UNRELEASED; urgency=low
|
|
1 |
|
|
2 |
[ Jérémy Bobbio ]
|
|
3 |
* Move dev_to_partman() to lib/auto-shared.sh.
|
|
4 |
Based on a patch by Grégory Oestreicher.
|
|
5 |
|
|
6 |
-- Jérémy Bobbio <[email protected]> Fri, 01 Aug 2008 22:49:11 +0000
|
|
7 |
|
0 | 8 |
partman-auto (80) unstable; urgency=low
|
1 | 9 |
|
2 | 10 |
[ Jérémy Bobbio ]
|
7 | 7 |
fi
|
8 | 8 |
|
9 | 9 |
. /lib/partman/lib/auto-shared.sh
|
10 | |
|
11 | |
dev_to_partman () {
|
12 | |
local dev_name="$1"
|
13 | |
|
14 | |
local mapped_dev_name="$(mapdevfs $dev_name)"
|
15 | |
if [ -n "$mapped_dev_name" ]; then
|
16 | |
dev_name="$mapped_dev_name"
|
17 | |
fi
|
18 | |
|
19 | |
for dev in $DEVICES/*; do
|
20 | |
[ -d "$dev" ] || continue
|
21 | |
|
22 | |
# mapdevfs both to allow for different ways to refer to the
|
23 | |
# same device using devfs, and to allow user input in
|
24 | |
# non-devfs form
|
25 | |
if [ "$(mapdevfs $(cat $dev/device))" = "$dev_name" ]; then
|
26 | |
echo $dev
|
27 | |
fi
|
28 | |
done
|
29 | |
}
|
30 | 10 |
|
31 | 11 |
# Skip if no disks detected and don't run on S/390
|
32 | 12 |
if [ -z "$(get_auto_disks)" ] || \
|
212 | 212 |
|
213 | 213 |
# TODO: Add a select_auto_disks() function
|
214 | 214 |
# Note: This needs a debconf_multiselect equiv.
|
|
215 |
|
|
216 |
# Maps a devfs name to a partman directory
|
|
217 |
dev_to_partman () {
|
|
218 |
local dev_name="$1"
|
|
219 |
|
|
220 |
local mapped_dev_name="$(mapdevfs $dev_name)"
|
|
221 |
if [ -n "$mapped_dev_name" ]; then
|
|
222 |
dev_name="$mapped_dev_name"
|
|
223 |
fi
|
|
224 |
|
|
225 |
for dev in $DEVICES/*; do
|
|
226 |
# mapdevfs both to allow for different ways to refer to the
|
|
227 |
# same device using devfs, and to allow user input in
|
|
228 |
# non-devfs form
|
|
229 |
if [ "$(mapdevfs $(cat $dev/device))" = "$dev_name" ]; then
|
|
230 |
echo $dev
|
|
231 |
fi
|
|
232 |
done
|
|
233 |
}
|