All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] live image misc fixes
@ 2014-05-15 10:40 Chen Qi
  2014-05-15 10:40 ` [PATCH 1/3] udev-extraconf: fix the misuse of /run/media Chen Qi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chen Qi @ 2014-05-15 10:40 UTC (permalink / raw)
  To: openembedded-core

The purpose of this patchset is to make our live image work correctly after the
following commit.

    commit acfe3014d41de5e87cdbc58d0396349c6b9c3ffd
    udev-extraconf: update mount.sh to use /run/media instead of /media

These patches are tested against the core-image-minimal iso image for both booting and installing.

//Chen Qi


The following changes since commit 58417093d7ce83c8a2f683a356fddc23aaee5e8e:

  wic: Extend indirect string connection to support image names and rootfs (2014-05-13 19:35:06 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/live-image-misc-fixes
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/live-image-misc-fixes

Chen Qi (3):
  udev-extraconf: fix the misuse of /run/media
  init-live.sh: list block devices correctly
  initrdscripts: fix for /run/media

 .../initrdscripts/files/init-install-efi-testfs.sh |   14 +++++++-------
 .../initrdscripts/files/init-install-efi.sh        |   14 +++++++-------
 .../initrdscripts/files/init-install-testfs.sh     |    4 ++--
 .../initrdscripts/files/init-install.sh            |    4 ++--
 meta/recipes-core/initrdscripts/files/init-live.sh |   20 ++++++++++----------
 meta/recipes-core/udev/udev-extraconf/mount.sh     |    2 +-
 6 files changed, 29 insertions(+), 29 deletions(-)

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] udev-extraconf: fix the misuse of /run/media
  2014-05-15 10:40 [PATCH 0/3] live image misc fixes Chen Qi
@ 2014-05-15 10:40 ` Chen Qi
  2014-05-15 10:40 ` [PATCH 2/3] init-live.sh: list block devices correctly Chen Qi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Chen Qi @ 2014-05-15 10:40 UTC (permalink / raw)
  To: openembedded-core

The error was introduced by the following commit.

  acfe3014d41de5e87cdbc58d0396349c6b9c3ffd
  udev-extraconf: update mount.sh to use /run/media instead of /media

It accidently replaced 'device/media' by 'device/run/media' which causes
error for live images to be unable to boot up correctly, complaining
"Cannot find rootfs.img in /media/*".

This patch fixes the above problem.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/udev/udev-extraconf/mount.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
index 3e4f21f..7df1b6e 100644
--- a/meta/recipes-core/udev/udev-extraconf/mount.sh
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -60,7 +60,7 @@ rm_dir() {
 
 # No ID_FS_TYPE for cdrom device, yet it should be mounted
 name="`basename "$DEVNAME"`"
-[ -e /sys/block/$name/device/run/media ] && media_type=`cat /sys/block/$name/device/run/media`
+[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
 
 if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
 	if [ -x "$PMOUNT" ]; then
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] init-live.sh: list block devices correctly
  2014-05-15 10:40 [PATCH 0/3] live image misc fixes Chen Qi
  2014-05-15 10:40 ` [PATCH 1/3] udev-extraconf: fix the misuse of /run/media Chen Qi
