Commit graph

129 commits

Author SHA1 Message Date
cinap_lenrek b56909157f bootrc: unmount devip *before* starting factotum
we want devip to get reattached after hostowner has been written. factotum
already handles this with a private authdial() routine that mounts devip
when it is not present. so we detach devmnt before starting factotum,
and attach once factotum finishes.
2019-09-21 18:48:14 +02:00
cinap_lenrek 5b7d8e1f6f bootrc: remount devip after /dev/hostowner has been written by factotum
devip remembers the attach uname so after we set hostowner we
remount devip so future connections have the right owner.
2019-09-21 18:11:52 +02:00
cinap_lenrek f22b4ecc77 bootrc: fix $rootdir and $rootspec handling (thanks lucio)
we did not interpret the $rootdir and $rootspec environment
variables right. $rootdir is what gets bound to / (usually /root)
and $rootspec is the mountspec of /root.
2019-05-05 17:02:37 +02:00
BurnZeZ 3f1fefeafb bootrc: simplify if statement 2019-03-30 15:09:00 +00:00
cinap_lenrek 2f5983ba02 bootrc: handle automatic ip configuration on gbe media 2019-03-27 14:17:51 +01:00
cinap_lenrek 8d9f3906fa plan9.ini: add nora6= option to disable automatic ipv6 configuration 2019-03-27 14:11:25 +01:00
cinap_lenrek 1e97adc86b nusbrc: detect "keyboardio model 01", appears as multifuction device with IAD csp(0102EF) (thanks sam-d) 2019-03-21 02:14:40 +01:00
cinap_lenrek c5393d612f bootrc: remove $ff references (was old parsed /boot/boot argument list) 2018-12-04 18:55:56 +01:00
cinap_lenrek 796e5e6000 nusbrc: support for raspi3 ethernet 2018-10-20 19:53:57 +02:00
mischief 67e14807e9 nusbrc: prevent nusb/kb from attaching to sony ps3 controller 2018-10-10 13:49:03 -07:00
cinap_lenrek 2985d53b7a bootrc: add experimental reboot method to load another kernel
syntax: reboot!bootfile[!method...]

this echos bootfile to /dev/reboot, causing bootfile kernel
to be started.

when method is given, we first connect to the filesystem and
set bootargs so that bootfile can be loaded from the target
network or local fileserver.

note, when no bootfile is given, this causes the kernel to
reboot to bios.
2018-09-16 22:35:16 +02:00
mischief 67b24e6dac nusbrc: add LG G5 for nusb/ether 2018-08-30 16:23:36 -07:00
cinap_lenrek cd752a39f8 ipv6 autoconfiguration on ethernet
for ip autoconfiguration, setup ipv6 link local addresses
and do SLAAC in parallel to DHCP.
2018-08-15 21:39:30 +02:00
cinap_lenrek 51b0b0235b bootrc: write fatal error message to fd2 2018-07-14 17:20:49 +02:00
qwx 372d359e28 kernel: let /rc/bin/diskparts attach #k after #S partitions are loaded up 2018-03-17 01:04:31 +02:00
cinap_lenrek f3f9392517 kernel: introduce devswap #¶ to serve /dev/swap and handle swapfile encryption 2017-10-29 23:09:54 +01:00
cinap_lenrek befdd7d755 kernel: pass bootargs also in multiboot command line, retire the bootline mechanism to pass arguments to /boot/boot 2017-06-28 18:56:16 +02:00
cinap_lenrek 234137bce3 fix bugs and cleanup cryptsetup code
devfs:

- fix memory leak in devfs leaking the aes key
- allocate aes-xts cipher state in secure memory
- actually check if the hexkey got fully parsed

cryptsetup:

- get rid of stupid "type YES" prompt
- use genrandom() to generate salts and keys
- rewrite cryptsetup to use common pbkdf2 and readcons routines
- fix alot of error handling and simplify the code
- move cryptsetup command to disk/cryptsetup
- update cryptsetup(8) manual page
2016-10-24 20:56:11 +02:00
cinap_lenrek 613578b69f kernel: add srvtls and tlsclient to bootfs.proto for encrypting connection to the file server 2016-05-16 22:55:30 +02:00
cinap_lenrek ecebba779f provide /n and /mnt early in bootrc to allow consistent use in /lib/namespace
theres a bootstrap problem:

