udhcpc default.script fails in LXC container due to missing /sys
Because /sys is not mounted in the container, the network scripts fail for dhcp. The following patch resolves the issue:
--- /usr/share/udhcpc/default.script.orig
+++ /usr/share/udhcpc/default.script
@@ -39,7 +39,7 @@
}
if_index() {
- cat /sys/class/net/$interface/ifindex
+ cat /sys/class/net/$interface/ifindex || echo 0
}
calc_metric() {
(from redmine: issue id 1715, created on 2013-03-23, closed on 2013-04-12)
- Changesets:
- Revision 9db0e7b7 by Natanael Copa on 2013-03-23T22:17:19Z:
main/busybox-initscripts: udhcpc: find the interface even if we dont have /sys
Needed for LXC
fixes #1715
(cherry picked from commit 09154e4efec109021467a887002f24447305c51c)
- Revision 33a46311 by Natanael Copa on 2013-11-21T14:13:55Z:
main/busybox-initscripts: udhcpc: find the interface even if we dont have /sys
Needed for LXC
fixes #1715
(cherry picked from commit 09154e4efec109021467a887002f24447305c51c)
(cherry picked from commit 9db0e7b79b4abb2ce52b122f0b6d4dd21d4794ed)
Conflicts:
main/busybox-initscripts/APKBUILD