[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [][PATCH v2] init-install*: /etc/mtab make a link rather than a copy
From:       Khem Raj <raj.khem () gmail ! com>
Date:       2016-07-29 18:56:37
Message-ID: 327FC3F5-417C-46EE-B26C-237C938D26CA () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


> On Jul 29, 2016, at 3:22 AM, Awais Belal <awais_belal@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@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..8b996ca \
>                 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 /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..2362c53 \
>                 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

also check if /proc/mounts exists as well here.

> -    cat /proc/mounts > /etc/mtab
> +    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//")
> --
> 1.9.1
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iEYEARECAAYFAlebpuUACgkQuwUzVZGdMxSY+gCeLxFCfHTGeTCUm4nPOTwNrJ4S
040AniOgv5S4rruIGFb8nidT7HkVZaxZ
=KeGl
-----END PGP SIGNATURE-----


-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic