pre-pivot.sh: mount data partition in /run first
This commit is contained in:
parent
78b8f5e01d
commit
9ef2358251
17
pre-pivot.sh
17
pre-pivot.sh
|
@ -107,19 +107,22 @@ if [[ $(blkid -o value -s TYPE "$datadev") != "xfs" ]]; then
|
||||||
mkfs.xfs -f -L data "$datadev"
|
mkfs.xfs -f -L data "$datadev"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o discard $datadev /sysroot/mnt || die "Failed to mount $datadev"
|
mkdir -p /run/initramfs/mnt
|
||||||
|
|
||||||
|
mount -o discard $datadev /run/initramfs/mnt || die "Failed to mount $datadev"
|
||||||
|
|
||||||
for i in var home cfg; do
|
for i in var home cfg; do
|
||||||
if ! [[ -d /sysroot/mnt/$i ]]; then
|
if ! [[ -d /run/initramfs/mnt/$i ]]; then
|
||||||
mkdir /sysroot/mnt/$i
|
mkdir /run/initramfs/mnt/$i
|
||||||
FIRST_TIME=1
|
FIRST_TIME=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
mount -o bind /sysroot/mnt/var /sysroot/var
|
|
||||||
mount -o bind /sysroot/mnt/home /sysroot/home
|
mount -o bind /run/initramfs/mnt/var /sysroot/var
|
||||||
mount -o bind /sysroot/mnt/cfg /sysroot/cfg
|
mount -o bind /run/initramfs/mnt/home /sysroot/home
|
||||||
umount -l /sysroot/mnt
|
mount -o bind /run/initramfs/mnt/cfg /sysroot/cfg
|
||||||
|
umount -l /run/initramfs/mnt
|
||||||
|
|
||||||
#for i in passwd shadow group gshadow subuid subgid; do
|
#for i in passwd shadow group gshadow subuid subgid; do
|
||||||
# [[ -f /sysroot/cfg/$i ]] && continue
|
# [[ -f /sysroot/cfg/$i ]] && continue
|
||||||
|
|
Loading…
Reference in a new issue