I have an embedded system running a 3.10.9 kernel with 12.04.5 Ubuntu. Due to the many security vulnerabilities that now exist with the older Ubuntu OS, I am trying to upgrade either the Ubuntu OS or both the Ubuntu OS and the kernel. I have been able to update and upgrade the system in place but the solution needs to be packaged so that I can use it with a flashing server.
The current flashing process consists of a PEEDI that programs a custom boot loader into the device's eMMC. After the device is rebooted it searches and connects to the TFTP server, mounts the network driver from the NFS server and downloads the binary images for the uboot, kernel, dtb file, and rootfs. It then flashes the images into the eMMC. This process works with a 3.10.9 kernel and 12.04.5 Ubuntu OS.
We know that there are four major components to the embedded system:
1) dtb
2) u-boot image
3) kernel
4) root files system
My initial thought was to try simply replacing the file system and leave all other components untouched, if possible. This seems like it could work and why compile a new kernel and dtb if not necessary?
- Note: None of the original source code has been retained for this project *
First I tried updating and upgrading the device in-place by going to ports.ubuntu and then tarring up the working filesystem. The resulting 14.04.5 LTS filesystem is then placed on the TFTP server and used in the flashing process (none of the other components listed above are touched). After completing the flashing process and rebooting the device, the device is seemingly functional and running Ubuntu 14.04.5 LTS. The first thing that I noticed is off is the network interfaces - before the filesystem upgrade, I had eth0 and wlan0. After the upgrade, I now have eth1 and wlan1. In general this doesn't seem like a huge issue but I have application software that depends on these interfaces being consistent so this won't work. Furthermore, I don't really know the extent of the problem.
eth1 Link encap:Ethernet HWaddr d8:b8:f6:01:00:3d
inet addr:10.1.134.22 Bcast:10.1.134.255 Mask:255.255.255.0
inet6 addr: fe80::dab8:f6ff:fe01:3d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:77 errors:0 dropped:0 overruns:0 frame:0
TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9868 (9.8 KB) TX bytes:8537 (8.5 KB)
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:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1296 (1.2 KB) TX bytes:1296 (1.2 KB)
wlan1 Link encap:Ethernet HWaddr 88:33:14:1c:6e:61
inet6 addr: fe80::8a33:14ff:fe1c:6e61/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1808 (1.8 KB) TX bytes:2196 (2.1 KB)
eth1 will function when configured but I cannot get wlan1 to connect.
root@device-01036e:~# ifup wlan1
Internet Systems Consortium DHCP Client 4.2.4
Copyright 2004-2012 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan1/88:33:14:1c:6e:61
Sending on LPF/wlan1/88:33:14:1c:6e:61
Sending on Socket/fallback
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 2 (xid=0xaceefe56)
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 5 (xid=0xaceefe56)
DHCPDISCOVER on wlan1 to 255.255.255.255 port 67 interval 4 (xid=0xaceefe56)
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
Next I tried pulling down the kernel source from https://cdn.kernel.org/pub/linux/kernel/v4.x/ and compiling it with the default config.
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
The new kernel was then placed on the flashing server along with the 14.04.5 tarred OS and flashed onto the device. This device boots up and shows the expected kernel and OS versions but the network interfaces aren't working properly, specifically wlan.
sudo ifconfig wlan0 up
wlan0: ERROR while getting interface flags: No such device
Questions:
1) Does the DTS/ DTB need to be updated if a new kernel is compiled (hardware is unchanged) ?
2) What caused the interfaces to stop functioning properly?
3) What is the easiest way to produce an upgraded filesystem given the mentioned flashing setup? Is it possible to do this without touching the other components?
http://askubuntu.com/questions/689070/network-interface-name-changes-after-update-to-15-10-udev-changes After reading the posts and comments for this question I removed the /etc/udev/rules.d/70-persistent-net file. After rebooting the device, the interface names were as expected - eth0 and wlan0 and I was able to bring up wlan0 after configuring the interfaces file appropriately.
I suspect that the hardware addresses were incorrect in this file since the filesystem was created from a different device.
– Kristina Jan 16 '17 at 17:53