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
|
#!/bin/sh
. /usr/share/debconf/confmodule
dev=$1
num=$2
id=$3
size=$4
type=$5
fs=$6
path=$7
name=$8
cd $dev
# The purpose of this preliminary code is to execute the time
# consuming file system detection. check using tune2fs only once.
# From now on, we no longer need to run tune2fs but simply check
# for the existence of detected_ext2r0.
if [ ! -f /var/lib/partman/filesystems_detected ] && \
[ -f $id/detected_filesystem ] && \
[ "$(cat $id/detected_filesystem)" = ext2 ]; then
if $(tune2fs -l $path | \
grep -q '^Filesystem revision #: \+0 (original)$'); then
>$id/detected_ext2r0
else
rm -f $id/detected_ext2r0
fi
fi
# List the ext2r0 partition as ext2r0 in the main partman screen
if [ "$fs" != free ] && [ ! -f $id/method ] && [ -f $id/detected_filesystem ] && \
[ "$(cat $id/detected_filesystem)" = ext2 ] && [ -f $id/detected_ext2r0 ]; then
db_metaget partman/filesystem_short/ext2r0 description || RET=''
RET="${RET:-ext2r0}"
printf %s "$RET" >$id/visual_filesystem
fi
|