Bug#710709: debootstrap: consider creating (dangling) /etc/mtab symlink
On Wed, 2019-05-01 at 05:01 +0900, Hideki Yamane wrote: > control: tags -1 +patch > > revised patch > > > From 55c21c166959a93b961c572d5f366d35d054ce24 Mon Sep 17 00:00:00 2001 > From: Hideki Yamane > Date: Wed, 1 May 2019 04:24:43 +0900 > Subject: [PATCH] create symlink from /proc/self/mounts to /etc/mtab > > With old kernel version, there is /proc/mounts instead of > /proc/self/mounts, so check whether /proc/self exists This is silly, /proc/self has existed since Linux 0.99 and /proc/self/mounts since Linux 2.5.1.2. Ben. > --- > functions | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/functions b/functions > index 24f0357..46ebceb 100644 > --- a/functions > +++ b/functions > @@ -1176,6 +1176,13 @@ setup_proc () { > in_target mount -t sysfs sysfs /sys || true > umount_on_exit /sys > fi > + if [ ! -f "$TARGET/etc/mtab" ]; then > + if [ -L "$TARGET/proc/self" ]; then > + cd "$TARGET/etc" && ln -s ../proc/self/mounts > mtab > + elif [ -f "$TARGET/proc/mounts" ]; then > + cd "$TARGET/etc" && ln -s ../proc/mounts mtab > + fi > + fi > on_exit clear_mtab > ;; > esac -- Ben Hutchings Anthony's Law of Force: Don't force it, get a larger hammer. signature.asc Description: This is a digitally signed message part
Bug#710709: debootstrap: consider creating (dangling) /etc/mtab symlink
On Tue, 30 Apr 2019 at 13:03, Hideki Yamane wrote: > + if [ ! -f "$TARGET/etc/mtab" ]; then > + if [ -L "$TARGET/proc/self" ]; then > + cd "$TARGET/etc" && ln -s ../proc/self/mounts > mtab > + elif [ -f "$TARGET/proc/mounts" ]; then > + cd "$TARGET/etc" && ln -s ../proc/mounts mtab > + fi > + fi Not sure I understand the motivation for the "cd" invocations here -- just making a symlink shouldn't need that, right? | ln -s ../proc/self/mounts "$TARGET/etc/mtab" (Since a symlink is essentially just a special-typed plain text file and "ln -s" doesn't really care about the working directory except for interpreting the final target argument if it's relative.) ♥, - Tianon 4096R / B42F 6819 007F 00F8 8E36 4FD4 036A 9C25 BF35 7DD4
Bug#710709: debootstrap: consider creating (dangling) /etc/mtab symlink
control: tags -1 +patch revised patch >From 55c21c166959a93b961c572d5f366d35d054ce24 Mon Sep 17 00:00:00 2001 From: Hideki Yamane Date: Wed, 1 May 2019 04:24:43 +0900 Subject: [PATCH] create symlink from /proc/self/mounts to /etc/mtab With old kernel version, there is /proc/mounts instead of /proc/self/mounts, so check whether /proc/self exists --- functions | 7 +++ 1 file changed, 7 insertions(+) diff --git a/functions b/functions index 24f0357..46ebceb 100644 --- a/functions +++ b/functions @@ -1176,6 +1176,13 @@ setup_proc () { in_target mount -t sysfs sysfs /sys || true umount_on_exit /sys fi + if [ ! -f "$TARGET/etc/mtab" ]; then + if [ -L "$TARGET/proc/self" ]; then + cd "$TARGET/etc" && ln -s ../proc/self/mounts mtab + elif [ -f "$TARGET/proc/mounts" ]; then + cd "$TARGET/etc" && ln -s ../proc/mounts mtab + fi + fi on_exit clear_mtab ;; esac -- 2.20.1
Bug#710709: debootstrap: consider creating (dangling) /etc/mtab symlink
Package: debootstrap Version: 1.0.52 Severity: wishlist Hi. Perhaps it would make sense if: /etc/mtab - /proc/mounts was created by debootstrap as a dangling symlink. Seems not to be worse than not having mtab at all, and when one bind mounts /proc to the chroot, than it works out of the box. Or perhaps /etc/mtab should become part of some base backage? Cheers, Chris -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org