Commit Graph

331 Commits

Author SHA1 Message Date
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
Michael Shigorin
f2535c70c8 20150310-alt1
- cdrom.c, disk.c: poke lazy udev to do its job while waiting for disk
  (#30315 again)
2015-03-10 01:28:38 +03:00
Michael Shigorin
ce7dbcef2b cdrom.c, disk.c: poke lazy udev to do its job
See also https://bugzilla.altlinux.org/30315
2015-03-10 01:28:21 +03:00
Michael Shigorin
22183d47a8 20150306-alt1
- cdrom.c: fix pointer arithmetics (ldv@)
2015-03-06 21:39:20 +03:00
Michael Shigorin
c011d5e337 cdrom.c: fix pointer arithmetics (ldv@)
p happened to be off-by-const (5) thus pointing
way after the end of the string; looks like an
assembly-level overoptimization with two concurrent
thoughts or more...

Thanks ldv@ for figuring this out.

See also https://bugzilla.altlinux.org/28289
2015-03-06 21:38:21 +03:00
Michael Shigorin
e206e2431f disk.c: further tweak the "choose drive" message 2015-03-04 12:15:19 +03:00
Michael Shigorin
d2f9abab39 20150227-alt1
- cdrom.c: minor fixup for "1, 2, 1 seconds" visual effect
- disk.c: slightly better "help me find my media" message
- probing.c: ensure sd_mod along with usb_storage
2015-02-27 01:47:23 +03:00
Michael Shigorin
ad2eef8cf7 probing.c: ensure sd_mod as well
There were cases when usb_storage and its dependencies
would be the only ones popping up in /proc/modules...
2015-02-27 00:48:19 +03:00
Michael Shigorin
3423067e72 disk.c: fix the broken suggestion wording
It was pidgin engrish in the first place and quite unhelpful
along the most common error path (lost race against boot media
leading to a moot offer to choose some fixed disk partition).
2015-02-27 00:48:04 +03:00
Michael Shigorin
f1244e8c76 cdrom.c: remove_wait_message() properly
...or a funny intermittent effect of "Waiting for 1 -> 2 -> 1 seconds"
within that window might appear.
2015-02-26 20:09:28 +03:00
Michael Shigorin
98cd251baf 20141217-alt1
- ldv@'s workaround for media detection race condition (closes: #30315)
2014-12-17 22:24:21 +03:00
542567af7b cdrom.c: workaround race conditions during media detection (ALT#30315) 2014-12-17 22:24:12 +03:00
Michael Shigorin
a1a557fa6f 20140815-alt1
- drop /proc/sys/kernel/hotplug check (OBSOLETE)
2014-08-16 04:37:24 +04:00
Michael Shigorin
592b6794c0 init.c: drop /proc/sys/kernel/hotplug check
The hotplug helper /sbin/hotplug is now officially deprecated.
The control file /proc/sys/kernel/hotplug has moved to
/sys/kernel/uevent_helper, but it is expected to be disabled
on most systems in favor of udev and the netlink interface.
	-- http://lwn.net/Articles/166954/ (2006)
2014-08-16 04:36:28 +04:00
Michael Shigorin
59a8301023 20140423-alt1
- digest check refactoring (ldv@)
2014-04-23 01:55:39 +04:00
3d63eecb8d tools.c: refactored verify_ramdisk_digest()
This consists of several changes at once:
- purged unneccessary variables;
- fixed variable and function types;
- more readable return values;
- improved error logging;
- optimized hash printout just in case.

The original version of this patch fixed an off-by-one
issue too (it's been committed separately now).
2014-04-23 01:45:56 +04:00
Michael Shigorin
f9326392c4 20140419-alt1
- initial stage2 digest check
2014-04-22 18:32:07 +04:00
Michael Shigorin
f3fe4de580 tools.c: fix off-by-one
Trailing \0 has to go somewhere; thanks ldv@ for the hint.
2014-04-22 18:32:07 +04:00
Michael Shigorin
c51df4c834 cdrom.c: slightly better "wrong hash" message
This should be marginally more readable.
2014-04-19 13:05:43 +04:00
Michael Shigorin
8d2cd5aec8 initial verify_ramdisk_digest()
This is a patch by Maxim Suhanov <suhanov/group-ib.ru>
aiming to provide integrity and authenticity check for
stage2 rootfs image when required:

- media bootloader passes sha256 hash of stage2 image;
- stage1 early userspace code (that is, propagator)
  checks the candidate files against that during search;
- existing file with different checksum results in a warning
  with a dialog to just say NO, continue searching for the
  proper squashfs image and have a look at that weird one;
- existing file with correct checksum results in booting
  as usual.

The check is triggered by "hash=..." kernel boot parameter.

See also http://www.forensicswiki.org/wiki/Forensic_Live_CD_issues
2014-04-19 12:49:58 +04:00
Michael Shigorin
6080f294e4 added SHA256 implementation (GPLv2+) 2014-04-19 12:49:48 +04:00