All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Awan, Arsalan" <Arsalan_Awan@mentor.com>
To: Alexander Kanavin <alex.kanavin@gmail.com>
Cc: "poky@yoctoproject.org" <poky@yoctoproject.org>
Subject: Re: [PATCH 1/1] initrdscripts/init-live.sh: fix mounts w/ spaces fail to move to real rootfs
Date: Thu, 28 Jun 2018 14:18:21 +0000	[thread overview]
Message-ID: <1530195500998.89361@mentor.com> (raw)
In-Reply-To: <CANNYZj8QVo_+b-71rKj2kQcfQdvaDz+QRGcyVckzX-NC_By+1w@mail.gmail.com>

My appologies...
I've sent it there now.

Thanks

-
Arsalan
________________________________________
From: Alexander Kanavin <alex.kanavin@gmail.com>
Sent: Thursday, June 28, 2018 4:23 PM
To: Awan, Arsalan
Cc: poky@yoctoproject.org
Subject: Re: [poky] [PATCH 1/1] initrdscripts/init-live.sh: fix mounts w/ spaces fail to move to real rootfs

This should go to oe-core mailing list.

Alex

2018-06-28 11:26 GMT+02:00 Arsalan Awan <Arsalan_Awan@mentor.com>:
> From: "Arsalan H. Awan" <Arsalan_Awan@mentor.com>
>
> When there are spaces in the mount points of devices e.g.:
>
>  a partition mounted at "/run/media/My Root Partition-sda1",
>
> the initrd fails to move such mount points over to the
> corresponding directories at /media under the real root filesystem,
> and the mount points would appear at the same location as they were
> mounted on when detected by initrd, for example:
>  here: "/run/media/My Root Partition-sda1"
>  instead of here: "/media/My Root Partition-sda1"
>
> This causes issues such as:
>
>   * The disks/partitions cannot be formated with any filesystem
>     using e.g. mkfs.ext4 or mke2fs in general. When tried to do so
>     by making sure the device is not mounted, it failed with
>     errors such as:
>
>     > /dev/sda1 is apparently in use by the system; will not make a
>       filesystem here!
>     > /dev/sda1: Device or resource busy while setting up superblock
>
>   * The read/write operations become extremely slow. e.g. Under testing,
>     it took approx. 2 hours just to copy 700 MB of data to the partition,
>     and it took more than 40 minutes to delete that data from it.
>     Same operations took under 5 minutes on a partition that had no
>     spaces in its mount point (or that was successfully moved to real
>     root by initrd and appeared under /media instead of /run/media).
>
> This commit fixes such issues by quoting the arguments of failing mount
> move commands and by parsing OCT or HEX encoded special characters
> such as spaces to ASCII charecters in the mount points as kernel
> populates the procfs like so.
>
> Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
> ---
>  meta/recipes-core/initrdscripts/files/init-live.sh | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
> index 441b41c..e58df12 100644
> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
> @@ -91,8 +91,11 @@ boot_live_root() {
>      # Move the mount points of some filesystems over to
>      # the corresponding directories under the real root filesystem.
>      for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
> -        mkdir -p  ${ROOT_MOUNT}/media/${dir##*/}
> -        mount -n --move $dir ${ROOT_MOUNT}/media/${dir##*/}
> +        # Parse any OCT or HEX encoded chars such as spaces
> +        # in the mount points to actual ASCII chars
> +        dir=`printf $dir`
> +        mkdir -p "${ROOT_MOUNT}/media/${dir##*/}"
> +        mount -n --move "$dir" "${ROOT_MOUNT}/media/${dir##*/}"
>      done
>      mount -n --move /proc ${ROOT_MOUNT}/proc
>      mount -n --move /sys ${ROOT_MOUNT}/sys
> --
> 2.7.4
>
> --
> _______________________________________________
> poky mailing list
> poky@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky


  reply	other threads:[~2018-06-28 14:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28  9:25 [PATCH 0/1] fixing initrd mounts w/ spaces fail to move to real rootfs Arsalan Awan
2018-06-28  9:26 ` [PATCH 1/1] initrdscripts/init-live.sh: fix " Arsalan Awan
2018-06-28 11:23   ` Alexander Kanavin
2018-06-28 14:18     ` Awan, Arsalan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-06-28 14:16 [PATCH 0/1] fixing initrd " Arsalan Awan
2018-06-28 14:16 ` [PATCH 1/1] initrdscripts/init-live.sh: fix " Arsalan Awan
2018-11-28 11:07   ` Awan, Arsalan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530195500998.89361@mentor.com \
    --to=arsalan_awan@mentor.com \
    --cc=alex.kanavin@gmail.com \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.