Bug 5636

Summary: No IP address for eth0 on qemu at the first boot
Product: [Build System, Metadata & Runtime] BSPs Reporter: Yi Zhao <yi.zhao>
Component: bsps-toolsAssignee: Tom Zanussi <tom.zanussi>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: ionutx.chisanovici, jessica.zhang, ke.zou, tom.zanussi
Version: 1.6   
Target Milestone: 1.6 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yi Zhao 2013-12-06 07:55:38 UTC
Git rev: master/c51730aaa91066cfb51ad6ec2920fb4f9d9ea94c

Steps:
1. Set the poky environment:
   source oe-init-build-env build-test
2. Use yocto-bsp to create a x86 qemu layer by using all default value:
   yocto-bsp create myqemux86 qemu
3. Modify conf/bblayers.conf and conf/local.conf. Build the image:
   bitbake core-image-sato
4. Boot up the qemu image:
   runqemu qemux86 tmp/deploy/images/myqemux86/bzImage-myqemux86.bin tmp/deploy/images/myqemux86/core-image-sato-myqemux86.ext3 nographic

At the *first* boot, no ip address for the eth0 network interface:
###########################
root@myqemux86:~# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1563 (1.5 KiB)  TX bytes:2651 (2.5 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@myqemux86:~#  
#############################

But when after rebooting the system, the eth0 ip address is set:
############################
root@myqemux86:~# ifconfig 
eth0      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:192.168.7.2  Bcast:192.168.7.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2003 (1.9 KiB)  TX bytes:6330 (6.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
#############################
   
This is a regression bug since it works correctly in Yocto 1.5 .
Comment 1 Tom Zanussi 2013-12-06 14:18:44 UTC
I'll take this but it will probably be covered by Bug 5495 - yocto-bsp 1.6 upgrade and automation enhancements.
Comment 2 Tom Zanussi 2013-12-16 03:48:07 UTC
This is caused by the fix for bug 5513:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=5513

Reverting the below commit causes the problem to disappear:

commit dc80eea725906f394469b867edc1a8c72be87ad8
Author: Chen Qi <qi.chen@windriver.com>
Date:   Mon Nov 11 17:26:09 2013 +0800

    sysvinit: fix problem in switching runlevels
Comment 3 Tom Zanussi 2013-12-20 15:37:12 UTC
Patch sent to poky list.
Comment 4 Tom Zanussi 2013-12-20 19:31:18 UTC
Fixed in poky/master: 08a8c90e95841764b8b14a3b6ef0f671b4fa4154
Comment 5 Ionut Chisanovici 2013-12-23 10:40:08 UTC
Hi,

This was verified with master:005af45191ded6185c618c708181b31281e43092 and the issue is fixed.

Cheers,
Ionut