Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] initrdscripts: add $CMDLINE to init-live switch_root
@ 2014-01-15 11:27 krzysztof.m.sywula
  2014-01-15 11:33 ` Otavio Salvador
  2014-05-15  6:29 ` ChenQi
  0 siblings, 2 replies; 4+ messages in thread
From: krzysztof.m.sywula @ 2014-01-15 11:27 UTC (permalink / raw)
  To: openembedded-core

From: Krzysztof Sywula <krzysztof.m.sywula@intel.com>

init-live.sh: $CMDLINE variable should be provided to switch_root
to let user specify runlevel on grub command line.
Feeding with -c /dev/console as well as busybox switch_root enables that option.

Signed-off-by: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index bd259b9..7e27f91 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -89,7 +89,10 @@ boot_live_root() {
     mount -n --move /dev ${ROOT_MOUNT}/dev
 
     cd $ROOT_MOUNT
-    exec switch_root $ROOT_MOUNT /sbin/init
+
+    # busybox switch_root supports -c option
+    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
+        fatal "Couldn't switch_root, dropping to shell"
 }
 
 fatal() {
-- 
1.7.12.2



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

* Re: [PATCH] initrdscripts: add $CMDLINE to init-live switch_root
  2014-01-15 11:27 [PATCH] initrdscripts: add $CMDLINE to init-live switch_root krzysztof.m.sywula
@ 2014-01-15 11:33 ` Otavio Salvador
  2014-05-15  6:29 ` ChenQi
  1 sibling, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2014-01-15 11:33 UTC (permalink / raw)
  To: krzysztof.m.sywula; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 669 bytes --]

On Wed, Jan 15, 2014 at 9:27 AM, <krzysztof.m.sywula@intel.com> wrote:

> From: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
>
> init-live.sh: $CMDLINE variable should be provided to switch_root
> to let user specify runlevel on grub command line.
> Feeding with -c /dev/console as well as busybox switch_root enables that
> option.
>
> Signed-off-by: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
>

Reviewed-by: Otavio Salvador <otavio@ossystems.com.br>

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

[-- Attachment #2: Type: text/html, Size: 1371 bytes --]

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

* Re: [PATCH] initrdscripts: add $CMDLINE to init-live switch_root
  2014-01-15 11:27 [PATCH] initrdscripts: add $CMDLINE to init-live switch_root krzysztof.m.sywula
  2014-01-15 11:33 ` Otavio Salvador
@ 2014-05-15  6:29 ` ChenQi
  2014-06-13  3:32   ` ChenQi
  1 sibling, 1 reply; 4+ messages in thread
From: ChenQi @ 2014-05-15  6:29 UTC (permalink / raw)
  To: openembedded-core

On 01/15/2014 07:27 PM, krzysztof.m.sywula@intel.com wrote:
> From: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
>
> init-live.sh: $CMDLINE variable should be provided to switch_root
> to let user specify runlevel on grub command line.
> Feeding with -c /dev/console as well as busybox switch_root enables that option.
>
> Signed-off-by: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
> ---
>   meta/recipes-core/initrdscripts/files/init-live.sh | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
> index bd259b9..7e27f91 100644
> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
> @@ -89,7 +89,10 @@ boot_live_root() {
>       mount -n --move /dev ${ROOT_MOUNT}/dev
>   
>       cd $ROOT_MOUNT
> -    exec switch_root $ROOT_MOUNT /sbin/init
> +
> +    # busybox switch_root supports -c option
> +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
> +        fatal "Couldn't switch_root, dropping to shell"
>   }
>   
>   fatal() {

I once sent out a patch to remove the '-c /dev/console' because this is 
busybox specific.
What if util-linux gets installed in the initramfs?

Could you please state what the benefit is with this option? Maybe in 
the comment?
The disadvantage is obvious, because if you have util-linux in 
initramfs, the 'switch_root' command doesn't support that option, and 
the 'switch_root' command would always fail.

Best Regards,
Chen Qi


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

* Re: [PATCH] initrdscripts: add $CMDLINE to init-live switch_root
  2014-05-15  6:29 ` ChenQi
@ 2014-06-13  3:32   ` ChenQi
  0 siblings, 0 replies; 4+ messages in thread
From: ChenQi @ 2014-06-13  3:32 UTC (permalink / raw)
  To: openembedded-core

On 05/15/2014 02:29 PM, ChenQi wrote:
> On 01/15/2014 07:27 PM, krzysztof.m.sywula@intel.com wrote:
>> From: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
>>
>> init-live.sh: $CMDLINE variable should be provided to switch_root
>> to let user specify runlevel on grub command line.
>> Feeding with -c /dev/console as well as busybox switch_root enables 
>> that option.
>>
>> Signed-off-by: Krzysztof Sywula <krzysztof.m.sywula@intel.com>
>> ---
>>   meta/recipes-core/initrdscripts/files/init-live.sh | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh 
>> b/meta/recipes-core/initrdscripts/files/init-live.sh
>> index bd259b9..7e27f91 100644
>> --- a/meta/recipes-core/initrdscripts/files/init-live.sh
>> +++ b/meta/recipes-core/initrdscripts/files/init-live.sh
>> @@ -89,7 +89,10 @@ boot_live_root() {
>>       mount -n --move /dev ${ROOT_MOUNT}/dev
>>         cd $ROOT_MOUNT
>> -    exec switch_root $ROOT_MOUNT /sbin/init
>> +
>> +    # busybox switch_root supports -c option
>> +    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
>> +        fatal "Couldn't switch_root, dropping to shell"
>>   }
>>     fatal() {
>
> I once sent out a patch to remove the '-c /dev/console' because this 
> is busybox specific.
> What if util-linux gets installed in the initramfs?
>
> Could you please state what the benefit is with this option? Maybe in 
> the comment?
> The disadvantage is obvious, because if you have util-linux in 
> initramfs, the 'switch_root' command doesn't support that option, and 
> the 'switch_root' command would always fail.
>
> Best Regards,
> Chen Qi

ping


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

end of thread, other threads:[~2014-06-13  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 11:27 [PATCH] initrdscripts: add $CMDLINE to init-live switch_root krzysztof.m.sywula
2014-01-15 11:33 ` Otavio Salvador
2014-05-15  6:29 ` ChenQi
2014-06-13  3:32   ` ChenQi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox