Commit Graph

351 Commits

Author SHA1 Message Date
0d3ff4dabd 20190418-alt1
- compile with _FILE_OFFSET_BITS=64
2019-04-18 12:00:06 +03:00
Leonid Krivoshein
b4917948fe 20181117-alt1
- probing.c: added support for SD-cards when boot in LiveCD-mode
2018-11-17 22:53:22 +03:00
Evgeny Sinelnikov
a352e62521 20180822-alt1
- add support cifs install method
- replace HTTP request version from 1.0 to 1.1
- increase DHCP tries and timeouts for DISCOVER request
2018-08-22 20:11:28 +04:00
Evgeny Sinelnikov
59a9c4de30 add support of cifs network install method 2018-08-22 20:08:23 +04:00
Evgeny Sinelnikov
95bfcf8542 replace HTTP request version to 1.1 2018-08-22 20:08:23 +04:00
Evgeny Sinelnikov
8c1beeb584 DHCP: fixed timeout for DISCOVER request 2018-08-22 20:08:23 +04:00
Arseny Maslennikov
41bb05e67e 20180606-alt1
- dhcp.c: Remove temporary default route properly (altbug:#34347).
- dhcp.c: Provide DHCP vendor class identifier in requests (altbug:#34320).
  This behaviour can be reverted with a kernel command line parameter.
2018-06-09 18:32:06 +03:00
Arseny Maslennikov
6ce39ab483 dhcp.c: Remove temporary default route properly
DHCP is implemented in propagator in a rather lazy way:
to dynamically configure a network interface, say `eno1',
instead of slinging raw Ethernet frames around like everyone else,
it sets up a (temporary) default null route through that interface
and throws UDP messages with actual bootp payload.

`ip' utility describes such a route as `default dev eno1 scope link'

The idea behind this presumably was to avoid generating IP and UDP
headers manually while the null route is sufficient to send a couple of
link-wide (maybe broadcast) messages and generic enough to work anywhere.

To this date propagator didn't bother to remove that route,
so *in some networks* it had persisted even after the initramfs
(and propagator itself) was long gone, and in other networks did not,
having been luckily replaced by the default route to DHCP gateway.

In the cases where it did the real problem showed itself
after the real userspace (for example, in a live distro)
eventually tried to reconfigure the network (because why not?).
The pesky null route was most often left untouched by the DHCP client
(ALT live distros mostly use dhcpcd), managing to squeeze its way
up the routing table and effectively preventing the host
from network access beyond a router.

If the NFS root is behind a couple routers, any attempt to access
the file system gets stuck — the system keeps tirelessly looking for
the NFS host via ARP.
2018-06-09 18:27:06 +03:00
Arseny Maslennikov
dfa3713d0f dhcp.c: Provide an option to omit the vendor class
Some obsolete DHCP implementations in specialized network hardware
(Cisco, we're looking at you) discard DHCP messages from a client
attempting to reconfigure itself and providing a different vendor class
identifier the second time — much like a network-booting system.

To cope with that, propagator will not send a vendor class identifier
if `dhcp-send-vendor-id:off' is specified as part of its "automatic"
parameters on the kernel command line.
Feel free to use any boolean value: yes/no, true/false, on/off.
The default behaviour is "yes".
2018-06-09 18:27:00 +03:00
Arseny Maslennikov
41519b564d dhcp.c: Provide a DHCP vendor class identifier in requests 2018-06-06 23:40:28 +03:00
Arseny Maslennikov
2440a17fbe Remove unnecessary whitespace from C program text 2018-05-09 15:21:26 +03:00
Leonid Krivoshein
bb48084aa0 20180423-alt1
- New udev control logic imported from make-initrd scripts.
- Udev-trigger replaced to udev-settle() in hardware wait loops.
- All udev control code moved from init.c to new udev.c module.
- Lazy initialization mode support added for work in cooperate
  with make-initrd: this is experimental future, turned off by
  default, and also required patched make-initrd-propagator.
- disk.c, cdrom.c: 15 attempts with udev-settle() calls.
- network.c: bridge up algorithm reviewed, fixed memory leaks.
- network.c: 15 attempts to select and wait network interface;
- probing.c, probing.h, dhcp.c: small fixes, now black list used.
- modules_descr.h, stage1.c: deprecated header, unused code removed.
- dhcp.c: fix potentially destructive typo (closes: #34322),
  thanks to Arseny Maslennikov <arseny@altlinux.org>.
- Workaround race conditions during disks detection (closes: #30315).
- Workaround race conditions during bridging up network interfaces,
  see: https://bugzilla.altlinux.org/show_bug.cgi?id=34347 and
  https://lists.altlinux.org/pipermail/sysadmins/2018-April/date.html
  (about "No network Devices found" error message).
- Multiple small code improvements, fixes for avoid memory leaks
  and suppress compiler warnings.
2018-04-23 01:23:23 +03:00
Leonid Krivoshein
8c4366e9c6 network.c: protect from buffer overflow.
This change also suppress a compiler warning:

network.c:307:18: warning: '%d' directive writing between
1 and 11 bytes into a region of size 3 [-Wformat-overflow=]
2018-04-22 20:27:51 +03:00
Leonid Krivoshein
870d181ace mount.c: header added for suppress warning. 2018-04-22 20:14:14 +03:00
Leonid Krivoshein
d2866d5d21 dhcp.c: suppress warning in rfc951_sleep(). 2018-04-22 19:26:01 +03:00
Leonid Krivoshein
6afa449e2e dhcp.c: fix potentially destructive typo.
Thanks to Arseny Maslennikov <arseny@altlinux.org>.
See also: https://bugzilla.altlinux.org/show_bug.cgi?id=34322
2018-04-22 19:20:44 +03:00
Leonid Krivoshein
547debb59b newt-frontend.c: suppress incompatible pointer type warning. 2018-04-22 18:34:27 +03:00
Leonid Krivoshein
70bd62ff84 Makefile, init.c, init.h: multiple changes in code and algorithms.
- New udev control logic imported from make-initrd scripts;
- Udev-trigger replaced to udev-settle() in hardware wait loops;
- All udev control code moved from init.c to new udev.c module;
- Lazy initialization mode support added for work in cooperate
  with make-initrd: this is experimental future, turned off by
  default, and also required patched make-initrd-propagator;
- Small fixes for suppress compiler warnings;
2018-04-22 17:43:47 +03:00
Leonid Krivoshein
416b43d012 network.c: bridge up algorithm reviewed, fixed memory leaks.
+ network.c/interface_select():
  - "No network device found." message moved to intf_select_and_up();
  - This function now is only one attempt with udev-settle() call;
  - Fixed memory leaks;
+ network.c/intf_select_and_up():
  - "No network device found." error messege now here;
  - 15 attempts to select and wait network interface;
  - Recursion replaced to loop;
2018-04-22 17:19:55 +03:00
Leonid Krivoshein
28515312fd disk.c, cdrom.c: 15 attempts with udev-settle() calls. 2018-04-22 17:07:12 +03:00
Leonid Krivoshein
da2111e239 init.c, disk.c, cdrom.c, network.c: whitespace cleanup. 2018-04-22 17:06:01 +03:00
Leonid Krivoshein
485839e4cc probing.c, probing.h, dhcp.c: code fixes, use black list.
+ probing.h/free_net_devices():
  - New function declared;
+ probing.c/free_net_devices():
  - Reverse for get_net_devices() to avoid memory leaks;
+ probing.c/net_dev_black_list:
  - Wireless interfaces "wlan*" added to black list;
+ dhcp.c/perform_dhcp():
  - No more restrict by interface name;
2018-04-22 15:48:10 +03:00
Leonid Krivoshein
da664f7f9e tools.c, tools.h: correct argument type of get_from_env().
This change also suppress compiler warnings.
2018-04-22 15:35:37 +03:00
Leonid Krivoshein
a73ab0446a common.c: more strict address ariphmetic. 2018-04-22 15:31:04 +03:00
Leonid Krivoshein
08aefa7dde udev.c, udev.h: new source files added. 2018-04-22 15:25:16 +03:00
Leonid Krivoshein
5f0d958d1e stage1.c: unused code removed for suppress warning. 2018-04-22 15:17:43 +03:00
Leonid Krivoshein
c22c8f7c72 modules_descr.h: deprecated header removed. 2018-04-22 15:15:09 +03:00
Mikhail Efremov
190f7a826c 20171208-alt1
- probing.c: added support for MMC devices when boot in LiveCD-mode
  (by Leonid Krivoshein).
- cdrom.c: fixed implicit declaration of function opendir warning
  (by Leonid Krivoshein).
- disk.c: Workaround race conditions during disks detection
  (closes: #30315).
- cdrom.c, network.c, tools.c: Fix memory leaks.
- tools.c: Don't do useless comparisons during cmdline processing.
- Use ramdisk_size from kernel cmdline.
- Check that RAM size is enough for ramdisk.
2017-12-08 19:24:09 +03:00
Leonid Krivoshein
0cbc6e7994 probing.c: added support for MMC devices when boot in LiveCD-mode 2017-12-08 16:54:52 +03:00
Leonid Krivoshein
c4d274d21a cdrom.c: fixed implicit declaration of function opendir warning 2017-12-08 16:54:48 +03:00
Mikhail Efremov
a084159547 disk.c: Workaround race conditions during disks detection
https://bugzilla.altlinux.org/show_bug.cgi?id=30315.
2017-12-08 16:54:37 +03:00
Mikhail Efremov
68ad717ec3 cdrom.c, network.c, tools.c: Fix memory leaks 2017-12-08 16:18:56 +03:00
Mikhail Efremov
cca0e7faa9 tools.c: Don't do useless comparisons during cmdline processing 2017-12-08 16:18:47 +03:00
Mikhail Efremov
ee71c69502 Use ramdisk_size from kernel cmdline
If we can't get file's size then use ramdisk_size if given.
2017-12-08 16:18:37 +03:00
Mikhail Efremov
7f50a883ac Check that RAM size is enough for ramdisk
Don't try to load ramdisk we don't have enough memory.
2017-12-08 16:18:37 +03:00
Gleb Fotengauer-Malinovskiy
a9374f376e 20170511-alt1
- Fixed errors found by cppcheck.
2017-05-11 19:09:46 +03:00
Gleb Fotengauer-Malinovskiy
c96ab958b2 Fix errors found by cppcheck
[disk.c:206]: (error) Resource leak: f
[modules.c:62]: (error) Memory leak: buffer
[modules.c:68]: (error) Common realloc mistake: 'buffer' nulled but not freed upon failure
[stage1.c:101]: (error) va_list 'args' was opened but not closed by va_end().
[url.c:297]: (error) Resource leak: dataSocket
2017-05-11 19:09:46 +03:00
Michael Shigorin
e88e097f15 20170318-alt1
- tools.c: why on Earth make *that* a nested function??
2017-03-18 22:49:28 +03:00
Michael Shigorin
5ac5f51125 tools.c: get rid of a useless nested function
I don't understand who and why did that in the first place; undo it.
2017-03-18 22:49:14 +03:00
Michael Shigorin
1dcfd5ccb7 20161226-alt1
- probing.c: bump max disk number from 50 to 250 (closes: #32934)
2016-12-26 14:48:14 +03:00
Michael Shigorin
470ad34dd4 probing.c: bump max disk number from 50 to 250
This limit has become problematic with 60 drives apparently;
let's hope 250 is enough for some time...

Fixes: https://bugzilla.altlinux.org/32934
2016-12-26 14:46:54 +03:00
Michael Shigorin
ee79cfe0d3 20161024-alt2
- disk.c: retry uuid/label based autodetection upon a pause
  if the first attempt has failed (e.g. flash not ready yet)
2016-10-24 21:44:37 +03:00
Michael Shigorin
0547f60638 disk.c: added kludge against premature failure
This hardcoded pause is ugly indeed but forcing users
into wondering what goes on behind bootsplash *sometimes*
(depending on usbflash controller type *and* state) is worse.

Any ideas on reliably fixing this are welcome, of course.

See also http://bugzilla.altlinux.org/30315
2016-10-24 21:39:22 +03:00
Michael Shigorin
1e5703a8a8 20161024-alt1
- probing.c: load uas module too
2016-10-24 20:54:00 +03:00
Michael Shigorin
e5af5f5ae5 probing.c: insmod uas too
It's "USB Attached SCSI" for fast USB3 Flash media.
2016-10-24 20:52:35 +03:00
Michael Shigorin
a7da388c7f 20160516-alt1
- use spawn to run udevadm (legion@; see also #32068)
2016-05-20 19:25:31 +03:00
Alexey Gladkov
bc936fd7c2 Use spawn to run udevadm
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
2016-05-16 18:57:12 +02:00
Michael Shigorin
35bf95867a 20151103-alt1
- modules.c: silence modprobe (some could be compiled in at times)
2015-11-03 21:32:22 +03:00
Michael Shigorin
0d0a892aa3 modules.c: silence modprobe
Some modules can be compiled in, no need to complain then.
2015-11-03 21:32:07 +03:00
Michael Shigorin
fd2cfbeea0 cdrom.c, network.c: tweak messages
No code changes, just slightly better strings.
2015-03-27 10:41:24 +03:00