Commit Graph

2257 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen 3f86ec6544 Default to installing GRUB if an existing installation uses GRUB. 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 84c0844f56 Seed kernel entropy with randomness from the previous boot.
The bootloader will now load the /boot/random.seed file if it exists, in
which case the kernel will use it as the initial kernel entropy. The kernel
warns if no random seed was loaded, unless the --no-random-seed option was
given. This option is used for live environments that inherently have no
prior secret state. The kernel initializes its entropy pool from the random
seed as of the first things, so randomness is available very early on.

init(8) will emit a fresh /boot/random.seed file on boot to avoid the same
entropy being used twice. init(8) also writes out /boot/random.seed on
system shutdown where the system has the most entropy. init(8) will warn if
writing the file fails, except if /boot is a real-only filesystem, and
keeping such state is impossible. The system administrator is then
responsible for ensuring the bootloader somehow passes a fresh random seed
on the next boot.

/boot/random.seed must be owned by the root user and root group and must
have file permissions 600 to avoid unprivileged users can read it. The file
is passed to the kernel by the bootloader as a multiboot module with the
command line --random-seed.

If no random seed is loaded, the kernel attempts a poor quality fallback
where it seeds the kernel arc4random(3) continuously with the current time.
The timing variance may provide some effective entropy. There is no real
kernel entropy gathering yet. The read of the CMOS real time clock is moved
to an early point in the kernel boot, so the current time is available as
fallback entropy.

The kernel access of the random seed module is supposed to be infallible
and happens before the kernel log is set up, but there is not yet a failsafe
API for mapping single pages in the early kernel.

sysupgrade(8) creates /boot/random.seed if it's absent as a temporary
compatibility measure for people upgrading from the 1.0 release. The GRUB
port will need to be upgraded with support for /boot/random.seed in the
10_sortix script. Installation with manual bootloader configuration will
need to load the random seed with the --random-seed command line. With GRUB,
this can be done with: module /boot/random.seed --random-seed
2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 4ab5765a95 Refactor sysmerge(8) and sysupgrade(8) compatibility hooks. 2016-10-04 00:34:50 +02:00
Jonas 'Sortie' Termansen 4d40dd35dd Run the existing sysmerge(8) in the make sysmerge targets.
The ABI may have changed and the current system might not be able to run the
new program.
2016-10-04 00:34:49 +02:00
Jonas 'Sortie' Termansen 1791a19539 Refactor init(8) chain-merge target and add merge target.
The chain-merge target now invokes the /sysmerge init(8) with the merge
target, which now mounts the mountpoints. This change allows having a /boot
partition for the purpose of sysupgrade(8).
2016-10-04 00:34:49 +02:00
Jonas 'Sortie' Termansen 0e4f9a7ab8 Only set resolution in init(8) if not already done. 2016-10-03 21:38:34 +02:00
Jonas 'Sortie' Termansen 6944250bd1 Allow detecting fallback video modes. 2016-10-03 21:38:34 +02:00
Jonas 'Sortie' Termansen 0b07e62259 Refactor init(8) atexit handling. 2016-10-03 21:38:34 +02:00
Jonas 'Sortie' Termansen fdfe16ad30 Document that init(8) mounts the filesystems of fstab(5).
Remove --help and --version in favor of the init(8) manual page.
2016-10-03 21:38:34 +02:00
Jonas 'Sortie' Termansen 67471b55e7 Add nl_langinfo(3). 2016-10-03 20:02:12 +02:00
Jonas 'Sortie' Termansen 601bed32fb Update cp(1) to current coding conventions. 2016-10-03 20:02:12 +02:00
Jonas 'Sortie' Termansen 9f82d3951e Guide cross-development(7) users to development(7). 2016-10-03 20:02:11 +02:00
Jonas 'Sortie' Termansen 6135c5414b Remove UL suffix from BUFSIZ. 2016-10-03 20:02:11 +02:00
Jonas 'Sortie' Termansen a3bc570c1e Remove useless void casts from tr(1). 2016-10-03 20:02:11 +02:00
Jonas 'Sortie' Termansen 057bd25898 Fix newlines in errx(3) calls. 2016-10-03 16:00:00 +02:00
Daniel Roskams 28fec736dc Document passwd(1). 2016-10-03 21:45:58 +08:00
Jonas 'Sortie' Termansen 07b89e600d Fix kernelinfo(1) reallocation loop never terminating. 2016-10-02 13:50:26 +02:00
Daniel Roskams e400e3578e Document kernelinfo(1). 2016-10-02 13:26:04 +02:00
Jonas 'Sortie' Termansen 48c60fd3a2 Fix readlink(1) self-reference. 2016-10-01 21:29:30 +02:00
Jonas 'Sortie' Termansen 0e32284417 Fix 'is can' typo in README. 2016-10-01 14:52:09 +02:00
Ralph Holmes 5d774cce1d Fix execl(3) sentinel undefined behaviour.
execl(3) and its variants use a sentinel to terminate the variadic
argument list, in the form of a null pointer constant of type pointer to
char. POSIX mandates that NULL is a null pointer constant of type
pointer to void, which is not of an equivalent type to that required by
execl(3) and its variants, resulting in undefined behaviour.