@ 2014-05-15 10:40 ` Chen Qi
  2014-05-15 10:40 ` [PATCH 3/3] initrdscripts: fix for /run/media Chen Qi
  2014-05-15 13:11 ` [PATCH 0/3] live image misc fixes Valentin Popa
  3 siblings, 0 replies; 5+ messages in thread
From: Chen Qi @ 2014-05-15 10:40 UTC (permalink / raw)
  To: openembedded-core

Instead of using 'ls /dev/sd*' command to list block devices, we
should rather use 'cat /proc/partitions'.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index 9e53a25..0bc38b7 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -134,7 +134,7 @@ do
 	   echo "Mounted filesystems"
            mount | grep media
            echo "Available block devices"
-           ls /dev/sd*
+           cat /proc/partitions
            fatal "Cannot find $ROOT_IMAGE file in /media/* , dropping to a shell "
       fi
       C=$(( C + 1 ))
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] initrdscripts: fix for /run/media
  2014-05-15 10:40 [PATCH 0/3] live image misc fixes Chen Qi
  2014-05-15 10:40 ` [PATCH 1/3] udev-extraconf: fix the misuse of /run/media Chen Qi
  2014-05-15 10:40 ` [PATCH 2/3] init-live.sh: list block devices correctly Chen Qi
@ 2014-05-15 10:40 ` Chen Qi
  2014-05-15 13:11 ` [PATCH 0/3] live image misc fixes Valentin Popa
  3 siblings, 0 replies; 5+ messages in thread
From: Chen Qi @ 2014-05-15 10:40 UTC (permalink / raw)
  To: openembedded-core

mount.sh in udev-extraconf was modified to use /run/media instead
of /media. Unfortunately, our scripts in initrdscripts have some
dependency on the auto-mounting mechanism proviced by udev-extraconf.
So these scripts should also be fixed to use /run/media instead /media,
otherwise, our live image cannot work correctly.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../initrdscripts/files/init-install-efi-testfs.sh |   14 +++++++-------
 .../initrdscripts/files/init-install-efi.sh        |   14 +++++++-------
 .../initrdscripts/files/init-install-testfs.sh     |    4 ++--
 .../initrdscripts/files/init-install.sh            |    4 ++--
 meta/recipes-core/initrdscripts/files/init-live.sh |   18 +++++++++---------
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
index 2fea761..7a0b4d4 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -128,7 +128,7 @@ mkdir /rootmnt
 mkdir /bootmnt
 
 mount $rootfs /ssd
-mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
 
 echo "Copying rootfs files..."
 cp -a /rootmnt/* /ssd
@@ -150,13 +150,13 @@ mount $bootfs /ssd
 
 EFIDIR="/ssd/EFI/BOOT"
 mkdir -p $EFIDIR
-cp /media/$1/vmlinuz /ssd
+cp /run/media/$1/vmlinuz /ssd
 # Copy the efi loader
-cp /media/$1/EFI/BOOT/*.efi $EFIDIR
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
 
-if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
     GRUBCFG="$EFIDIR/grub.cfg"
-    cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+    cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
     # Update grub config for the installed image
     # Delete the install entry
     sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
@@ -170,10 +170,10 @@ if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
     sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
 fi
 
-if [ -d /media/$1/loader ]; then
+if [ -d /run/media/$1/loader ]; then
     GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
     # copy config files for gummiboot
-    cp -dr /media/$1/loader /ssd
+    cp -dr /run/media/$1/loader /ssd
     # delete the install entry
     rm -f /ssd/loader/entries/install.conf
     # delete the initrd lines
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
index ed3221b..8bd7025 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-efi.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -128,7 +128,7 @@ mkdir /rootmnt
 mkdir /bootmnt
 
 mount $rootfs /ssd
-mount -o rw,loop,noatime,nodiratime /media/$1/$2 /rootmnt
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
 
 echo "Copying rootfs files..."
 cp -a /rootmnt/* /ssd
@@ -150,13 +150,13 @@ mount $bootfs /ssd
 
 EFIDIR="/ssd/EFI/BOOT"
 mkdir -p $EFIDIR
-cp /media/$1/vmlinuz /ssd
+cp /run/media/$1/vmlinuz /ssd
 # Copy the efi loader
-cp /media/$1/EFI/BOOT/*.efi $EFIDIR
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
 
-if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
     GRUBCFG="$EFIDIR/grub.cfg"
-    cp /media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+    cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
     # Update grub config for the installed image
     # Delete the install entry
     sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
@@ -170,10 +170,10 @@ if [ -f /media/$1/EFI/BOOT/grub.cfg ]; then
     sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
 fi
 
-if [ -d /media/$1/loader ]; then
+if [ -d /run/media/$1/loader ]; then
     GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
     # copy config files for gummiboot
-    cp -dr /media/$1/loader /ssd
+    cp -dr /run/media/$1/loader /ssd
     # delete the install entry
     rm -f /ssd/loader/entries/install.conf
     # delete the initrd lines
diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
index d2f2420..26e1fb3 100644
--- a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -151,7 +151,7 @@ mkdir -p /boot
 
 # Handling of the target root partition
 mount $rootfs /tgt_root
-mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
 echo "Copying rootfs files..."
 cp -a /src_root/* /tgt_root
 if [ -d /tgt_root/etc/ ] ; then
@@ -197,7 +197,7 @@ if [ ! -f /boot/grub/grub.cfg ] ; then
     echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
 fi
 
-cp /media/$1/vmlinuz /boot/
+cp /run/media/$1/vmlinuz /boot/
 
 umount /boot
 
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
index 8e433d5..b160003 100644
--- a/meta/recipes-core/initrdscripts/files/init-install.sh
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -151,7 +151,7 @@ mkdir -p /boot
 
 # Handling of the target root partition
 mount $rootfs /tgt_root
-mount -o rw,loop,noatime,nodiratime /media/$1/$2 /src_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
 echo "Copying rootfs files..."
 cp -a /src_root/* /tgt_root
 if [ -d /tgt_root/etc/ ] ; then
@@ -194,7 +194,7 @@ if [ ! -f /boot/grub/grub.cfg ] ; then
     echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
 fi
 
-cp /media/$1/vmlinuz /boot/
+cp /run/media/$1/vmlinuz /boot/
 
 umount /boot
 
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index 0bc38b7..0be9b6f 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -82,9 +82,9 @@ 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.* \/media/{print $2}' /proc/mounts`; do
-        mkdir -p  ${ROOT_MOUNT}/$dir
-        mount -n --move $dir ${ROOT_MOUNT}/$dir
+    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##*/}
     done
     mount -n --move /proc ${ROOT_MOUNT}/proc
     mount -n --move /sys ${ROOT_MOUNT}/sys
