summaryrefslogtreecommitdiff
path: root/distrib
AgeCommit message (Collapse)Author
2023-01-18syncTheo de Raadt
2023-01-18Typofix array length syntax, spotted by afresh1Klemens Nanni
2023-01-17syncTheo de Raadt
2023-01-17Add debug FUNCS_ONLY knobKlemens Nanni
Hacking on the installer while running it is a lot easier when you can inspect or run functions directly without paging the whole script or poking around in it with ed. install.sub is already structured so that all functions come first, then MD code, then actual commands. Copy FUNCS_ONLY from rc.subr(8) so you can drop out any time and hack around more conveniently: Available disks are: sd0 sd1. Which disk is the root disk? ('?' for details) [sd0] ! Type 'exit' to return to install. test# FUNCS_ONLY=1 . /install.sub test# typeset -f get_dkdevs get_dkdevs() { echo $(scan_disknames "${MDDKDEVS:-/^[sw]d[0-9][0-9]* /s/ .*//p}") } test# get_dkdevs sd0 sd1 test# This requires the sourcing shell to be ksh(1) or sh(1) with 'strict Bourne shell mode' disabled. '!' is ksh now, but the initial (S)hell answer still lands in a strict (default) sh(1) -- that can/should be fixed separately. OK deraadt
2023-01-17Skip all interface config questions when there are noneKlemens Nanni
Even without any interfaces the installer still asks for one and only continues when the only possible answer 'done' is provided. That means one mandatory but useless answer during installations like # vmctl start -c -d ./install72.img -d ./disk.img test ... System hostname? (short form, e.g. 'foo') test Available network interfaces are: . Network interface to configure? (name, lladdr, '?', or 'done') A response is required. Network interface to configure? (name, lladdr, '?', or 'done') ? Available network interfaces are: . Network interface to configure? (name, lladdr, '?', or 'done') done DNS domain name? (e.g. 'example.com') [my.domain] ... Skip it when there is no viable answer: # vmctl start -c -d ./install72.img -d ./disk.img test ... System hostname? (short form, e.g. 'foo') test DNS domain name? (e.g. 'example.com') [my.domain] ... OK deraadt
2023-01-16syncTheo de Raadt
2023-01-15syncTheo de Raadt
2023-01-14syncTheo de Raadt
2023-01-13syncTheo de Raadt
2023-01-12On '!', drop into a proper ksh(1) instead of a limited sh(1) lackingKlemens Nanni
arithmetic expression `(( ... ))' and more. OK deraadt
2023-01-08syncTheo de Raadt
2023-01-07syncTheo de Raadt
2023-01-07syncTheo de Raadt
2022-12-31syncJonathan Gray
2022-12-24syncTheo de Raadt
2022-12-23Allow configuring interfaces by lladdr in installerAndrew Fresh
This modifies the installer question, auto install scripts may need updating. Allows answering ? to the interface question to list allowed lladdrs and allows answering with one of them to configure the interface. Reconfiguring by either name/unit or lladdr will clear the previous config. Many suggestions from kn@ finish it @deraadt
2022-12-19syncTheo de Raadt
2022-12-17syncTheo de Raadt
2022-12-16drop a total of 93 trailing spaces from three linesTheo Buehler
2022-12-16Prioritize lladdr over name/unit in hostname.if processingAndrew Fresh
When needed, lladdr is more precise and enduring. Suggested by deraadt@ Many improvments and OK kn@
2022-12-15syncTheo de Raadt
2022-12-13syncTheo de Raadt
2022-12-05Add support configuring hostname.if(5) by lladdrAndrew Fresh
Original implementation by martijn@ Feedback and suggestions from kn@, sthen@, claudio@, florian@, and deraadt@. ok deraadt
2022-12-02syncStuart Henderson
2022-11-28syncMatthieu Herrb
2022-11-24sycnTheo de Raadt
2022-11-23syncTheo de Raadt
2022-11-22syncTheo de Raadt
2022-11-22syncTheo de Raadt
2022-11-18syncTheo de Raadt
2022-11-16syncTheo de Raadt
2022-11-15syncStuart Henderson
2022-11-14make the EFI partition quite large, like on arm64 x13s, because newer x86Theo de Raadt
((Lenovo in particular) firmware updating methods do the same -- placing a payload in there, so a small space won't do. ok kettenis
2022-11-13syncTheo Buehler
2022-11-11syncMatthieu Herrb
2022-11-11syncTheo de Raadt
2022-11-11syncAnton Lindqvist
2022-11-07syncTheo de Raadt
2022-11-06Skip MD post-install bits on upgradesKlemens Nanni
Upgrades are noiser on macppc (and loongson and octeon) than on other architectures because boot firmware changes and/or tips to complete an OpenBSD installation are always printed, even though they are not needed after an upgrade. OK deraadt
2022-11-06Use installboot -p; OK visaKlemens Nanni
2022-11-05Add mount_nfs(8) to fetch sets over NFSKlemens Nanni
bsd.rd and miniroot72.img fit, boot and install over NFS with this. OK deraadt
2022-11-05clockintr(9): initial commitScott Soule Cheloha
clockintr(9) is a machine-independent clock interrupt scheduler. It emulates most of what the machine-dependent clock interrupt code is doing on every platform. Every CPU has a work schedule based on the system uptime clock. For now, every CPU has a hardclock(9) and a statclock(). If schedhz is set, every CPU has a schedclock(), too. This commit only contains the MI pieces. All code is conditionally compiled with __HAVE_CLOCKINTR. This commit changes no behavior yet. At a high level, clockintr(9) is configured and used as follows: 1. During boot, the primary CPU calls clockintr_init(9). Global state is initialized. 2. Primary CPU calls clockintr_cpu_init(9). Local, per-CPU state is initialized. An "intrclock" struct may be installed, too. 3. Secondary CPUs call clockintr_cpu_init(9) to initialize their local state. 4. All CPUs repeatedly call clockintr_dispatch(9) from the MD clock interrupt handler. The CPUs complete work and rearm their local interrupt clock, if any, during the dispatch. 5. Repeat step (4) until the system shuts down, suspends, or hibernates. 6. During resume, the primary CPU calls inittodr(9) and advances the system uptime. 7. Go to step (2). This time around, clockintr_cpu_init(9) also advances the work schedule on the calling CPU to skip events that expired during suspend. This prevents a "thundering herd" of useless work during the first clock interrupt. In the long term, we need an MI clock interrupt scheduler in order to (1) provide control over the clock interrupt to MI subsystems like timeout(9) and dt(4) to improve their accuracy, (2) provide drivers like acpicpu(4) a means for slowing or stopping the clock interrupt on idle CPUs to conserve power, and (3) reduce the amount of duplicated code in the MD clock interrupt code. Before we can do any of that, though, we need to switch every platform over to using clockintr(9) and do some cleanup. Prompted by "the vmm(4) time bug," among other problems, and a discussion at a2k19 on the subject. Lots of design input from kettenis@. Early versions reviewed by kettenis@ and mlarkin@. Platform-specific help and testing from kettenis@, gkoehler@, mlarkin@, miod@, aoyama@, visa@, and dv@. Babysitting and spiritual guidance from mlarkin@ and kettenis@. Link: https://marc.info/?l=openbsd-tech&m=166697497302283&w=2 ok kettenis@ mlarkin@
2022-10-31The cad(4) ethernet controller works well on the Hifive UnmatchedJeremie Courreges-Anglas
From Miguel Landaeta
2022-10-27syncTheo de Raadt
2022-10-24syncTheo de Raadt
2022-10-21syncStuart Henderson
2022-10-19Get rid of useless/confusing subshellKlemens Nanni
Other function, same stuff like r1.1210 except here there `>/dev/null 2>&1' hammer is required to silence the ls(1) test. The make_dev() call is no longer silenced now but does not print on stdout anyway; if making the device fails we'd like to know. Otherwise if probing the disk fails it continues to be silenced. (cvs diff -w -U1) |@@ -2311,3 +2311,2 @@ is_rootdisk() { | |- ( | make_dev $_d |@@ -2322,6 +2321,6 @@ is_rootdisk() { | umount /mnt |- fi |+ fi >/dev/null 2>&1 | rm -f /dev/{r,}$_d? |+ | return $_rc |- ) >/dev/null 2>&1 | } OK halex
2022-10-16Leave installurl handling to syspatch(8)Klemens Nanni
When upgrading to releases, the installer fills rc.firsttime(8) with a syspatch(8) snippet possibly displaying available patches. That snippet itself checks for a release version as well as an existent installurl(5) file as a precondition for syspatch, see the diff below. syspatch, however, has code to fallback to cdn.o.o without a valid URL: 286 _MIRROR=$(while read _line; do _line=${_line%%#*}; [[ -n ${_line} ]] && 287 print -r -- "${_line}"; done </etc/installurl | tail -1) 2>/dev/null 288 [[ ${_MIRROR} == @(file|ftp|http|https)://* ]] || 289 _MIRROR=https://cdn.openbsd.org/pub/OpenBSD 290 _MIRROR="${_MIRROR}/syspatch/${_KERNV[0]}/$(machine)" Furthermore, the installer actively sets a working URL if needed, in the same finish_up() function shortly before placing the syspatch snippet: 2842 # Create /etc/installurl if it does not yet exist. 2843 if [[ ! -f /mnt/etc/installurl ]]; then 2844 echo "${INSTALL_URL:-https://cdn.openbsd.org/pub/OpenBSD}" \ 2845 >/mnt/etc/installurl 2846 fi So one of the following is true for installurl: 1. exists but has no valid URL, then syspatch falls back to cdn.o.o 2. exists and has a valid URL, then syspatch uses that 3. does not exist so the installer creates it with cdn.o.o, see 2. In the unlikely case that the install/upgrade finishes, i.e. installurl does exist, but gets removed or truncated before rc.firsttime runs, the existing check would actually prevent syspatch from running even though it copes with such files. So just remove the useless check. OK aja
2022-10-14syncStuart Henderson
2022-10-10Discard stdout/err only where needed in check_unattendedupgrade()Klemens Nanni
We should be fine silencing only the test condition which produces legit output and warnings. All else produces no output and should not error out; if it does, those warnings should be printed and fixed. Feedback OK halex