Disable "resize" and "delete" for partitions on "loop"
For RAID, crypto and LVM devices only one partition can be handled at a
time. As it makes no sense to resize or delete these kind of partitions,
let's hide the options instead of tricking the users.
As all these devices are using "loop" partition tables, that's our
filtering criteria here.
(Closes: #318228, #417973)
r53585
Jérémy Bobbio
15 years ago
0 | 0 |
#!/bin/sh
|
1 | 1 |
|
2 | |
. /usr/share/debconf/confmodule
|
|
2 |
. /lib/partman/lib/base.sh
|
|
3 |
|
|
4 |
dev=$1
|
|
5 |
id=$2
|
|
6 |
cd $dev
|
|
7 |
|
|
8 |
open_dialog GET_LABEL_TYPE
|
|
9 |
read_line label
|
|
10 |
close_dialog
|
|
11 |
|
|
12 |
# Disable on devices where there is no "real" partitioning
|
|
13 |
if [ "$label" = loop ]; then
|
|
14 |
exit 0
|
|
15 |
fi
|
3 | 16 |
|
4 | 17 |
db_metaget partman-partitioning/text/delete description
|
5 | 18 |
printf "delete\t${RET}\n"
|
6 | |
|
4 | 4 |
dev=$1
|
5 | 5 |
id=$2
|
6 | 6 |
cd $dev
|
|
7 |
|
|
8 |
open_dialog GET_LABEL_TYPE
|
|
9 |
read_line label
|
|
10 |
close_dialog
|
|
11 |
|
|
12 |
# Disable on devices where there is no "real" partitioning
|
|
13 |
if [ "$label" = loop ]; then
|
|
14 |
exit 0
|
|
15 |
fi
|
7 | 16 |
|
8 | 17 |
if [ -f $id/detected_filesystem ]; then
|
9 | 18 |
fs=$(cat $id/detected_filesystem)
|
0 | 0 |
partman-partitioning (60) UNRELEASED; urgency=low
|
1 | 1 |
|
|
2 |
[ Colin Watson ]
|
2 | 3 |
* Silence warning in case $id/options already exists.
|
3 | 4 |
* Move 'local' down a line in create_new_partition in order to work
|
4 | 5 |
properly with bash, which initialises local variables without an
|
|
7 | 8 |
contents of /lib/partman/mountoptions/${fs}_defaults if it exists.
|
8 | 9 |
* Use explicit dummy variables in create_new_partition rather than
|
9 | 10 |
overriding $type, $size, et al.
|
|
11 |
|
|
12 |
[ Jérémy Bobbio ]
|
|
13 |
* Disable "resize" and "delete" for partitions on "loop" partition tables.
|
|
14 |
This will prevent unusable behaviour on RAID, crypto and LVM partitions.
|
|
15 |
(Closes: #318228, #417973)
|
10 | 16 |
|
11 | 17 |
-- Colin Watson <cjwatson@debian.org> Tue, 27 May 2008 10:17:15 +0100
|
12 | 18 |
|