Debian/Ubuntu: Try again with /run

The fix for #97, 66233a1138, seems to
have created yet another issue (beyond #100):

"the link /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
is dangling (since /run has just been clobbered by an empty tmpfs).
debootstrap seems to populate all manner of stuff in /run."
f1721edda7 (commitcomment-45770519)

I considered just reverting all of this, since the original issue only
occurred when copying in an existing system.  Ignoring it was my
decision the first time this came up.  But it's come up twice now.
Also, this mode is mentioned in the guide.  Most importantly, if we are
not mounting a /tmpfs at /run in the normal case, then we could end up
with cruft in /run in the root filesystem which could potentially break
something or be confusing later if the /run tmpfs ever failed to mount.
So in the interest of correctness, I'd like to try to handle this.

I am now mounting a tmpfs at /mnt/run before the debootstrap step.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
This commit is contained in:
Richard Laager
2021-01-08 16:16:35 -06:00
parent f36bd91110
commit 2c76e5de97
2 changed files with 10 additions and 4 deletions

View File

@@ -489,6 +489,11 @@ Step 3: System Installation
zfs create -o com.sun:auto-snapshot=false rpool/var/lib/nfs zfs create -o com.sun:auto-snapshot=false rpool/var/lib/nfs
Mount a tmpfs at /run::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
A tmpfs is recommended later, but if you want a separate dataset for A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``:: ``/tmp``::
@@ -1044,8 +1049,6 @@ If needed, you can chroot into your installed environment::
mount --rbind /dev /mnt/dev mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys mount --rbind /sys /mnt/sys
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
chroot /mnt /bin/bash --login chroot /mnt /bin/bash --login
mount /boot mount /boot
mount -a mount -a

View File

@@ -615,6 +615,11 @@ Step 3: System Installation
zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub zfs create -o com.ubuntu.zsys:bootfs=no bpool/grub
Mount a tmpfs at /run::
mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
A tmpfs is recommended later, but if you want a separate dataset for A tmpfs is recommended later, but if you want a separate dataset for
``/tmp``:: ``/tmp``::
@@ -697,8 +702,6 @@ Step 4: System Configuration
mount --rbind /dev /mnt/dev mount --rbind /dev /mnt/dev
mount --rbind /proc /mnt/proc mount --rbind /proc /mnt/proc
mount --rbind /sys /mnt/sys mount --rbind /sys /mnt/sys
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock
chroot /mnt /usr/bin/env DISK=$DISK UUID=$UUID bash --login chroot /mnt /usr/bin/env DISK=$DISK UUID=$UUID bash --login
**Note:** This is using ``--rbind``, not ``--bind``. **Note:** This is using ``--rbind``, not ``--bind``.