summaryrefslogtreecommitdiffstats
path: root/lib/libstand
Commit message (Collapse)AuthorAgeFilesLines
* MFC r309369,310850,310853:tsoome2017-02-068-101/+87
| | | | | | | | | | libstand: dosfs cstyle cleanup for return keyword. dosfs support in libstand is broken since r298230 PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Approved by: imp (mentor)
* MFC r311659:bapt2017-01-281-23/+10
| | | | | | | | | | | | | remove network mask calculation for Classful network Nowadays it's not necessary to compute network mask from the IP address and compare to given by DHCP. Submitted by: kczekirda Reviewed by: glebius, bapt Sponsored by: Oktawave MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D8740
* MFC r311275: Restructure libz.delphij2017-01-181-3/+3
|
* MFC r308129:bapt2016-11-301-1/+11
| | | | | | | | | | | | When issuing a PXE dhcp request, always issue a param request (DHCP option 55) with all dhcp parameters we might be interested in. Some DHCP server like the new kea (by ISC) expect it. This makes pxeboot functional with ISC kea. Submitted by: Vincent Legout <vincent.legout@gandi.net> Sponsored by: Gandi.net
* MFC: 304677, 304680, 305125, 305770, 305769bapt2016-10-196-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304677: Add tftpfs support for the EFI loader Allow netbooting on efi without having to setup any NFS server by rebuilding the loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader r305125: Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE) From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour) if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150. We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader. Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose. Relnotes: yes Sponsored by: Gandi.net
* MFC 305588sephe2016-10-171-9/+24
| | | | | | | | | | | | pxeboot: Add nfs.read_size tunable. Increase this tunable improves kernel loading speed. Submitted by: Jun Su <junsu microsoft com> Reviewed by: rpokala, wblock (previous version) Obtained from: DragonFlyBSD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7756
* Fix a bug in the parsing code: always use the len and not 8.imp2016-05-201-1/+1
|
* Add support for %S to libstand as well so /boot/loader and friends canimp2016-05-171-0/+5
| | | | use it.
* libstand: make more use of the howmany() macro when available.pfg2016-04-261-1/+1
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* Unbreak the build if you enable WITH_NANDallanjude2016-04-191-2/+2
| | | | | | | Followup to r298230 Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com> (original version) Sponsored by: ScaleEngine Inc.
* A new implementation of the loader block cacheallanjude2016-04-188-103/+189
| | | | | | | | | | | | | | | | | The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. The cache also implements limited read-ahead to increase performance. To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. Booting from a virtual CD over IPMI: 0ms latency, before: 27 second, after: 7 seconds 60ms latency, before: over 12 minutes, after: under 5 minutes. Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: delphij (previous version), emaste (previous version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4713
* libstand: use NULL instead of zero for pointers.pfg2016-04-183-10/+10
|
* MFHgjb2016-04-047-64/+13
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Correct comment.bz2016-03-221-1/+1
| | | | | | | | MFC after: 2 weeks
| * If the dhcp server delivers an interface-mtu option, parse it and storeian2016-03-214-0/+11
| | | | | | | | | | | | | | | | the value in a new global intf_mtu for use by the application. These changes were inspired by the patch provided by Robert Blayzor in PR 187094, and will allow loader(8) to propagate the value to the kernel along with the other nfs_diskless parms delivered via environment vars.
| * Actually garbage collect the unused code, as mentioned in r297147, whichian2016-03-211-57/+0
| | | | | | | | this change should have been part of.
| * Garbage collect the bswap routines from libstand. The declaration wasian2016-03-212-6/+1
| | | | | | | | | | | | | | | | | | | | wrapped in an i386 ifdef with a comment questioning their usefulness even there. It turns out they aren't referenced anywhere, but their presence prevents using sys/endian.h in libstand code. These days, sys/endian.h provides much better support for such things, using compiler builtins and inline functions (and creating connections between libstand code and header files from sys/ would not be breaking new ground).
* | MFHgjb2016-03-061-0/+4
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Merge ^/head r295902 through r296006.dim2016-02-241-42/+0
| |\
| * \ Merge ^/head r294169 through r294598.dim2016-01-221-2/+2
| |\ \
| * \ \ Merge ^/head r293430 through r293685.dim2016-01-111-2/+2
| |\ \ \
| * \ \ \ Merge ^/head r293280 through r293429.dim2016-01-081-1/+1
| |\ \ \ \
| * | | | | Similar to r293384, for libstand, also use the new -mno-movt flag withdim2016-01-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | clang >= 3.8.0 targeting arm.
* | | | | | MFHgjb2016-03-021-42/+0
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | Sponsored by: The FreeBSD Foundation
| * | | | | DIRDEPS_BUILD: Regenerate without local dependencies.bdrewery2016-02-241-42/+0
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division
* | | | | First pass through library packaging.gjb2016-02-041-0/+1
|/ / / / | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation
* | | | Bring in initial libc and libstand support for RISC-V.br2016-01-171-2/+2
| |_|/ |/| | | | | | | | | | | | | | | | | Reviewed by: andrew, emaste, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4943
* | | Make tohex() work as expected.ae2016-01-091-1/+1
| | |
* | | Fix a typo.ae2016-01-091-1/+1
| |/ |/| | | | | PR: 205722
* | Don't install /usr/include/stand.h twice after r293040.bdrewery2016-01-071-1/+1
|/ | | | | | Only install it from lib/libstand. Sponsored by: EMC / Isilon Storage Division
* Add fls() to libstandemaste2016-01-061-2/+3
| | | | | | | Although we don't use it in tree yet libstand is installed as user- facing /usr/liblibstand.a, and some work in progress makes use of it. Instead of conflicting with ongoing libstand Makefile deduplication, just add it now.
* Reduce libstand Makefile duplicationemaste2016-01-011-3/+4
| | | | | | | | | | | | | | | | libstand is built in three places (lib/libstand, sys/boot/libstand32, and sys/boot/userboot/libstand). Reduce Makefile duplication by .including libstand/Makefile from sys/boot/libstand32/Makefile. sys/boot/userboot/libstand/Makefile will be addressed later, as it contains additional differences yet to be handled. This change also switches libstand32 to use the new uuid_from_string and uuid_to_string, which was not included in r292473. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4747
* When building libstand for arm, don't emit instructions that requireian2015-12-311-0/+6
| | | | | | relocation fixups unsupported by the self_reloc() code, and don't optimize memcpy/memset using floating point registers, because in a standalone environment nothing has initialized the fpu hardware.
* Allow dhcp/bootp server-provided values to be overriden from environmentian2015-12-221-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variables in loader(8) and other libstand applications. Sometimes a dhcp server provides incorrect information along with the IP address. It would be useful to have a way to override this with locally-supplied information, such as command line parameters passed from a prior-stage bootloader. This change allows pre-existing env vars to take precedence over values delivered by the dhcp or bootp server. The bootp/dhcp code in libstand automatically creates environment variables from the data provided by the server (dhcp.root-path, dhcp.domain-name, etc). It also transcribes the values to some global variables such as 'rootpath' and 'hostname'. This change does two things: When adding dhcp.* vars to the environment, don't replace existing vars/values. When setting the global vars rootpath and hostname, use the dhcp.root-path and dhcp.host-name env var values if they exist. This allows the platform-specific part of loader(8) to obtain override values in some platform-specific way and store them in the environment before opening the network device. The set of values that can be overriden is currently limited to just string options. The values that are delivered as binary data are things that probably shouldn't be overridden (IP, netmask, gateway, etc). The original patch this evolved from was submitted by martymac@ PR: 202098 Differential Revision: https://reviews.freebsd.org/D4559
* Create libstand version of uuid_from_string and uuid_to_string. Theimp2015-12-193-1/+244
| | | | | | | | | | | normal libc versions of these functions use asprintf and sscanf, both of which aren't available in the libstand world. It's easier to rewrite these than to try to claw those functions into libstand. Also include uuid_create_nil, since it's safe to include. These were written from scratch, except for bits of comments that I got from the libc version, which are acknowledged in the source. Differential Revision: https://reviews.freebsd.org/D4540
* pxeboot: make the tftp loader use the option root-path directivebapt2015-12-161-3/+17
| | | | | | | | | | | | | | | | | | | | pxeboot in tftp loader mode (when built with LOADER_TFTP_SUPPORT) now prefix all the path to open with the path obtained via the option 'root-path' directive. This allows to be able to use the traditional content /boot out of box. Meaning it now works pretty much like all other loaders. It simplifies hosting hosting multiple version of FreeBSD on a tftp server. As a consequence, pxeboot does not look anymore for a pxeboot.4th (which was never provided) Note: that pxeboot in tftp loader mode is not built by default. Reviewed by: rpokala Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D4590
* Add strlcat() and strlcpy() to libstand.ian2015-12-141-2/+2
|
* If we can't open the file, skip devclose() for the exclusive_file_systemmarcel2015-10-081-1/+1
| | | | case. We never called devopen(), so we know there's nothing to close.
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.bdrewery2015-09-251-2/+0
| | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division
* Use CFLAGS_NO_SIMD in preference to varying lists of -mno-xxxx flags.imp2015-08-271-26/+1
| | | | | | | | | Go ahead and defined -D_STANDALONE for all targets (only strictly needed for some architecture, but harmless on those it isn't required for). Also add -msoft-float to all architectures uniformly rather that higgley piggley like it is today. Differential Revision: https://reviews.freebsd.org/D3496
* Add META_MODE support.sjg2015-06-131-0/+59
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * Merge sync of headsjg2015-05-2716-55/+185
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-194-13/+817
| |\
| * \ Merge head from 7/28sjg2014-08-197-34/+71
| |\ \
| * | | Updated dependenciessjg2014-05-161-0/+1
| | | |
| * | | Merge from headsjg2014-05-081-1/+1
| |\ \ \
| * \ \ \ Merge headsjg2014-04-2710-82/+196
| |\ \ \ \
| * | | | | Saver to rm first when making link to dirsjg2013-10-171-0/+1
| | | | | |
| * | | | | Merge head@256284sjg2013-10-131-2/+6
| |\ \ \ \ \
| * \ \ \ \ \ Merge from headsjg2013-09-055-167/+34
| |\ \ \ \ \ \
OpenPOWER on IntegriCloud