diff --git a/Makefile b/Makefile index dadd556..9504c30 100644 --- a/Makefile +++ b/Makefile @@ -804,6 +804,7 @@ projects: # CFLAGS and make cannot see that. # ----------------------------------------------------------------------- iso: + @$(MAKE) --no-print-directory ldls-r8169-if-present $(MAKE) RAMROOT=1 schos.iso # One El Torito entry, pointing at a FAT image holding the loader and kernel. @@ -1427,6 +1428,15 @@ ldls-r8169: *) cp $$f $(SYSROOT)/lib/firmware/rtl_nic/;; esac; done @echo "staged Linux r8169 ($(shell uname -r)) into $(SYSROOT)" +# `make iso` runs this first: the ISO ships Linux's r8169 set (NOTICE), so stage it whenever +# this machine has the modules and the BTF to stage it from, and say so when it does not. +ldls-r8169-if-present: + @if ls $(LDLS_KDIR)/drivers/net/ethernet/realtek/r8169.ko* >/dev/null 2>&1 && [ -r /sys/kernel/btf/vmlinux ]; then \ + $(MAKE) --no-print-directory ldls-r8169; \ + else \ + echo "iso: no Linux r8169 modules or BTF on this machine ($(LDLS_KDIR)) -- this ISO will not carry them"; \ + fi + ldls-unstage: rm -rf $(SYSROOT)/lib/modules @echo "removed" @@ -1497,6 +1507,10 @@ etc-install: $(SCHINIT_JOBS) $(ETC_PLAIN) $(ETC_ZSH) $(LOGO_ASCII) $(SRV_FILES) @mkdir -p $(SYSROOT)/usr/share/hwdata @rm -f $(SYSROOT)/usr/share/usb.ids @for f in usb.ids pci.ids; do [ -f dist/$$f ] && cp -p dist/$$f $(SYSROOT)/usr/share/hwdata/; done; true + @# The licences travel with the image: SchOS's, xv6's, and NOTICE, which carries the + @# third-party ones -- including Linux's r8169 modules, whose source offer it records. + @mkdir -p $(SYSROOT)/usr/share/licenses/schos + @cp -p LICENSE LICENSE.MIT NOTICE $(SYSROOT)/usr/share/licenses/schos/ @echo "installed $(words $(ETC_PLAIN)) /etc file(s), $(words $(ETC_ZSH)) zsh file(s) and $(words $(SCHINIT_JOBS)) schinit manifest(s)" # The mount points. Created here rather than by init, because a mkdir on a @@ -1844,4 +1858,4 @@ distclean: clean -include $(shell find $(BUILD) \( -path $(BUILD)/aroot -o -path $(BUILD)/iso -o -path $(BUILD)/ports \) -prune -o -type f -name '*.d' -print 2>/dev/null) FORCE: -.PHONY: FORCE +.PHONY: FORCE ldls-r8169-if-present diff --git a/docs/architecture/desktop.md b/docs/architecture/desktop.md index df56968..8be437c 100644 --- a/docs/architecture/desktop.md +++ b/docs/architecture/desktop.md @@ -40,11 +40,12 @@ the real program is for. ## The four files - **`/root/.xserverrc`** starts `X` on the VT `startx` was started from (startx works that - out only when `uname -s` says Linux, and SchOS's says SchIFT) with **`-dumbSched`**. Xorg - normally reads input on a thread of its own; when SchOS had no threads the server crashed - the first time a client disconnected, in `pthread_join` on a thread that was never made, and - `-dumbSched` is Xorg's own switch for input on the main loop. Threads exist now; the switch - is still on, and nobody has run the server without it since. + out only when `uname -s` says Linux, and SchOS's says SchIFT). It used to add **`-dumbSched`**, + Xorg's switch for reading input on the main loop, because Xorg normally reads input on a + thread of its own and, when SchOS had no threads, the server crashed the first time a client + disconnected, in `pthread_join` on a thread that was never made. Threads exist now and the switch + is gone: under QEMU, X starts with Window Maker, `xclock` and `xeyes` connect and disconnect, an + `xterm` runs and exits, and the server stays up. - **`/root/.xinitrc`** is `exec wmaker`. Without it xinit falls back to twm and an xterm, which are not in the image. - **`/etc/X11/xorg.conf.d/10-schos.conf`** names the input devices. Alpine's Xorg asks udev for diff --git a/tools/posix/mkaroot.sh b/tools/posix/mkaroot.sh index c0eb688..dcfb269 100644 --- a/tools/posix/mkaroot.sh +++ b/tools/posix/mkaroot.sh @@ -97,12 +97,12 @@ mkdir -p "$P/etc/profile.d" grep -v '^export \(PATH\|HOME\|TERM\)=' "$P/etc/profile" > "$P/etc/profile.d/schos.sh" rm -f "$P/etc/profile" -# How startx starts the X server for root: Alpine's xserverrc, plus -# -dumbSched. Xorg reads input on a thread of its own; when SchOS had no threads -# the server crashed on its way out the first time a client disconnected, in -# pthread_join on a thread that was never made. -dumbSched is Xorg's own switch -# for input on the main loop. SchOS has threads now (clone, futex), so this may -# no longer be needed -- it has simply not been tried without it. The file is +# How startx starts the X server for root: Alpine's xserverrc. (It used to add +# -dumbSched, Xorg's switch for reading input on the main loop, because when SchOS +# had no threads the server crashed on its way out the first time a client +# disconnected, in pthread_join on a thread that was never made. SchOS has threads +# now; X was run without the switch under QEMU -- clients connecting and +# disconnecting, an xterm starting and exiting -- and it stays up.) The file is # root's own rather than /etc/X11/xinit/xserverrc, which belongs to the xinit # package. mkdir -p "$P/root" @@ -111,7 +111,7 @@ cat > "$P/root/.xserverrc" <<'XEOF' # The VT X runs on is the one startx was started from. startx works that out # only when `uname -s` says Linux, and SchOS's says SchIFT. vt=$(tty | sed -n 's|^/dev/tty\([0-9][0-9]*\)$|vt\1|p') -exec /usr/bin/X -nolisten tcp -dumbSched $vt "$@" +exec /usr/bin/X -nolisten tcp $vt "$@" XEOF # What startx runs inside it: Window Maker, which world installs. Without this