| 1 |
#!/bin/sh -e |
| 2 |
|
| 3 |
is_mountpoint() { |
| 4 |
if mountpoint -q "$1"; then |
| 5 |
return 0 |
| 6 |
fi |
| 7 |
return 1 # not a mount point |
| 8 |
} |
| 9 |
|
| 10 |
standalone_usr() { |
| 11 |
if is_mountpoint /usr; then |
| 12 |
return 0 |
| 13 |
fi |
| 14 |
return 1 |
| 15 |
} |
| 16 |
|
| 17 |
booted_with_initramfs() { |
| 18 |
# created by update-initramfs |
| 19 |
if [ -d /run/initramfs/ ]; then |
| 20 |
return 1 |
| 21 |
fi |
| 22 |
return 0 |
| 23 |
} |
| 24 |
|
| 25 |
has_initramfs() { |
| 26 |
standalone_usr || return 0 |
| 27 |
booted_with_initramfs || return 0 |
| 28 |
echo "/usr is a standalone filesystem, this requires using an initramfs." |
| 29 |
exit 1 |
| 30 |
} |
| 31 |
|
| 32 |
case "$1" in |
| 33 |
install) |
| 34 |
# check the prerequisites on the first install |
| 35 |
if [ -z "$2" ]; then |
| 36 |
has_initramfs |
| 37 |
fi |
| 38 |
;; |
| 39 |
esac |
| 40 |
|
| 41 |
#DEBHELPER# |
| 42 |
|