mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Merge pull request #249 from wrigri/premout-fix
Fix a problem with Debian 8 on GCE with >2TB disks
This commit is contained in:
commit
52b5846cb5
1 changed files with 25 additions and 0 deletions
|
@ -1,5 +1,17 @@
|
||||||
# Selectively disable growroot -*- shell-script -*-
|
# Selectively disable growroot -*- shell-script -*-
|
||||||
set -e
|
set -e
|
||||||
|
PREREQ=""
|
||||||
|
prereqs()
|
||||||
|
{
|
||||||
|
echo "$PREREQ"
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
prereqs)
|
||||||
|
prereqs
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
message() { echo "DISABLE-GROWROOT:" "$@" ; }
|
message() { echo "DISABLE-GROWROOT:" "$@" ; }
|
||||||
error_exit() { message "$@"; exit 1; }
|
error_exit() { message "$@"; exit 1; }
|
||||||
|
@ -12,6 +24,19 @@ error_exit() { message "$@"; exit 1; }
|
||||||
# $ROOTFSTYPE - Generally empty
|
# $ROOTFSTYPE - Generally empty
|
||||||
# $rootmnt - Set to "/root"
|
# $rootmnt - Set to "/root"
|
||||||
|
|
||||||
|
# According to the initramfs documentation, it's supposed to wait until
|
||||||
|
# the disks have been attached and verified before the local-premount scripts
|
||||||
|
# run. This does not happen, however, and failures can happen below if $ROOT
|
||||||
|
# is referenced before the disk that it points to is attached. This allows for
|
||||||
|
# up to 4 seconds for that to happen. In practice, it generally takes less
|
||||||
|
# than half a second.
|
||||||
|
for i in $(seq 1 20); do
|
||||||
|
if [ -e "${ROOT}" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 0.2
|
||||||
|
done
|
||||||
|
|
||||||
# Follow link to get real root location
|
# Follow link to get real root location
|
||||||
if [ ! -L "${ROOT}" ]; then
|
if [ ! -L "${ROOT}" ]; then
|
||||||
real_root=${ROOT}
|
real_root=${ROOT}
|
||||||
|
|
Loading…
Add table
Reference in a new issue