home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- . /lib/partman/definitions.sh
-
- installdir () {
- dir="${1%/}"
- while [ "$dir" ]; do
- dirs="$dir $dirs"
- dir="${dir%/*}"
- done
- for dir in $dirs; do
- [ -d "$dir" ] || mkdir $dir
- done
- }
-
- fstab=$(
- for i in /lib/partman/fstab.d/*; do
- [ -x "$i" ] || continue
- $i
- done |
- while read fs mp type options dump pass; do
- echo $mp $fs $type $options $dump $pass
- done |
- sort |
- while read mp fs type options dump pass; do
- echo $fs $mp $type $options $dump $pass
- done
- )
-
- IFS="$NL"
- for f in $fstab; do
- restore_ifs
- set -- $f
- case "$2" in
- /media/*)
- installdir "/target$2"
- continue
- ;;
- /*)
- installdir "/target$2"
- ;;
- esac
- for m in /lib/partman/mount.d/*; do
- [ -x "$m" ] || continue
-
- # partman-doc specifies that mount.d scripts output the command
- # needed to unmount the partition; currently this is unused
- unmount_cmd=$($m "$f")
- if [ "$?" = 0 ]; then
- case $2 in
- /)
- # create these before /var is mounted, so that udev can
- # use them
- installdir /target/var/lock
- installdir /target/var/run
- ;;
- esac
- continue 2
- fi
- done
-
- db_subst partman-target/mount_failed DEVICE $(humandev $1)
- db_subst partman-target/mount_failed MOUNTPOINT $2
- db_subst partman-target/mount_failed TYPE $3
- db_input critical partman-target/mount_failed || true
- db_go || exit 1
- db_get partman-target/mount_failed
- if [ "$RET" = true ]; then
- exit 1
- else
- exit 2
- fi
- done
-