All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove questioned ISO image
@ 2012-03-26 21:19 Yang Shi
  2012-03-26 21:19 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
  2012-03-26 21:19 ` [PATCH 2/2] sato: Remove questioned ISO image Yang Shi
  0 siblings, 2 replies; 12+ messages in thread
From: Yang Shi @ 2012-03-26 21:19 UTC (permalink / raw)
  To: yocto; +Cc: dvhart


Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
Set UNION_FS variable depending on kenrel config, so that it can work with kernel which doesn't
have unionfs feature.

Without UNION FS enabled in kernel, minimal liveCD image can be bootup to ignore the failure of mouting
read-only filesystem. For the sato liveCD image, interactive bootup is needed, but psplash prevents from
booting interactively. In such case ISO image is not usable, so remove ISO image and the corresponding
link and throw error info to warn outside to enable unionfs in kenrel.

We tried a lot of different ways to achieve this:

1. Check if ISO image is built in initramfs-live-boot.bb or not, then prevent from generating ISO image.
But, we can't distinguish minimal image or sato image.

2. Check if x11 feature is included in initramfs-live-boot.bb or not, then prevent from generating ISO image.
But, x11 feature is contained in minimal image as well even though the package is not built.

3. Tried to append some check code in build_iso() in core-image-sato.bb, but poky can't support append code
in build_xxx functions like what we do for do_xxx funcitons.

So, we came up with current solution. Any new suggestion is appreciated.

One more thing is that if IMAGE_FSTYPE += "live" is not set in conf/local.conf with this fix, we will get below
error when building sato image:

ERROR: Running idle function
Traceback (most recent call last):
  File "/home/yshi/yocto/poky/bitbake/lib/bb/server/process.py", line
122, in ProcessServer.idle_commands(delay=0.1):
                 try:
    >                retval = function(self, data, False)
                     if retval is False:
  File "/home/yshi/yocto/poky/bitbake/lib/bb/cooker.py", line 1130, in
buildTargetsIdle(server=<ProcessServer(ProcessServer-1, started)>,
rq=<bb.runqueue.RunQueue instance at 0x74e4638>, abort=False):
                 try:
    >                retval = rq.execute_runqueue()
                 except runqueue.TaskFailure as exc:
  File "/home/yshi/yocto/poky/bitbake/lib/bb/runqueue.py", line 947,
in RunQueue.execute_runqueue():
                 self.rqexe = RunQueueExecuteDummy(self)
    >            if self.rqdata.prepare() == 0:
                     self.state = runQueueComplete
  File "/home/yshi/yocto/poky/bitbake/lib/bb/runqueue.py", line 719,
in RunQueueData.prepare():

procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + "." +
self.runq_task[dep])
    >                    self.runq_hash[task] =
bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]],
self.runq_task[task], procdep, self.dataCache)

  File "/home/yshi/yocto/poky/bitbake/lib/bb/siggen.py", line 153, in
SignatureGeneratorOEBasicHash.get_taskhash(fn='/home/yshi/yocto/poky/meta/recipes-sato/images/core-image-sato.bb',
task='do_bootimg', deps=[], dataCache=<bb.cache.CacheData object at
0x2148490>):
             k = fn + "." + task
    >        data = dataCache.basetaskhash[k]
             self.runtaskdeps[k] = []
KeyError: '/home/yshi/yocto/poky/meta/recipes-sato/images/core-image-sato.bb.do_bootimg'

NOTE: Preparing runqueue

Bruce pointed out there was a large discussion about this on hte list last week, so this should be a known issue in poky.

The following changes since commit f81b0593e74a31cb2d992df0583948ff57e3ed98:

  gdbm: Activate -enable-libgdbm-compat and add symlinks to headers in include/gdbm (2012-03-23 17:56:29 +0200)

are available in the git repository at:
  git://git.yoctoproject.org/poky-contrib yshi/1487
  http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=yshi/1487

Yang Shi (2):
      initrdscripts: fix init-live.sh and use unionfs
      sato: Remove questioned ISO image

 meta/recipes-core/initrdscripts/files/init-live.sh |   21 +++++++++++++++++--
 .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
 meta/recipes-sato/images/core-image-sato.bb        |   16 +++++++++++++++
 3 files changed, 42 insertions(+), 4 deletions(-)


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

* [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs
  2012-03-26 21:19 [PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove questioned ISO image Yang Shi
@ 2012-03-26 21:19 ` Yang Shi
  2012-04-09 16:35   ` Darren Hart
  2012-03-26 21:19 ` [PATCH 2/2] sato: Remove questioned ISO image Yang Shi
  1 sibling, 1 reply; 12+ messages in thread
