diff options
| author | Tails developers <amnesia@boum.org> | 2011-09-08 15:48:16 +0200 |
|---|---|---|
| committer | Tails developers <amnesia@boum.org> | 2011-09-08 15:52:46 +0200 |
| commit | add39bdb96e82687b0d4c0a7a7cfc0423a2b046a (patch) | |
| tree | b92f47d20c1df6cdc782db98efd024d2587e039b /scripts | |
| parent | 2d4d31be00e0d7f6292ee748d116bb812bd374a6 (diff) | |
| download | live-boot-add39bdb96e82687b0d4c0a7a7cfc0423a2b046a.tar.gz live-boot-add39bdb96e82687b0d4c0a7a7cfc0423a2b046a.zip | |
Erroring out in case a "wrong" filesystem was chosen.
If live-boot finds a "wrong" filesystem that looks OK, then the error message
can be pretty confusing. Panic with an explicit message in this case.
The "is this rootfs valid" test is implemented by checking if the
/usr/share/doc/live-boot/ directory exists: as per Debian Policy 2.3 (Copyright
considerations), this directory must exist on any system where the live-boot
binary package is installed.
Adapted and reformatted from a patch by Christian Hofstaedtler <ch@grml.org>.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/live-bottom/10validateroot | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/live-bottom/10validateroot b/scripts/live-bottom/10validateroot new file mode 100755 index 0000000..23eb900 --- /dev/null +++ b/scripts/live-bottom/10validateroot @@ -0,0 +1,29 @@ +#!/bin/sh + +# Error out in case a "wrong" file system was chosen. + +#set -e + +# initramfs-tools header + +PREREQ="" + +prereqs() +{ + echo "${PREREQ}" +} + +case "${1}" in + prereqs) + prereqs + exit 0 + ;; +esac + +. /scripts/live-functions +. /scripts/live-helpers + +if ! [ -d "/root/usr/share/doc/live-boot" ] +then + panic "A wrong rootfs was mounted." +fi |
