89a695a5e7
On some platforms after the initramfs init scripts have mounted the root device its block device disapear from /dev. The union-mount script therefore can't mount the root device over the aufs. If this case happen, issue a rescan of the devices to repopulate the /dev filesystem.
21 lines
694 B
Django/Jinja
21 lines
694 B
Django/Jinja
#!/bin/sh -e
|
|
case $1 in
|
|
prereqs)
|
|
exit 0
|
|
;;
|
|
esac
|
|
|
|
## Mount the aufs file system: rw layer over squashfs
|
|
mkdir -p ${rootmnt}/host/rw
|
|
mount -n -o dirs=${rootmnt}/host/rw:${rootmnt}=ro -t aufs root-aufs ${rootmnt}
|
|
## Check if the root block device is still there
|
|
[ -b ${ROOT} ] || mdev -s
|
|
## Mount the raw partition again
|
|
mount ${ROOT} ${rootmnt}/host
|
|
## Mount the working directory of docker engine in the raw partition, bypass the aufs
|
|
mkdir -p ${rootmnt}/var/lib/docker
|
|
mount --bind ${rootmnt}/host/{{ DOCKERFS_DIR }} ${rootmnt}/var/lib/docker
|
|
## Mount the boot directory in the raw partition, bypass the aufs
|
|
mkdir -p ${rootmnt}/boot
|
|
mount --bind ${rootmnt}/host/boot ${rootmnt}/boot
|