when /bin/init is run, it processes /lib/namespace where we might want to
mount or bind resources to /n or /mnt. but mntgen was run later in
cpurc/termrc so these mounts would be ignored.

we already have mntgen in bootfs, so we can provide these mountpoints early.

i keep the termrc/cpurc mntgens where they are, but ignore the error
prints. this way old kernels will continue to work.
2016-02-14 01:42:32 +01:00
cinap_lenrek ccfb9118a3 bootrc: remove usbwait hack, usbd/nusbrc are now synchronous by previous commit 2015-11-22 03:19:27 +01:00
cinap_lenrek 7e3b2cdb55 usbd: intoruce /env/usbbusy
to solve the usb device enumeration race on boot, usbd creates /env/usbbusy
on startup and once all devices have been enumerated and readers have consumed
all the events, we remove the file so nusbrc/bootrc can continue. this makes
sure all the usb devices that where plugged in on boot are made available.
2015-11-22 03:17:15 +01:00
glenda c4fdc6bfdb fix fuckup 2015-08-25 09:35:10 +00:00
mischief 6b402b83cf import E script from bell labs 2015-08-25 02:07:46 -07:00
cinap_lenrek c96efcfef3 kernel/boot: do not handle kfs boot 2015-08-21 19:53:43 +02:00
cinap_lenrek 4aee2b803e nusbrc: handle fat formated usb drives without partition table
on some usb drives, there is no dos partition table, so check
the filesystem type and consider the whole drive.
2015-06-28 21:50:30 +02:00
cinap_lenrek 82aa1d5c78 integrate disk/edisk with diskparts, bootfs and installer (gpt support) 2015-05-31 13:06:18 +02:00
Matthew Veety 2b4a488762 fixed by fuck up 2015-05-13 00:15:18 -04:00
Matthew Veety 80845af98b removed ukill. 2015-05-13 00:11:59 -04:00
cinap_lenrek 74b37c286f bootrc: simplify bootargs splitting avoiding awk 2015-04-09 15:36:20 +02:00
cinap_lenrek 0bc9ad781f boot: allow alternative proto files per kernel and kernel config for bootfs.paq
bootmkfile will now looks for the following proto files in order
and pick the first one it finds to build the bootfs.paq file:

1)	$CONF.boofs.proto		(config specific)
2)	bootfs.proto			(kernel specific)
3)	$BOOTDIR/bootfs.proto	(default generic)
2015-03-25 00:11:54 +01:00
cinap_lenrek 3f4b45c4f1 boot: bind #c to /dev with MREPL instead of MBEFORE to avoid double entries 2015-03-23 03:15:58 +01:00
cinap_lenrek e451804a75 boot: disable group/other permission checking in bootfs paqfs
when building bootfs in d770 mode directory, the other permissions
in bootfs paq are masked off which results in boot to fail. theres
no point in checking group/other permissions on boot, so just disable
permissin checking in paqfs with the -a flag.
2015-03-15 15:27:56 +01:00
cinap_lenrek 07a776fad9 kernel: use new disk/mkfs -o option to get proper source filename list for bootfs.proto 2014-12-15 01:04:05 +01:00
cinap_lenrek 67bed722f2 kernel: get rid of /boot/boot parametrization
there is no use for "bootdisk" variable parametrization
of /boot/boot and no point for the boot section with its
boot methods in the kernel configuration anymore. so
mkboot and boot$CONF.out are gone.