From: Yang Shi @ 2012-03-26 21:19 UTC (permalink / raw)
  To: yocto; +Cc: dvhart

[YOCTO #1487]

Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
Set UNION_FS variable depending on kenrel config, so that it can work with kernel which doesn't
have unionfs feature.

Signed-off-by: Yang Shi <yang.shi@windriver.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |   21 +++++++++++++++++--
 .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index eb5ab5b..abaf16c 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
 MOUNT="/bin/mount"
 UMOUNT="/bin/umount"
 ISOLINUX=""
+UNIONFS="no"
 
 early_setup() {
     mkdir /proc
@@ -89,10 +90,24 @@ case $label in
 	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
-	    fatal "Couldnt mount rootfs image"
+	
+	if [ "$UNIONFS" = "yes" ]; then
+	    mkdir /rootfs-tmp
+
+	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
+		fatal "Couldnt mount rootfs image"
+	    else
+		mkdir /cow
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
+		mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
+		boot_live_root
+	    fi
 	else
-	    boot_live_root
+	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+		fatal "Couldnt mount rootfs image"
+	    else
+		boot_live_root
+	    fi
 	fi
 	;;
     install)
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
index e85a0e1..f7f0c9d 100644
--- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 RDEPENDS = "udev"
+DEPENDS = "virtual/kernel"
 SRC_URI = "file://init-live.sh"
 
-PR = "r7"
+PR = "r8"
 
+do_compile() {
+	if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
+		sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh
+	fi
+}
+ 
 do_install() {
         install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
 }
-- 
1.7.5.4



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

* [PATCH 2/2] sato: Remove questioned ISO image
  2012-03-26 21:19 [PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove questioned ISO image Yang Shi
  2012-03-26 21:19 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
@ 2012-03-26 21:19 ` Yang Shi
  2012-03-28 14:42   ` Bruce Ashfield
  2012-04-09 16:31   ` Darren Hart
  1 sibling, 2 replies; 12+ messages in thread
From: Yang Shi @ 2012-03-26 21:19 UTC (permalink / raw)
  To: yocto; +Cc: dvhart

[YOCTO #1487]

For the liveCD image, interactive bootup is needed, but psplash prevents from
booting interactively. In such case ISO image is not usable, so remove ISO image
and the corresponding link and throw error info to warn outside to enable
unionfs in kenrel.

Signed-off-by: Yang Shi <yang.shi@windriver.com>
---
 meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
index 11c3318..10e2239 100644
--- a/meta/recipes-sato/images/core-image-sato.bb
+++ b/meta/recipes-sato/images/core-image-sato.bb
@@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
 LICENSE = "MIT"
 
 inherit core-image
+
+LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
+
+do_check_unionfs() {
+        if [ "${NOISO}" = "1" ]; then
+                return
+        fi
+
+        if [ "${LIVE}" = "yes" ] && ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
+                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
+                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
+        fi
+}
+
+addtask check_unionfs before do_build after do_bootimg
-- 
1.7.5.4



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

* Re: [PATCH 2/2] sato: Remove questioned ISO image
  2012-03-26 21:19 ` [PATCH 2/2] sato: Remove questioned ISO image Yang Shi
@ 2012-03-28 14:42   ` Bruce Ashfield
  2012-04-09 16:31   ` Darren Hart
  1 sibling, 0 replies; 12+ messages in thread
From: Bruce Ashfield @ 2012-03-28 14:42 UTC (permalink / raw)
  To: Yang Shi; +Cc: yocto, dvhart

On 12-03-26 05:19 PM, Yang Shi wrote:
> [YOCTO #1487]
>
> For the liveCD image, interactive bootup is needed, but psplash prevents from
> booting interactively. In such case ISO image is not usable, so remove ISO image
> and the corresponding link and throw error info to warn outside to enable
> unionfs in kenrel.

I'm just bumping Yang's review. I worked with him on this problem
(which turned out to harder than we initially thought).

Does anyone else have better suggestions than this ? This keeps the
live image bootable and interactive when X is in play, but it has
some obvious side effects.

Cheers,

Bruce

>
> Signed-off-by: Yang Shi<yang.shi@windriver.com>
> ---
>   meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
>   1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
> index 11c3318..10e2239 100644
> --- a/meta/recipes-sato/images/core-image-sato.bb
> +++ b/meta/recipes-sato/images/core-image-sato.bb
> @@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
>   LICENSE = "MIT"
>
>   inherit core-image
> +
> +LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
> +
> +do_check_unionfs() {
> +        if [ "${NOISO}" = "1" ]; then
> +                return
> +        fi
> +
> +        if [ "${LIVE}" = "yes" ]&&  ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
> +                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
> +        fi
> +}
> +
> +addtask check_unionfs before do_build after do_bootimg



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

* Re: [PATCH 2/2] sato: Remove questioned ISO image
  2012-03-26 21:19 ` [PATCH 2/2] sato: Remove questioned ISO image Yang Shi
  2012-03-28 14:42   ` Bruce Ashfield
@ 2012-04-09 16:31   ` Darren Hart
  2012-04-09 18:34     ` Yang Shi
  1 sibling, 1 reply; 12+ messages in thread
From: Darren Hart @ 2012-04-09 16:31 UTC (permalink / raw)
  To: Yang Shi; +Cc: yocto



On 03/26/2012 02:19 PM, Yang Shi wrote:
> [YOCTO #1487]
> 
> For the liveCD image, interactive bootup is needed, but psplash prevents from
> booting interactively. In such case ISO image is not usable, so remove ISO image
> and the corresponding link and throw error info to warn outside to enable
> unionfs in kenrel.


The psplash only prevents interaction on the vga console right? If the
BSP supports a serial console as well there is not a problem right?

--
Darren

> 
> Signed-off-by: Yang Shi <yang.shi@windriver.com>
> ---
>  meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
> index 11c3318..10e2239 100644
> --- a/meta/recipes-sato/images/core-image-sato.bb
> +++ b/meta/recipes-sato/images/core-image-sato.bb
> @@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
>  LICENSE = "MIT"
>  
>  inherit core-image
> +
> +LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
> +
> +do_check_unionfs() {
> +        if [ "${NOISO}" = "1" ]; then
> +                return
> +        fi
> +
> +        if [ "${LIVE}" = "yes" ] && ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
> +                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
> +        fi
> +}
> +
> +addtask check_unionfs before do_build after do_bootimg

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


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

* Re: [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs
  2012-03-26 21:19 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
@ 2012-04-09 16:35   ` Darren Hart
  2012-04-09 18:33     ` Yang Shi
  0 siblings, 1 reply; 12+ messages in thread
From: Darren Hart @ 2012-04-09 16:35 UTC (permalink / raw)
  To: Yang Shi; +Cc: yocto



On 03/26/2012 02:19 PM, Yang Shi wrote:
> [YOCTO #1487]
> 
> Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
> Set UNION_FS variable depending on kenrel config, so that it can work with kernel which doesn't

s/kenrel/kernel/

> have unionfs feature.

This doesn't explain what the problem was. Someone reading this commit
message would not know WHY this change was needed.

The approach looks good though. Minor spelling issues below...

> 
> Signed-off-by: Yang Shi <yang.shi@windriver.com>
> ---
>  meta/recipes-core/initrdscripts/files/init-live.sh |   21 +++++++++++++++++--
>  .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
>  2 files changed, 26 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
> index eb5ab5b..abaf16c 100644
> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
> @@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
>  MOUNT="/bin/mount"
>  UMOUNT="/bin/umount"
>  ISOLINUX=""
> +UNIONFS="no"
>  
>  early_setup() {
>      mkdir /proc
> @@ -89,10 +90,24 @@ case $label in
>  	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
> -	    fatal "Couldnt mount rootfs image"

s/Couldnt/Could not/

> +	
> +	if [ "$UNIONFS" = "yes" ]; then
> +	    mkdir /rootfs-tmp
> +
> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
> +		fatal "Couldnt mount rootfs image"

s/Couldnt/Could not/

> +	    else
> +		mkdir /cow
> +		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
> +		mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
> +		boot_live_root
> +	    fi
>  	else
> -	    boot_live_root
> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
> +		fatal "Couldnt mount rootfs image"

s/Couldnt/Could not/

> +	    else
> +		boot_live_root
> +	    fi
>  	fi
>  	;;
>      install)
> diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> index e85a0e1..f7f0c9d 100644
> --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> @@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
>  LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>  RDEPENDS = "udev"
> +DEPENDS = "virtual/kernel"
>  SRC_URI = "file://init-live.sh"
>  
> -PR = "r7"
> +PR = "r8"
>  
> +do_compile() {
> +	if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
> +		sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh
> +	fi
> +}
> + 
>  do_install() {
>          install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
>  }

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


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

* Re: [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs
  2012-04-09 16:35   ` Darren Hart
@ 2012-04-09 18:33     ` Yang Shi
  0 siblings, 0 replies; 12+ messages in thread
From: Yang Shi @ 2012-04-09 18:33 UTC (permalink / raw)
  To: Darren Hart; +Cc: yocto

On 4/9/2012 9:35 AM, Darren Hart wrote:
>
> On 03/26/2012 02:19 PM, Yang Shi wrote:
>> [YOCTO #1487]
>>
>> Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
>> Set UNION_FS variable depending on kenrel config, so that it can work with kernel which doesn't
> s/kenrel/kernel/
>
>> have unionfs feature.
> This doesn't explain what the problem was. Someone reading this commit
> message would not know WHY this change was needed.
>
> The approach looks good though. Minor spelling issues below...

OK, thanks Darren. I will refine the log and fix the spelling errors soon.

Yang

>
>> Signed-off-by: Yang Shi<yang.shi@windriver.com>
>> ---
>>   meta/recipes-core/initrdscripts/files/init-live.sh |   21 +++++++++++++++++--
>>   .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
>>   2 files changed, 26 insertions(+), 4 deletions(-)
>>
>> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
>> index eb5ab5b..abaf16c 100644
>> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
>> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
>> @@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
>>   MOUNT="/bin/mount"
>>   UMOUNT="/bin/umount"
>>   ISOLINUX=""
>> +UNIONFS="no"
>>
>>   early_setup() {
>>       mkdir /proc
>> @@ -89,10 +90,24 @@ case $label in
>>   	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
>> -	    fatal "Couldnt mount rootfs image"
> s/Couldnt/Could not/
>
>> +	
>> +	if [ "$UNIONFS" = "yes" ]; then
>> +	    mkdir /rootfs-tmp
>> +
>> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
>> +		fatal "Couldnt mount rootfs image"
> s/Couldnt/Could not/
>
>> +	    else
>> +		mkdir /cow
>> +		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
>> +		mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
>> +		boot_live_root
>> +	    fi
>>   	else
>> -	    boot_live_root
>> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
>> +		fatal "Couldnt mount rootfs image"
> s/Couldnt/Could not/
>
>> +	    else
>> +		boot_live_root
>> +	    fi
>>   	fi
>>   	;;
>>       install)
>> diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
>> index e85a0e1..f7f0c9d 100644
>> --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
>> +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
>> @@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
>>   LICENSE = "MIT"
>>   LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>>   RDEPENDS = "udev"
>> +DEPENDS = "virtual/kernel"
>>   SRC_URI = "file://init-live.sh"
>>
>> -PR = "r7"
>> +PR = "r8"
>>
>> +do_compile() {
>> +	if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
>> +		sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh
>> +	fi
>> +}
>> +
>>   do_install() {
>>           install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
>>   }



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

* Re: [PATCH 2/2] sato: Remove questioned ISO image
  2012-04-09 16:31   ` Darren Hart
@ 2012-04-09 18:34     ` Yang Shi
  2012-04-09 19:49       ` Darren Hart
  0 siblings, 1 reply; 12+ messages in thread
From: Yang Shi @ 2012-04-09 18:34 UTC (permalink / raw)
  To: Darren Hart; +Cc: yocto

On 4/9/2012 9:31 AM, Darren Hart wrote:
>
> On 03/26/2012 02:19 PM, Yang Shi wrote:
>> [YOCTO #1487]
>>
>> For the liveCD image, interactive bootup is needed, but psplash prevents from
>> booting interactively. In such case ISO image is not usable, so remove ISO image
>> and the corresponding link and throw error info to warn outside to enable
>> unionfs in kenrel.
>
> The psplash only prevents interaction on the vga console right? If the
> BSP supports a serial console as well there is not a problem right?

Yes, I think so. When I was doing the test, I disabled splash so that I 
can type 'enter' to make interaction move forward.

Thanks,
Yang

>
> --
> Darren
>
>> Signed-off-by: Yang Shi<yang.shi@windriver.com>
>> ---
>>   meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
>>   1 files changed, 16 insertions(+), 0 deletions(-)
>>
>> diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
>> index 11c3318..10e2239 100644
>> --- a/meta/recipes-sato/images/core-image-sato.bb
>> +++ b/meta/recipes-sato/images/core-image-sato.bb
>> @@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
>>   LICENSE = "MIT"
>>
>>   inherit core-image
>> +
>> +LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
>> +
>> +do_check_unionfs() {
>> +        if [ "${NOISO}" = "1" ]; then
>> +                return
>> +        fi
>> +
>> +        if [ "${LIVE}" = "yes" ]&&  ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
>> +                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
>> +        fi
>> +}
>> +
>> +addtask check_unionfs before do_build after do_bootimg



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

* Re: [PATCH 2/2] sato: Remove questioned ISO image
  2012-04-09 18:34     ` Yang Shi
@ 2012-04-09 19:49       ` Darren Hart
  2012-04-09 20:48         ` Yang Shi
  0 siblings, 1 reply; 12+ messages in thread
From: Darren Hart @ 2012-04-09 19:49 UTC (permalink / raw)
  To: Yang Shi; +Cc: yocto



On 04/09/2012 11:34 AM, Yang Shi wrote:
> On 4/9/2012 9:31 AM, Darren Hart wrote:
>>
>> On 03/26/2012 02:19 PM, Yang Shi wrote:
>>> [YOCTO #1487]
>>>
>>> For the liveCD image, interactive bootup is needed, but psplash prevents from
>>> booting interactively. In such case ISO image is not usable, so remove ISO image
>>> and the corresponding link and throw error info to warn outside to enable
>>> unionfs in kenrel.
>>
>> The psplash only prevents interaction on the vga console right? If the
>> BSP supports a serial console as well there is not a problem right?
> 
> Yes, I think so. When I was doing the test, I disabled splash so that I 
> can type 'enter' to make interaction move forward.
> 

In that case, deleting the iso links if Unionfs is not configured in
does not seem appropriate. A bbwarn might be appropriate, but failing
and destroying the deploy data is certainly not.

--
Darren

> Thanks,
> Yang
> 
>>
>> --
>> Darren
>>
>>> Signed-off-by: Yang Shi<yang.shi@windriver.com>
>>> ---
>>>   meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
>>>   1 files changed, 16 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
>>> index 11c3318..10e2239 100644
>>> --- a/meta/recipes-sato/images/core-image-sato.bb
>>> +++ b/meta/recipes-sato/images/core-image-sato.bb
>>> @@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
>>>   LICENSE = "MIT"
>>>
>>>   inherit core-image
>>> +
>>> +LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
>>> +
>>> +do_check_unionfs() {
>>> +        if [ "${NOISO}" = "1" ]; then
>>> +                return
>>> +        fi
>>> +
>>> +        if [ "${LIVE}" = "yes" ]&&  ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
>>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
>>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
>>> +                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
>>> +        fi
>>> +}
>>> +
>>> +addtask check_unionfs before do_build after do_bootimg
> 

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


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

* Re: [PATCH 2/2] sato: Remove questioned ISO image
  2012-04-09 19:49       ` Darren Hart
@ 2012-04-09 20:48         ` Yang Shi
  0 siblings, 0 replies; 12+ messages in thread
From: Yang Shi @ 2012-04-09 20:48 UTC (permalink / raw)
  To: Darren Hart; +Cc: yocto

On 4/9/2012 12:49 PM, Darren Hart wrote:
>
> On 04/09/2012 11:34 AM, Yang Shi wrote:
>> On 4/9/2012 9:31 AM, Darren Hart wrote:
>>> On 03/26/2012 02:19 PM, Yang Shi wrote:
>>>> [YOCTO #1487]
>>>>
>>>> For the liveCD image, interactive bootup is needed, but psplash prevents from
>>>> booting interactively. In such case ISO image is not usable, so remove ISO image
>>>> and the corresponding link and throw error info to warn outside to enable
>>>> unionfs in kenrel.
>>> The psplash only prevents interaction on the vga console right? If the
>>> BSP supports a serial console as well there is not a problem right?
>> Yes, I think so. When I was doing the test, I disabled splash so that I
>> can type 'enter' to make interaction move forward.
>>
> In that case, deleting the iso links if Unionfs is not configured in
> does not seem appropriate. A bbwarn might be appropriate, but failing
> and destroying the deploy data is certainly not.

OK, will make it throw a warning instead of removing iso images.

Thanks,
Yang

>
> --
> Darren
>
>> Thanks,
>> Yang
>>
>>> --
>>> Darren
>>>
>>>> Signed-off-by: Yang Shi<yang.shi@windriver.com>
>>>> ---
>>>>    meta/recipes-sato/images/core-image-sato.bb |   16 ++++++++++++++++
>>>>    1 files changed, 16 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
>>>> index 11c3318..10e2239 100644
>>>> --- a/meta/recipes-sato/images/core-image-sato.bb
>>>> +++ b/meta/recipes-sato/images/core-image-sato.bb
>>>> @@ -9,3 +9,19 @@ IMAGE_FEATURES += "apps-console-core ${SATO_IMAGE_FEATURES}"
>>>>    LICENSE = "MIT"
>>>>
>>>>    inherit core-image
>>>> +
>>>> +LIVE = "${@base_contains('IMAGE_FSTYPES', 'live', 'yes', 'no', d)}"
>>>> +
>>>> +do_check_unionfs() {
>>>> +        if [ "${NOISO}" = "1" ]; then
>>>> +                return
>>>> +        fi
>>>> +
>>>> +        if [ "${LIVE}" = "yes" ]&&   ! grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
>>>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
>>>> +                rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
>>>> +                bbfatal "Building LIVE CD without UNION FS enabled in kernel"
>>>> +        fi
>>>> +}
>>>> +
>>>> +addtask check_unionfs before do_build after do_bootimg



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

* [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs
  2012-04-09 22:15 [V2 PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove " Yang Shi
@ 2012-04-09 22:15 ` Yang Shi
  2012-04-10 18:41   ` Darren Hart
  0 siblings, 1 reply; 12+ messages in thread
From: Yang Shi @ 2012-04-09 22:15 UTC (permalink / raw)
  To: yocto, dvhart, bruce.ashfield

[YOCTO #1487]

When booting up with liveCD image, init scripts can't work well on read-only filesystem. Unionfs,
which is supported in Yocto kernel, allows a filesystem to appear as writeable, but without
actually allowing writes to change the filesystem.

Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
Set UNION_FS variable depending on kernel config, so that it can work with kernel which doesn't
have unionfs feature.

Signed-off-by: Yang Shi <yang.shi@windriver.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh |   23 ++++++++++++++++---
 .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
 2 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index eb5ab5b..737dae4 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
 MOUNT="/bin/mount"
 UMOUNT="/bin/umount"
 ISOLINUX=""
+UNIONFS="no"
 
 early_setup() {
     mkdir /proc
@@ -89,17 +90,31 @@ case $label in
 	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
-	    fatal "Couldnt mount rootfs image"
+	
+	if [ "$UNIONFS" = "yes" ]; then
+	    mkdir /rootfs-tmp
+
+	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
+		fatal "Could not mount rootfs image"
+	    else
+		mkdir /cow
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
+		mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
+		boot_live_root
+	    fi
 	else
-	    boot_live_root
+	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+		fatal "Could not mount rootfs image"
+	    else
+		boot_live_root
+	    fi
 	fi
 	;;
     install)
 	if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
 	    ./install.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode
 	else
-	    fatal "Couldnt find install script"
+	    fatal "Could not find install script"
 	fi
 
 	# If we're getting here, we failed...
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
index e85a0e1..f7f0c9d 100644
--- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
+++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 RDEPENDS = "udev"
+DEPENDS = "virtual/kernel"
 SRC_URI = "file://init-live.sh"
 
-PR = "r7"
+PR = "r8"
 
+do_compile() {
+	if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
+		sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh
+	fi
+}
+ 
 do_install() {
         install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
 }
-- 
1.7.5.4



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

* Re: [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs
  2012-04-09 22:15 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
@ 2012-04-10 18:41   ` Darren Hart
  0 siblings, 0 replies; 12+ messages in thread
From: Darren Hart @ 2012-04-10 18:41 UTC (permalink / raw)
  To: Yang Shi; +Cc: yocto



On 04/09/2012 03:15 PM, Yang Shi wrote:
> [YOCTO #1487]
> 
> When booting up with liveCD image, init scripts can't work well on read-only filesystem. Unionfs,
> which is supported in Yocto kernel, allows a filesystem to appear as writeable, but without
> actually allowing writes to change the filesystem.
> 
> Use unionfs to mount rootfs and make root file system can be writen when using liveCD to boot up.
> Set UNION_FS variable depending on kernel config, so that it can work with kernel which doesn't
> have unionfs feature.
> 
> Signed-off-by: Yang Shi <yang.shi@windriver.com>

Acked-by: Darren Hart <dvhart@linux.intel.com>

> ---
>  meta/recipes-core/initrdscripts/files/init-live.sh |   23 ++++++++++++++++---
>  .../initrdscripts/initramfs-live-boot_1.0.bb       |    9 +++++++-
>  2 files changed, 27 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
> index eb5ab5b..737dae4 100644
> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
> @@ -7,6 +7,7 @@ ROOT_IMAGE="rootfs.img"
>  MOUNT="/bin/mount"
>  UMOUNT="/bin/umount"
>  ISOLINUX=""
> +UNIONFS="no"
>  
>  early_setup() {
>      mkdir /proc
> @@ -89,17 +90,31 @@ case $label in
>  	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
> -	    fatal "Couldnt mount rootfs image"
> +	
> +	if [ "$UNIONFS" = "yes" ]; then
> +	    mkdir /rootfs-tmp
> +
> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE /rootfs-tmp ; then
> +		fatal "Could not mount rootfs image"
> +	    else
> +		mkdir /cow
> +		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /cow
> +		mount -t unionfs -o dirs=/cow:/rootfs-tmp=ro unionfs $ROOT_MOUNT
> +		boot_live_root
> +	    fi
>  	else
> -	    boot_live_root
> +	    if ! $MOUNT -o rw,loop,noatime,nodiratime /media/$i/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
> +		fatal "Could not mount rootfs image"
> +	    else
> +		boot_live_root
> +	    fi
>  	fi
>  	;;
>      install)
>  	if [ -f /media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
>  	    ./install.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode
>  	else
> -	    fatal "Couldnt find install script"
> +	    fatal "Could not find install script"
>  	fi
>  
>  	# If we're getting here, we failed...
> diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> index e85a0e1..f7f0c9d 100644
> --- a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> +++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
> @@ -2,10 +2,17 @@ DESCRIPTION = "A live image init script"
>  LICENSE = "MIT"
>  LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
>  RDEPENDS = "udev"
> +DEPENDS = "virtual/kernel"
>  SRC_URI = "file://init-live.sh"
>  
> -PR = "r7"
> +PR = "r8"
>  
> +do_compile() {
> +	if grep -q "CONFIG_UNION_FS=y" ${STAGING_KERNEL_DIR}/.config; then
> +		sed -i 's/UNIONFS="no"/UNIONFS="yes"/g' ${WORKDIR}/init-live.sh
> +	fi
> +}
> + 
>  do_install() {
>          install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
>  }

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel


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

end of thread, other threads:[~2012-04-10 18:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-26 21:19 [PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove questioned ISO image Yang Shi
2012-03-26 21:19 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
2012-04-09 16:35   ` Darren Hart
2012-04-09 18:33     ` Yang Shi
2012-03-26 21:19 ` [PATCH 2/2] sato: Remove questioned ISO image Yang Shi
2012-03-28 14:42   ` Bruce Ashfield
2012-04-09 16:31   ` Darren Hart
2012-04-09 18:34     ` Yang Shi
2012-04-09 19:49       ` Darren Hart
2012-04-09 20:48         ` Yang Shi
  -- strict thread matches above, loose matches on Subject: below --
2012-04-09 22:15 [V2 PATCH 0/2] Fix init-live.sh to use unionfs for live CD and remove " Yang Shi
2012-04-09 22:15 ` [PATCH 1/2] initrdscripts: fix init-live.sh and use unionfs Yang Shi
2012-04-10 18:41   ` Darren Hart

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.