[OE-core] [PATCH] init-install*: /etc/mtab make a link rather than a copy

Belal, Awais Awais_Belal at mentor.com
Fri Jul 29 10:18:51 UTC 2016


Good catch Andre... I did a local update but forgot to send the v2. I'll do so now.

BR,
Awais

________________________________________
From: Andre McCurdy [armccurdy at gmail.com]
Sent: Friday, July 29, 2016 2:00 AM
To: Belal, Awais
Cc: OE Core mailing list
Subject: Re: [OE-core] [PATCH] init-install*: /etc/mtab make a link rather than a copy

On Thu, Jul 28, 2016 at 1:49 AM, Awais Belal <awais_belal at mentor.com> wrote:
> Using a copy would only make management of devices erroneous
> and makes the system unstable in some scenarios as tools will
> have to manipulate both files separately. A link ensures that
> both files /proc/mounts and /etc/mtab will have the same
> information at all times and this is how it is handled
> on newer systems where there is such a need. Same is
> suggested by busybox.
>
> Signed-off-by: Awais Belal <awais_belal at mentor.com>
> ---
>  meta/recipes-core/initrdscripts/files/init-install-efi.sh | 2 +-
>  meta/recipes-core/initrdscripts/files/init-install.sh     | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> index f564f4e..53f6508 100644
> --- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
> @@ -123,7 +123,7 @@ mkdir -p /tmp
>
>  # Create /etc/mtab if not present
>  if [ ! -e /etc/mtab ]; then
> -    cat /proc/mounts > /etc/mtab
> +    ln -sf /etc/mtab /proc/mounts

Did you mean:

  ln -sf /proc/mounts /etc/mtab

?

>  fi
>
>  disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
> diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
> index 72ce92b..21ae0a6 100644
> --- a/meta/recipes-core/initrdscripts/files/init-install.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-install.sh
> @@ -119,7 +119,7 @@ fi
>
>  mkdir -p /tmp
>  if [ ! -L /etc/mtab ]; then
> -    cat /proc/mounts > /etc/mtab
> +    ln -sf /etc/mtab /proc/mounts
>  fi
>
>  disk_size=$(parted ${device} unit mb print | grep '^Disk .*: .*MB' | cut -d" " -f 3 | sed -e "s/MB//")
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list