diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-05-23 18:43:11 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-05-23 18:43:11 +0200 |
commit | 7569d2dc1122e5b01cfb5b2ade1431dc01fcfae6 (patch) | |
tree | 6845e89f8a69e12ff6e28ddc74bdb8af12849712 | |
parent | 158728fbc6d3813059c12bcbeab64f681c38df2f (diff) | |
download | alpine_aports-7569d2dc1122e5b01cfb5b2ade1431dc01fcfae6.tar.bz2 alpine_aports-7569d2dc1122e5b01cfb5b2ade1431dc01fcfae6.tar.xz alpine_aports-7569d2dc1122e5b01cfb5b2ade1431dc01fcfae6.zip |
main/busybox: let udhcpc background if there are no lease
We need to prevent ifup get stuck forever if there are no lease so we
add -b to udhcp opts.
To give users a way to disable this, we patch udhcpc to only respect -b
flag if -n is not given.
-rw-r--r-- | main/busybox/APKBUILD | 6 | ||||
-rw-r--r-- | main/busybox/busyboxconfig | 2 | ||||
-rw-r--r-- | main/busybox/udhcpc.patch | 36 |
3 files changed, 41 insertions, 3 deletions
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD index 10fc261e48..a636bee1f1 100644 --- a/main/busybox/APKBUILD +++ b/main/busybox/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 2 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
3 | pkgname=busybox | 3 | pkgname=busybox |
4 | pkgver=1.26.2 | 4 | pkgver=1.26.2 |
5 | pkgrel=3 | 5 | pkgrel=4 |
6 | pkgdesc="Size optimized toolbox of many common UNIX utilities" | 6 | pkgdesc="Size optimized toolbox of many common UNIX utilities" |
7 | url=http://busybox.net | 7 | url=http://busybox.net |
8 | arch="all" | 8 | arch="all" |
@@ -31,6 +31,7 @@ source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2 | |||
31 | 0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch | 31 | 0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch |
32 | 0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch | 32 | 0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch |
33 | 0015-syslogd-adjust-timezone-option.patch | 33 | 0015-syslogd-adjust-timezone-option.patch |
34 | udhcpc.patch | ||
34 | 35 | ||
35 | fix-tests.patch | 36 | fix-tests.patch |
36 | location-for-cpio.patch | 37 | location-for-cpio.patch |
@@ -164,10 +165,11 @@ f82caa1dc4395f266b024a7face267a916a80ead95f3d392b10fd397d0fdf62703e3078357bc7196 | |||
164 | bf3e7c400e718fbc19fda19d7304ed938e5c59f45d5d1ba6eafd8f62a984d40419dbefd9f6840ac7f220d00abfae67e8f31be78b4c2e25310b265bca8beb91a2 0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch | 165 | bf3e7c400e718fbc19fda19d7304ed938e5c59f45d5d1ba6eafd8f62a984d40419dbefd9f6840ac7f220d00abfae67e8f31be78b4c2e25310b265bca8beb91a2 0013-ash-make-shellexec-capable-of-using-separate-argv-0-.patch |
165 | cb7aa4d5d22596bc8c6510cb653599dd8cf4c3a5312e93adfc6411d811376db2ad3b506a111322f46aa9929a5337e22a169da4ea250fd4b39e703adbc8792a2d 0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch | 166 | cb7aa4d5d22596bc8c6510cb653599dd8cf4c3a5312e93adfc6411d811376db2ad3b506a111322f46aa9929a5337e22a169da4ea250fd4b39e703adbc8792a2d 0014-ash-implement-exec-a-ARGV0-CMD-ARGV1.patch |
166 | c37d1583cfb32e7aa077e7f4ea121dd3b2e3cf989a3dca2793126bcd89eb6d8eb6fae948085565807c2fb98d8dc92a2907cc03d988d1a47305d3e588ac268c5b 0015-syslogd-adjust-timezone-option.patch | 167 | c37d1583cfb32e7aa077e7f4ea121dd3b2e3cf989a3dca2793126bcd89eb6d8eb6fae948085565807c2fb98d8dc92a2907cc03d988d1a47305d3e588ac268c5b 0015-syslogd-adjust-timezone-option.patch |
168 | 1375aa41038d80ef21ac3cd239999f813fd9a2e5ec062f34ed221d75e312f5e17e4bfcac4b20450139059dd586cfeda2b10c02b9cc17416c828e9a1ea3421601 udhcpc.patch | ||
167 | 2adfc6c71cfcc5df12edef13228c92b34c7782615e60effc97e6e7a9aa7e015c24c7b3950a8a9a2bf3ba5efd43a08ad45b16b35b03c90275807380e0600cb70d fix-tests.patch | 169 | 2adfc6c71cfcc5df12edef13228c92b34c7782615e60effc97e6e7a9aa7e015c24c7b3950a8a9a2bf3ba5efd43a08ad45b16b35b03c90275807380e0600cb70d fix-tests.patch |
168 | f26e090f5de0096ba5c4d46989ebe0ab5fa64c8bf54cd37ddec302fddfde23eac914858d86cc52bf3b5780a8e81ea2612ef6e713df2828e52c606f86a6816f39 location-for-cpio.patch | 170 | f26e090f5de0096ba5c4d46989ebe0ab5fa64c8bf54cd37ddec302fddfde23eac914858d86cc52bf3b5780a8e81ea2612ef6e713df2828e52c606f86a6816f39 location-for-cpio.patch |
169 | a9b1403c844c51934637215307dd9e2adb9458921047acff0d86dcf229b6e0027f4b2c6cdaa25a58407aad9d098fb5685d58eb5ff8d2aa3de4912cdea21fe54c acpid.logrotate | 171 | a9b1403c844c51934637215307dd9e2adb9458921047acff0d86dcf229b6e0027f4b2c6cdaa25a58407aad9d098fb5685d58eb5ff8d2aa3de4912cdea21fe54c acpid.logrotate |
170 | d4b9f4a09dcf08ec9f7a66c5250465e3a6dd9beb15140a462a1464110824426c732399e4dab4e6a33073626d4db0e76085b218cd0521027e57ce9f918ff1af29 busyboxconfig | 172 | 43e5b1c699fffea4e41621faee8b3d28774e5888070113ae98a940c6837efec617bac7c78c34a2c982cbcccf25a67691c480be8ba4b8e552eed8bb0d3a09dac8 busyboxconfig |
171 | c1dd56509277c59751907a27f067f1622191ddfd498acfe390d83136d36a41f2bdfc2fd4daf35af77219a66fb00fea20483f34112afd5df2ccd9f36ab548e66f bbsuid.c | 173 | c1dd56509277c59751907a27f067f1622191ddfd498acfe390d83136d36a41f2bdfc2fd4daf35af77219a66fb00fea20483f34112afd5df2ccd9f36ab548e66f bbsuid.c |
172 | a1127c8a384294135e11500fde7ead33b73d24b11c21911b08447a4c4ef71d7a9965d6466f60f2da64e3b877213b0a3e924a5add3c5333ee3ecde8c2a91c5e02 dad.if-up | 174 | a1127c8a384294135e11500fde7ead33b73d24b11c21911b08447a4c4ef71d7a9965d6466f60f2da64e3b877213b0a3e924a5add3c5333ee3ecde8c2a91c5e02 dad.if-up |
173 | 4e7c291a70e879b74c0fc07c54a73ef50537d8be68fee6b2d409425c07afd2d67f9b6afcd8c33a7971014913cc5de85e45079681c9e77200c6cc2f34acfba6d2 nologin.c" | 175 | 4e7c291a70e879b74c0fc07c54a73ef50537d8be68fee6b2d409425c07afd2d67f9b6afcd8c33a7971014913cc5de85e45079681c9e77200c6cc2f34acfba6d2 nologin.c" |
diff --git a/main/busybox/busyboxconfig b/main/busybox/busyboxconfig index a08b4f5d7c..20c5ed73d8 100644 --- a/main/busybox/busyboxconfig +++ b/main/busybox/busyboxconfig | |||
@@ -934,7 +934,7 @@ CONFIG_FEATURE_UDHCP_RFC3397=y | |||
934 | CONFIG_FEATURE_UDHCP_8021Q=y | 934 | CONFIG_FEATURE_UDHCP_8021Q=y |
935 | CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" | 935 | CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" |
936 | CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 | 936 | CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 |
937 | CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="" | 937 | CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-b" |
938 | 938 | ||
939 | # | 939 | # |
940 | # Print Utilities | 940 | # Print Utilities |
diff --git a/main/busybox/udhcpc.patch b/main/busybox/udhcpc.patch new file mode 100644 index 0000000000..baf7c6138e --- /dev/null +++ b/main/busybox/udhcpc.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | udhcpc: Don't background if -n is given | ||
2 | |||
3 | we need add -b to our udhcpc options to prevent boot forever if there are no | ||
4 | dhcp server. We also need a way for users to disable this behavior by making | ||
5 | it possible to set -n option at runtime. | ||
6 | |||
7 | diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c | ||
8 | index 6aa6731fb..2c0307413 100644 | ||
9 | --- a/networking/udhcp/dhcpc.c | ||
10 | +++ b/networking/udhcp/dhcpc.c | ||
11 | @@ -1504,19 +1504,19 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
12 | } | ||
13 | leasefail: | ||
14 | udhcp_run_script(NULL, "leasefail"); | ||
15 | + if (opt & OPT_n) { /* abort if no lease */ | ||
16 | + bb_error_msg("no lease, failing"); | ||
17 | + retval = 1; | ||
18 | + goto ret; | ||
19 | + } | ||
20 | #if BB_MMU /* -b is not supported on NOMMU */ | ||
21 | if (opt & OPT_b) { /* background if no lease */ | ||
22 | bb_error_msg("no lease, forking to background"); | ||
23 | client_background(); | ||
24 | /* do not background again! */ | ||
25 | opt = ((opt & ~OPT_b) | OPT_f); | ||
26 | - } else | ||
27 | -#endif | ||
28 | - if (opt & OPT_n) { /* abort if no lease */ | ||
29 | - bb_error_msg("no lease, failing"); | ||
30 | - retval = 1; | ||
31 | - goto ret; | ||
32 | } | ||
33 | +#endif | ||
34 | /* wait before trying again */ | ||
35 | timeout = tryagain_timeout; | ||
36 | packet_num = 0; | ||