This commit casts all such instances of NULL to pointer to char type.
For consistency, it also adds const-qualification to any such instances
which had already been casted, and were not const-qualified.
2016-09-30 23:36:49 +02:00
rocketpenguin1 6907109b7e Add -l option to chkblayout(1). 2016-09-30 17:03:29 +02:00
Nicholas De Nova a911476f59 Add readlink(1). 2016-09-29 20:10:58 -05:00
Jonas 'Sortie' Termansen 1a87b2f580 Add suggestion to use vim(1) if installed. 2016-09-29 00:01:41 +02:00
Jonas 'Sortie' Termansen a97e1ef16c Modernize carray(1) and fix missing allocation checks.
Add short options for most long options. Rename the -i option to -H, but
support -i for compatibility until the next release cycle, where -i will
become the short option of --identifier. Rename --include to --headers
and support --include until the next release cycle.

Add carray(1) manual page which makes --help unnecessary, and remove
--version as it surely matches your local Sortix version.
2016-09-29 00:01:41 +02:00
Jonas 'Sortie' Termansen 848eaaf593 Port build utilities to musl. 2016-09-29 00:01:40 +02:00
Jonas 'Sortie' Termansen 91a6ee7919 Add 24-bit graphics support to kernel. 2016-09-28 20:29:18 +02:00
Jonas 'Sortie' Termansen bc1344dacf Document clock(3) as obsolete. 2016-09-28 20:29:17 +02:00
Jonas 'Sortie' Termansen c8487ff12b Fix readlinkat(2) return value truncation. 2016-09-28 20:15:36 +02:00
Jonas 'Sortie' Termansen 394d3d7115 Fix kernel not using BRAND_DEFAULT_HOSTNAME. 2016-09-28 20:15:36 +02:00
Nicholas De Nova 6e16a2036e Add tee(1). 2016-09-25 20:07:27 -05:00
Jonas 'Sortie' Termansen 0756a7ee96 Add scanf(3) %n support. 2016-09-25 22:28:18 +02:00
Jonas 'Sortie' Termansen 0e78aec1c3 Fix console scrolling bottleneck. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 4f60e65f83 Fix cross-compilation-sins x86-64_sortix typo. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen c01fcd36c3 Fix double fsck in sysupgrade(8). 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 3831d99149 Fix sysupgrade(8) copyright. 2016-09-25 22:28:17 +02:00
Jonas 'Sortie' Termansen 967c5b57d5 Fix advice/advise typos. 2016-09-25 22:27:07 +02:00
Jonas 'Sortie' Termansen c195784736 Fix sysmerge(8) out of bounds accesses and error messages. 2016-08-23 00:30:41 +02:00
Jonas 'Sortie' Termansen f28fc4ac39 Fix non-blocking recv(2) and send(2). 2016-08-22 01:47:31 +02:00
Jonas 'Sortie' Termansen 8ec5d9af44 Fix linked list and shadowing bugs in kernel clock and timer code. 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen e962f5e4cc Fix use after free in getaddrinfo(3) error case. 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen 46fbe3ec0d Fix non-relative path in sysupgrade(8). 2016-08-21 00:04:27 +02:00
Jonas 'Sortie' Termansen 47b53f1aab Fix missing word in sysupgrade(8) error message. 2016-08-21 00:04:26 +02:00
Jonas 'Sortie' Termansen 2b6463aa95 Fix drivers not detecting PCI devices without an interrupt line. 2016-08-21 00:03:58 +02:00
Jonas 'Sortie' Termansen da89dec2e2 Fix AHCI port IDENTIFY timeout taking 10 seconds. 2016-08-21 00:03:57 +02:00
Jonas 'Sortie' Termansen 8f81f990f8 Fix undefined stack register after switch into long mode.
Thanks to dminuoso for pointing out the issue.
2016-07-29 15:20:05 +02:00
Jonas 'Sortie' Termansen 2141c95621 Fix sysupgrade(8) downgrade detection. 2016-07-29 15:20:05 +02:00
Jonas 'Sortie' Termansen 1dbd1f760a Fix missing validation of program entry points. 2016-07-29 15:20:04 +02:00
Jonas 'Sortie' Termansen b54e09ebaf Improve cross-development(7). 2016-07-23 23:30:33 +02:00
Jonas 'Sortie' Termansen 92106d4d34 Remove unnecessary tix gitignore entry. 2016-07-23 22:13:39 +02:00