move the rules for bootfs.paq creation in 9/boot/bootmkfile.
location of bootfs.proto is now in 9/boot/bootfs.proto.
our /boot/boot target is now just "boot".
2014-12-14 22:10:34 +01:00
cinap_lenrek aa2422b5eb bootrc: keep original address when ndb/dnsgetip fails and let dial complain 2014-12-10 18:02:41 +01:00
cinap_lenrek d4076731f1 bootrc: use "address" instead "ip" in wording netboot questions, as we domain names are allowed now. 2014-12-10 17:37:53 +01:00
cinap_lenrek 23b3407663 bootrc: add ndb/dnsgetip resolver to bootfs so domain names can be used for fs=, auth= and secstore= (thanks mischief) 2014-12-10 03:22:14 +01:00
cinap_lenrek d75f5a24ba bootrc: preserve #ec/fs (thanks _sl) 2014-12-10 03:16:36 +01:00
cinap_lenrek 665f0c8e3e bootrc: handle multiple fs and auth addresses in netboot, always set auth= in /net/ndb 2014-12-10 00:30:07 +01:00
cinap_lenrek 17566b4dd3 bootrc: do not pass authserver with -a flag to factotum, handle multiple secstore addresses
factotum is started in bootrc before the network is setup
(as we need it to negotiate wpa key for wifi). once, the network
is setup, the bootstrap authservers are passed in /net/ndb,
which factotum reads when doing bootstrap authdial. it does
this only when no authserver was specified earlier! but we
want net.rc to select the proper bootstrap authserver...

the $secstore variable takes precedence over $auth. as
there is no connection server yet, we have to select the set
of servers here and pass them to secstore with -s flag.
note that this will work if multiple addresses where
specified.
2014-12-09 22:26:30 +01:00
cinap_lenrek f128c6eab0 boot: dont print errors if ethernet has no ifstats file, can happen with usb ethernet 2014-08-17 06:08:06 +02:00
stanley lieber 6a182d56b7 nusbrc: ensure rpi ethernet always appears as /net/etherU0 2014-06-29 14:58:03 -04:00
cinap_lenrek 4275c49e72 nusb: implement aijus stable uniqueue device names
instead of naming devices by ther dynamically assigned device address,
we hash device uniqueue fields from the device descriptor and produce
a 5 digit hex string that will identify the device across machines.

when there is a collision (less than 1% chance with 100 devices),
usbd will append the device address to the name to make it uniqueue
for this machine.

the hname is passed to drivers in the devid argument, which now has
the form addr:hname, where the colon and hname can be omited (for backwards
compatibility).

when the new behaviour isnt desired, nousbhname= environment variable
can be defined giving the old behaviour.
2014-06-28 18:09:43 +02:00
cinap_lenrek 972f60a794 nusbrc: dont fork usb drivers into background
probing needs to run synchronous to avoid races with other
readers of /dev/usbevent.
2014-06-04 23:59:17 +02:00
ftrvxmtrx 645510e5ce boot/nusbrc: add another rndis device 2014-04-23 23:46:00 +02:00
ftrvxmtrx 99c0abc76d nusb/ether: add RNDIS support (tested on Nexus 5) 2014-04-22 23:34:52 +02:00
cinap_lenrek 8d0e4cf37b wpa support for tcp boot, remove duplicate secstore code from factotum
to run aux/wpa at boot, we need factotum to be running. tho
factotum was started only after the network was configured.

what we do now is start factotum early, not fetching keys
from secstore. once network is available and the auth server
is known, we fetch keys from secstore using auth/secstore in
bootrc.

to pass the authserver for p9 authentication to factotum, we
write it in /net/ndb and the special _authdial() in factotum
will picks it up.

as we are using auth/secstore binary in any case, we remove
the duplicated secstore code from factotum and make it just
exec auth/secstore to fetch the keys on startup (unless -n
or -S is specified).
2014-04-18 20:55:41 +02:00
Matthew Veety 3f9d92c1a8 similar to my last commit, but combined the two waits for the usb devices. still configurable, but with usbwait. If usbwait is not defined then it defaults to the original 2 seconds. 2014-02-14 00:11:11 -05:00
Matthew Veety 1d64be1984 added in a way to make net.rc wait for the network hardware to come up before running ip/ipconfig. This fixes the issue with the Raspberry Pi where ip/ipconfig tried running prior to /net/etherU3 exists 2014-02-14 22:05:25 -05:00