@@ -113,11 +113,11 @@ echo "Waiting for removable media..."
 C=0
 while true
 do
-  for i in `ls /media 2>/dev/null`; do
-      if [ -f /media/$i/$ROOT_IMAGE ] ; then
+  for i in `ls /run/media 2>/dev/null`; do
+      if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
 		found="yes"
 		break
-	  elif [ -f /media/$i/isolinux/$ROOT_IMAGE ]; then
+	  elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
 		found="yes"
 		ISOLINUX="isolinux"
 		break	
@@ -135,7 +135,7 @@ do
            mount | grep media
            echo "Available block devices"
            cat /proc/partitions
-           fatal "Cannot find $ROOT_IMAGE file in /media/* , dropping to a shell "
+           fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
       fi
       C=$(( C + 1 ))
   fi
@@ -150,7 +150,7 @@ mount_and_boot() {
     mkdir $ROOT_MOUNT
     mknod /dev/loop0 b 7 0 2>/dev/null
 
-    if ! mount -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+    if ! mount -o rw,loop,noatime,nodiratime /run/media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
 	fatal "Could not mount rootfs image"
     fi
 
@@ -211,7 +211,7 @@ case $label in
 	mount_and_boot
 	;;
     install|install-efi)
-	if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+	if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
 	    ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
 	else
 	    fatal "Could not find $label script"
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] live image misc fixes
  2014-05-15 10:40 [PATCH 0/3] live image misc fixes Chen Qi
                   ` (2 preceding siblings ...)
  2014-05-15 10:40 ` [PATCH 3/3] initrdscripts: fix for /run/media Chen Qi
@ 2014-05-15 13:11 ` Valentin Popa
  3 siblings, 0 replies; 5+ messages in thread
From: Valentin Popa @ 2014-05-15 13:11 UTC (permalink / raw)
  To: openembedded-core

On 05/15/2014 01:40 PM, Chen Qi wrote:
> The purpose of this patchset is to make our live image work correctly after the
> following commit.
>
>      commit acfe3014d41de5e87cdbc58d0396349c6b9c3ffd
>      udev-extraconf: update mount.sh to use /run/media instead of /media
>
> These patches are tested against the core-image-minimal iso image for both booting and installing.
>
> //Chen Qi


Acked-by: Valentin Popa <valentin.popa@intel.com>

>
> The following changes since commit 58417093d7ce83c8a2f683a356fddc23aaee5e8e:
>
>    wic: Extend indirect string connection to support image names and rootfs (2014-05-13 19:35:06 +0100)
>
> are available in the git repository at:
>
>    git://git.openembedded.org/openembedded-core-contrib ChenQi/live-image-misc-fixes
>    http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/live-image-misc-fixes
>
> Chen Qi (3):
>    udev-extraconf: fix the misuse of /run/media
>    init-live.sh: list block devices correctly
>    initrdscripts: fix for /run/media
>
>   .../initrdscripts/files/init-install-efi-testfs.sh |   14 +++++++-------
>   .../initrdscripts/files/init-install-efi.sh        |   14 +++++++-------
>   .../initrdscripts/files/init-install-testfs.sh     |    4 ++--
>   .../initrdscripts/files/init-install.sh            |    4 ++--
>   meta/recipes-core/initrdscripts/files/init-live.sh |   20 ++++++++++----------
>   meta/recipes-core/udev/udev-extraconf/mount.sh     |    2 +-
>   6 files changed, 29 insertions(+), 29 deletions(-)
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-15 13:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15 10:40 [PATCH 0/3] live image misc fixes Chen Qi
2014-05-15 10:40 ` [PATCH 1/3] udev-extraconf: fix the misuse of /run/media Chen Qi
2014-05-15 10:40 ` [PATCH 2/3] init-live.sh: list block devices correctly Chen Qi
2014-05-15 10:40 ` [PATCH 3/3] initrdscripts: fix for /run/media Chen Qi
2014-05-15 13:11 ` [PATCH 0/3] live image misc fixes Valentin Popa

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.