Commit graph

115 commits

Author SHA1 Message Date
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
cinap_lenrek 6c2e983d32 kernel: apply uintptr for ulong when a pointer is stored
this change is in preparation for amd64. the systab calling
convention was also changed to return uintptr (as segattach
returns a pointer) and the arguments are now passed as
va_list which handles amd64 arguments properly (all arguments
are passed in 64bit quantities on the stack, tho the upper
part will not be initialized when the element is smaller
than 8 bytes).

this is partial. xalloc needs to be converted in the future.
2014-01-20 00:47:55 +01:00
ppatience0 225cc4af5c nusb/ether: add rtl8150 driver, remove unused includes 2013-10-02 02:25:43 -04:00
cinap_lenrek e55d105159 bootrc: +x 2013-10-02 02:01:43 +02:00
ppatience0 334054e0e7 nusb/ether: add aue driver for admtek pegasus usb ethernet adapter 2013-08-24 19:18:15 -04:00
ppatience0 84172fc961 bootrc: fix spacing when asking for fs/auth ip 2013-04-28 18:34:47 -04:00
cinap_lenrek c3105131fe bootrc: fix mistake, god damn it 2012-12-06 03:46:22 +01:00
cinap_lenrek 620d6df973 bootrc: reparse all env variables, not just #ec 2012-12-06 02:03:59 +01:00
cinap_lenrek 23239adf54 nusb/ether: port drivers for asix and smsc ethernet 2012-12-06 23:05:24 +01:00
cinap_lenrek 0750687012 move usb ethernet in bootfs.paq 2012-12-05 13:53:34 +01:00
cinap_lenrek 2c4a77f21f devproc: remove pgrpid == 1 check for notepg open
assuming that this check tried to prevent the hostowner
from killing init, it is silly because init would just
handle the note.

with kbdfs, we actually want to send interrupt note to
the initial process group so instead of working arround
this with rfork(RFNOTEG|RFNAMEG), we remove the check.
2012-11-07 18:57:02 +01:00
cinap_lenrek 599dd1c34f make interrupt key (Del) just work in the console
these changes make the interrupt key available in the
console (before rio is started).

kbdfs: will now send a "interrupt" note to its invoking
process group in cooked mode.

bootrc: is now prepared to handle interrupts, mainly to
not accidently spawn a new bootargs prompt.

init: forwards the interrupt to the cpurc/termrc pgrp.

vncs: shields itself from kbdfs notegroup so interrrupt
wont kill the whole vnc session.
2012-11-06 17:19:41 +01:00
google 577a9f763f Prevent nusb/disk and nusb/kb from blocking nusbrc 2012-09-06 13:15:59 +12:00
cinap_lenrek 1de9ca2de5 bring back il protocol support 2012-05-03 10:47:40 +02:00
cinap_lenrek 02217fa6c2 boot: check nousbrc boot parameter, add delay 2012-03-01 18:55:42 +01:00