path: root/system
Commit message (Collapse)AuthorAgeFilesLines
* system: allow not setting a default, system-wide time zoneGravatar Yann E. MORIN2019-11-271-0/+2
| | | | | | | | | | | | | | It is valid that there is no system-wide default time zone defined, in which case Etc/UTC is assumed. Fixes: #12316 Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Martin Bark <martin@barkynet.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Richard Braun <rbraun@sceen.net> Cc: Andrew Trapani <andrew.trapani@ontera.bio> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/netifrc: add support for BR2_SYSTEM_DHCPGravatar Michał Łyszczek2019-09-231-3/+5
| | | | | | | | | | | | | This patch makes openrc-netifrc package aware of BR2_SYSTEM_DHCP config, and if set, will start dhcp daemon on configured interface. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> [yann.morin.1998@free.fr: - simplify condition for BR2_SYSTEM_DHCP - reword commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/openrc: add support for spawning gettyGravatar Michał Łyszczek2019-09-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We install a template getty service, and we 'instantiate' it in the default runlevel, using the configured tty. Ideally, packages that provide a getty program would be responsible for installing the corresponding service file. However, to keep consistency with the existing init systems (busybox, systemd, and sysv), so we do provide it from the openrc package itself. OpenRC only acts on the files in a runlevel sub-directory, but the documentation [0] actually suggests that the instance symlink be done in init.d, and then again symlinked into the actual runlevel sub-directory. So, we abide by the rules. Also, to be noted, the getty service file is installed without ensuring that a getty command is available. This again is not unlike other init systems, sysvinit and busybox, which behave the same. [0] https://wiki.gentoo.org/wiki/OpenRC Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> [yann.morin.1998@free.fr: - move getty template to openrc package (Thomas) - fix namespace of the vaiables (Thomas) - simplify creation of the defaults file - rewrite commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system/skeleton: drop PAGER from /etc/profileGravatar Lubomir Rintel2019-09-071-1/+0
| | | | | | | | | | | | | | | We couldn't track down the reason why the profile sets $PAGER other than that it has always been there. However, it defeats pager autodetection by various tool (systemctl, nmcli, etc.) that would otherwise prefer less to more, in case both were available. Let's drop it. My desktop Linux distro (Fedora) doesn't seem to set it either and the universe doesn't seem to have collapsed yet. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system/Config.in: add new init - openrcGravatar Michał Łyszczek2019-05-181-0/+11
| | | | | | | | | | | | | | | | | This is very basic settings for openrc init. * system/Config.in Allows to select openrc as init system (which auto selects openrc-skeleton and openrc package). * package/ifupdown-scripts/Config.in openrc has its own service to bring up/down interfaces, so ifupdown-scripts should not be enabled when openrc is enabled to prevent service clash. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl> [Thomas: take into account the !BR2_STATIC_LIBS dependency] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system/skeleton: remove password expiration from shadowGravatar Arnout Vandecappelle (Essensium/Mind)2019-03-201-9/+9
| | | | | | | | | | | | | | | | | | The fields in /etc/shadow were set as follows: root::10933:0:99999:7::: This sets the date of last password change to Jan 1, 2000, the minimum password age to 0 days, the maximum password age to near-infinity, and a warning period of 7 days. In practice, this means the password never expires. So all of this is quite useless. On the other hand, mkusers creates lines without all of these options. It just sets ::::: which disables password expiration completely. To make things consistent, do the same for the skeleton entries. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* system: allow selecting merged /usr along with custom rootfs skeletonGravatar Carlos Santos2019-02-061-6/+2
| | | | | | | | | If the user is brave enough to use a custom rootfs skeleton then we must not prevent using merged /usr too. Actually it is already possible to do this, although indirectly, by selecting BR2_INIT_SYSTEMD. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* skeleton: use BR2_SYSTEM_DEFAULT_PATH as default PATHGravatar Markus Mayer2018-12-311-1/+1
| | | | | | | | | | | | | | | We substitute the path specified in system/skeleton/etc/profile with the path specified in the configuration variable $(BR2_SYSTEM_DEFAULT_PATH). $(BR2_SYSTEM_DEFAULT_PATH) is a Kconfig string, so it is already double quoted. This means that export PATH=value will now be export PATH="value" in /etc/profile, which is perfectly fine. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: rework commit log about the double quoting] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system: introduce BR2_SYSTEM_DEFAULT_PATH optionGravatar Markus Mayer2018-12-312-0/+14
| | | | | | | | | | | | | The configuration option BR2_SYSTEM_DEFAULT_PATH allows the user to override the default path, which can be used by /etc/profile and some system daemons. It defaults to the value previously hard-coded in /etc/profile. This default should be suitable for most users. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system cfg: remove mkpasswd MD5 format optionGravatar Matt Weber2018-12-151-10/+0
| | | | | | | | | | | | | | | | | | | | As SHA256 is now default, removing weak MD5 option. C libraries now all support the SHA methods. glibc 2.7+ uclibc (bdd8362a88 package/uclibc: defconfig: enable sha-256...) musl 1.1.14+ One issue this would prevent, is a host tool issue with a FIPS enabled system where weak ciphers/methods are disabled. It seems the crypt(3) call is impacted by /proc/sys/crypto/fips_enabled (per crypt(3) man page). It results in mkpasswd returning "(EPERM) crypt failed." Rather then create a Buildroot host dependency check, this patch removes the potential corner case from being selected. Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* system cfg: set mkpasswd default to SHA256Gravatar Matt Weber2018-12-151-1/+1
| | | | | | | | | | This patch changes the default mkpasswd method to SHA256 from MD5. The change both improves the quality of the hash used and prepares for eventually removing MD5 as a option. Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* system cfg: update mkpasswd SHA option txtGravatar Matt Weber2018-12-151-10/+2
| | | | | | | | | | | | | This patch drops the comment about checking the C libraries version as they now all support it by default glibc 2.7+ uclibc (bdd8362a88 package/uclibc: defconfig: enable sha-256...) musl 1.1.14+ Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* package/systemd: needs glibcGravatar Yann E. MORIN2018-11-221-8/+3
| | | | | | | | | | | | | | | | | | | | Since version v239, systemd-nspawn unconditioanlly uses prlimit(2), which is not implemented in uClibc-ng. systemd-nspawn can not be disabled. This makes systemd glibc-only again. After a bit of discussion with upstream (om IRC), it looks very improbable that they accept a patch making systemd-nspawn optional. They would probably consider a patch that provides that syscall wrapper if it is missing, though, but that's less trivial... Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Waldemar Brodkorb <wbx@openadk.org> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* system: update Config.in comment about systemd dependenciesGravatar Thomas Petazzoni2018-09-151-3/+9
| | | | | | | | | | | | | | | | | | | In commit 879fa7f82a86ffdc6d1cf7c9bfbb5cf830583d69, the BR2_INIT_SYSTEMD option was changed to allow selecting with a uClibc toolchain. Unfortunately, the corresponding Config.in comment, which was already bogus, was not updated to take into account the numerous dependencies of BR2_INIT_SYSTEMD. Due to this, even if you have uClibc enabled, the BR2_INIT_SYSTEMD option may not be visible, and the Config.in comment may also not be visible, leaving the user in the dark. This commit fixes the dependencies of the Config.in comment so that they match the one of the BR2_INIT_SYSTEMD option. Reported-by: Raphael Jacob <r.jacob2002@gmail.com> Cc: Raphael Jacob <r.jacob2002@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* skeleton: PAGER without blank and unset at end of for loopGravatar Florian La Roche2018-06-051-2/+2
| | | | | | | | | | The PAGER environment variable is including a blank character at the end. Remove this. A for loop has been unsetting the variable inside the loop, this is only needed once at the end of the loop. Signed-off-by: Florian La Roche <F.LaRoche@pilz.de> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* skeleton: add /dev/fd, /dev/std{in, out, err} symlinks for static /dev on ↵Gravatar Peter Korsgaard2018-05-014-0/+4
| | | | | | | | | | | | | | | | | | readonly rootfs Some applications, e.g. bashs process subsitution feature, rely on the convention of `/dev/fd` being a symbolic link to `/proc/self/fd`. When a static /dev is used on a readonly rootfs then the runtime ln invocations in the inittab will fail, so we need to add the symlinks at build time. Makedevs doesn't support creating symlinks, so instead add the symlinks to the default skeleton. For non-static /dev setups, the kernel will mount devtmpfs which shadows the /dev of the rootfs, but then the runtime ln invocations in inittab will create the symlinks. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* system/Config.in: re-wrap help textGravatar Ricardo Martincoski2018-04-011-58/+64
| | | | | | | ... to follow the convention <tab><2 spaces><62 chars>. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* systemd: allow to build with uClibc toolchainsGravatar Waldemar Brodkorb2018-02-141-3/+3
| | | | | | | | | | | We need to disable any systemd parts using either IDN, NSS or gshadow. IDN is only disabled in C library function call to getnameinfo(), it does not effect libidn/libidn2 usage in systemd. Tested with qemu-system-arm. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* system: only expose getty options for busybox and sysvinitGravatar Thomas Petazzoni2018-01-121-0/+4
| | | | | | | | | | | | | | | | Only busybox and sysvinit handle the BR2_TARGET_GENERIC_GETTY_TERM and BR2_TARGET_GENERIC_GETTY_OPTIONS options; the other init systems do not. So, protect those options behind appropriate dependencies on busybox or sysvinit. Fixes #10301. Reported-by: Michael Heinemann <posted@heine.so> Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* skeleton: Rename skeleton-sysv to skeleton-init-sysvGravatar Cam Hutchison2017-08-141-2/+2
| | | | | | | | | | | | The skeletons are based on the selection of BR2_INIT_*, so add init- to the package name to make this clearer. While skeleton-sysv is relatively clear, skeleton-common and skeleton-none are less clear on their relationship to BR2_INIT_*. So rename skeleton-sysv to conform to a clearer pattern. Signed-off-by: Cam Hutchison <camh@xdna.net> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* skeleton: Rename skeleton-systemd to skeleton-init-systemdGravatar Cam Hutchison2017-08-141-1/+1
| | | | | | | | | | | | The skeletons are based on the selection of BR2_INIT_*, so add init- to the package name to make this clearer. While skeleton-systemd is relatively clear, skeleton-common and skeleton-none are less clear on their relationship to BR2_INIT_*. So rename skeleton-systemd to conform to clearer pattern. Signed-off-by: Cam Hutchison <camh@xdna.net> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* skeleton: Rename skeleton-none to skeleton-init-noneGravatar Cam Hutchison2017-08-141-1/+1
| | | | | | | | | | The skeletons are based on the selection of BR2_INIT_*, so add init- to the package name to make this clearer. The name skeleton-none implies no skeleton at all, not a base skeleton with no init-specific files. Signed-off-by: Cam Hutchison <camh@xdna.net> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: make systemd work on a read-only rootfsGravatar Yann E. MORIN2017-08-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the rootfs is readonly, systemd will expect /var to be writable. Because we do not really have a R/W filesystem to mount on /var, we make it a tmpfs [*], and use the systemd-tmpfiles feature to populate it with "factory" defaults. We obtain those factory defaults by redirecting /var to that location at build time, using a symlink /var -> /usr/share/factory which is the location in which systemd-tmpfiles will look for when instructed to "recursively copy" a directory. With a line like: C /var/something - - - - it will look for /usr/share/factory/something and copy it (recursively if it is a directory) to /var/something, but only if it does not already exist there. We also mark this copy with the exclamation mark, as it is only safe to copy on boot, not when changing targets. To be noted: the real format for such lines are: C /var/something - - - - /from/where/to/copy/something But if the source is not given, then it is implicitly taken from /usr/share/factory (which in our case is as-good a location as whatever else, so we use it, and thus we need not specify the source of the copy). Note that we treat symlinks a little bit specially, by creating symlinks to the factory defaults rather than copying them. Finally, /var at build time is a symlink, but at runtime, it must be a directory (so we can mount the tmpfs over there). We can't change that as a target-finalize hook, because: - some packages may want to set ownership and/or access rights on files or directories in /var, and that only happens while assembling the filesystem images; changing /var from a symlink to a (then empty) directory would break this; - /var would be a directory on sub-sequent builds (until the next "make clean"). Instead, we use the newly-introduce pre- and post-rootfs command hooks, to turn /var into a directory before assembling the image, and back to a symlink after assembling the image. [*] People who want the factory-defaults only on first boot will have to tweak the fstab to mount something else than a tmpfs on /var. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: separate sysv and systemd parts of the skeletonGravatar Yann E. MORIN2017-08-0211-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | For systemd, we create a simple /etc/fstab with only an entry for /, as systemd otherwise automatically mounts what it needs where it needs it. systemd does not like that the content of /var be symlinks to /tmp, especially journald that starts before /tmp is mounted, and thus the journal files are hidden from view, which causes quite a bit of fuss... Instead, move the current /var to a sysv-only skeleton. systemd at install time will create the /var content it needs, so we just create an empty /var for systemd. systemd would create /home and /srv at runtime if they are missing, but it is better to create them right now, to simplify supporting systemd on a RO filesystem in the (near) future. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: introduce sysv, systemd and none specific skeletonsGravatar Yann E. MORIN2017-08-021-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we use the same skeleton for sysv-like init systems and systemd, even though systemd has some peculiarities that makes our default skeleton unfit. So, we'll need to provide different skeletons (really, only part of it) for sysv-like and systemd. In addition, in order to support the "no init system" (BR2_INIT_NONE) use case, we introduce a "none" skeleton. Introduce three new skeleton packages, aptly named skeleton-sysv, skeleton-systemd and skeleton-none. All three are providers of the skeleton virtual package, in lieu of the skeleton-common package, which is now a simple dependency of all three new skeletons. Those packages are empty for now. In followup changes: - sysv-specific stuff will be moved out of skeleton-common and into skeleton-sysv; - systemd-specific stuff will be added to skeleton-systemd. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Arnout: - merge with the patch that enables the BR2_INIT_NONE case - simplify the BR2_PACKAGE_SKELETON_COMMON_ONLY select logic] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: - remove the BR2_PACKAGE_SKELETON_COMMON_ONLY logic, and instead introduce a separate skeleton-none package for the BR2_INIT_NONE] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: make it a virtual packageGravatar Yann E. MORIN2017-08-021-0/+4
| | | | | | | | | | | | We now have two packages that can act as a skeleton, skeleton-common, also known as our default skeleton, and skeleton-custom. This means that the skeleton package can be a standard virtual package now. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: split out into skeleton-commonGravatar Yann E. MORIN2017-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move all the handling of the default skeleton into a new package, skeleton-common. We don't name it skeleton-default, because it will be further split later, into a skeleton for sysv and another for systemd, with some parts still common between the two. So just name it skeleton-common right now; this will save us a rename later. While we're at it, also assign to SKELETON_COMMON_TARGET_FINALIZE_HOOKS instead of directly to the global FINALIZE_HOOKS. Therefore, we don't need to do all of that in a condition BR2_PACKAGE_SKELETON_COMMON==y. Note: it would be technically sound to move the skeleton files together within a sub-directory of the skeleton-common package. However, we refer the user to those files, from various locations (manual, packages). It will indeed be easier for the user to find those files in system/skeleton/ rather than in package/skeleton-common/skeleton/ Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Arnout: remove the mkdir $(STAGING_DIR)/usr/include which was removed in skeleton.mk in master.] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: split out into skeleton-customGravatar Yann E. MORIN2017-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | For the custom skeleton, we practicaly do nothing, except ensure it contains the basic, required directories, and that those are properly setup wrt. merged /usr. Furthermore, our current skeleton is not fit for systemd, and we'll have to split things out into various skeletons. So, off-load the custom skeleton into its own package. Thus, the existing skeleton package is now limited to: - when using our default skeleton, install and tweak it properly; - when using a custom skeleton, do nothing except for depending on the skeleton-custom package. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Arnout: split off in a separate patch doing only this] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: select it rather than default to yGravatar Yann E. MORIN2017-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Our current skeleton is tailored to sysv-like init systems; it is not fit for systemd-based systems. So, in upcoming changes, we'll add another skeleton for systemd. This means we can no longer have the current skeleton default to 'y', or it would be enabled also for systemd, which would be incorrect. So, we remove the default to 'y' but have it selected by the default skeleton choice. However, we do not yet have a way to directly build (really, install) the custom skeleton, it is built (really, installed) as a dependency of the default skeleton. So we must also forcibly select the default skeleton when using a custom one. Until we have the means to do only one or the other; i.e. when we have a virtual skeleton. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/skeleton: drop dependency on host-mkpasswdGravatar Yann E. MORIN2017-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the root pasword is done in a target-finalize hook, so we do not need to enforce a dependency from the skeleton onto host-mkpasswd. Dropping that dependency will simplify making skeleton a virtual package (in up-coming changes). Instead, it is now selected as any other package. As such, it is guaranteed to be built before target-finalize. This however introduces a slight change in behaviour: previously, host-mkpasswd would only be built if we needed to hash the root password from its plain-text value. Now, host-mkpasswd is always built as soon as the root password is non-empty, even if already pre-hashed. Since host-mkpasswd is a really tiny weeny package bundled in Buildroot, with only two C files, built as a single unit with a single gcc call, the overhead is really minimal. Compared to the simplifications this will allow in the skeleton packages (plural: common, sysv, systemd, custom) to come, this overhead is acceptable. Yet another simplification, even if small, to ease providing multiple skeletons. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: move remounting / to the corresponding init systemsGravatar Yann E. MORIN2017-07-221-0/+15
| | | | | | | | | | | | | | | | | | Currently, remounting / read-write (or not) is done by the skeleton package when the init system is either busybox or sysvinit, by registering a target-finalize hook; it is not done at all for systemd. Move registering this target-finalize hook to both of busybox and sysvinit. Leave systemd alone, we'll take care of it later. Rename the macro to a more meaningful name, and move it to system.mk with the other such macros. Yet a little bit less init-system knowledge in the skeleton. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: remove not-so-useful comments, as pointed by Arnout.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: move setting getty to the corresponding init systemsGravatar Yann E. MORIN2017-07-221-0/+11
| | | | | | | | | | | | | | | | | | | | | Currently, setting the getty is done: - by the skeleton package when the init system is either busybox or sysvinit; - by the systemd package when the init system is systemd; both by registering a target-finalize hook. This is not very consistent. Move setting the getty out of the skeleton and into the package that provides the init system, by registering a per-package target-fialize hook. This offloads yet a bit more out of the skeleton, so that it is easier to properly separate the skeletons for the various init systems. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: provide package-wide system variables and macrosGravatar Yann E. MORIN2017-07-221-0/+62
| | | | | | | | | | | | | | | | | | | | | Some macros, soon some variables, currently defined in the skeleton are going to be used by other packages. Some of those variables will be used as Makefile conditions (e.g. in ifeq() conditions), so they *must* be defined before being used. Since the skeleton package, starting with an 's', is included quite late, those variables would not be available to most packages. Offload the existing macros into the new system/system.mk file, that is included early, before any package is. Rename the macros to appropriate names. Future commits will add new macros and variables in that file. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package/ifupdown-scripts: new packageGravatar Yann E. MORIN2017-07-044-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ifupdown scripts can be used independently of the init system, be it sysv, busybox or systemd; they could even be used when there is no init system (i.e. the user is providing his own). Currently, those ifupdown scripts are bundled in the skeleton. But we soon will have a skeleton specific to systemd, so we would be missing those scripts (when systemd-networkd is not enabled). So, move those scripts to their own package. To keep the current behaviour (before it is changed in future commits), we make that package default to y, but depend on the default skeleton. Instead of being a target-finalize hook, the scripts are installed as any other package are, with a package install-target command. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: drop empty IFUPDOWN_SCRIPTS_SOURCE] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: introduce BR2_SYSTEM_ENABLE_NLSGravatar Thomas Petazzoni2017-07-041-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the option BR2_ENABLE_LOCALE was more-or-less controlling whether NLS support was enabled in packages. More precisely, if BR2_ENABLE_LOCALE=y, we were not doing anything (so some packages could have NLS support enabled, some not). And only when BR2_ENABLE_LOCALE was disabled we were explicitly passing --disable-nls to packages. This doesn't make much sense, and there is no reason to tie NLS support to locale support. You may want locale support, but not necessarily NLS support. Therefore, this commit introduces BR2_SYSTEM_ENABLE_NLS, which allows to enable/disable NLS support globally. When this option is enabled, we pass --enable-nls to packages, otherwise we pass --disable-nls. In addition, when this option is enabled and the C library doesn't provide a full-blown implementation of gettext, we select the gettext package, which will provide the full blown implementation. It is worth mentioning that this commit has a visible impact for users: - Prior to this commit, as soon as BR2_ENABLE_LOCALE=y, packages *could* provide NLS support. It was up to each package to decide whether they wanted to provide NLS support or not (we were not passing --enable-nls nor --disable-nls). - After this commit, it's BR2_SYSTEM_ENABLE_NLS that controls whether NLS is enabled or disabled, and this option is disabled by default. Bottom line: with the default of BR2_SYSTEM_ENABLE_NLS disabled, some packages may lose NLS support that they used to provide. But we believe it's a reasonable default behavior for Buildroot, where generally NLS support is not necessary. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: require a timezone to be setGravatar Yann E. MORIN2017-07-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | Even though no timezone implicitly means UTC, systemd is not all that happy when it does not have a timezone set. This is all fine on a RW filesystem because systemd will create a symlink on its own (to Etc/UTC), but not so much on a RO filesystem, causing all kind of issues at boot time (up to the point that the system is unusable). We fix that by requiring that the timezone is actually set. The check is done by verifying that the timezone file is an actual file; if not set, the test would find a directory and would thus fail. Update the help entry accordingly. Also fix indentation in tzdata. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Richard Braun <rbraun@sceen.net> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Martin Bark <martin@barkynet.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: do not overwrite /bin/sh Busybox symlinkGravatar Thomas Petazzoni2017-03-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | The BR2_SYSTEM_BIN_SH hidden option defines to what binary the /bin/sh symlinks should point to. If busybox is chosen, then /bin/sh is created to point to /bin/busybox. This works fine with the default installation mode of Busybox, but it fails with the upcoming "individual binaries" mode, in which each applet is installed as its own binary, and /bin/busybox doesn't exist: we get /bin/sh as a broken symlink to /bin/busybox. Since Busybox already installs its own /bin/sh symlink, properly pointing to /bin/ash or /bin/hush depending on the selected shell, it doesn't make sense for the BR2_SYSTEM_BIN_SH logic to override this. Just let Busybox install its own /bin/sh by making BR2_SYSTEM_BIN_SH empty when Busybox shell is selected as /bin/sh. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Matthew Weber <matthew.weber@rockwellcollins.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* skeleton: fix permissions on /dev/pts/ptmxGravatar Jan Kundrát2017-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, it is not possible to allocate PTYs when a generated rootfs image with a recent glibc and systemd is launched as a container on an RHEL7 system via machinectl/systemd-nspawn. The container boots, but `machinectl login mycontainer` fails. The culprit is /dev/pts/ptmx with 0000 perms. On a typical system, there are two `ptmx` devices. One is provided by the devpts at /dev/pts/ptmx and it is typically not directly accessed from userspace. The other one which actually *is* opened by processes is /dev/ptmx. Kernel's documentation says these days that /dev/ptmx should be either a symlink, or a bind mount of the /dev/pts/ptmx from devpts. When a container is launched via machinectl/machined/systemd-nspawn, the container manager prepares a root filesystem so that the container can live in an appropriate namespace (this is similar to what initramfs is doing on x86 desktops). During these preparations, systemd-nspawn mounts a devpts instance using a correct ptmxmode=0666 within the container-to-be's /dev/pts, and it adds a compatibility symlink at /dev/ptmx. However, once systemd takes over as an init in the container, /lib/systemd/systemd-remount-fs applies mount options from /etc/fstab to all fileystems. Because the buildroot's template used to not include the ptmxmode=... option, a default value of 0000 was taking an effect which in turn led to not being able to allocate any pseudo-terminals. The relevant kernel option was introduced upstream in commit 1f8f1e29 back in 2009. The oldest linux-headers referenced from buildroot's config is 3.0, and that version definitely has that commit. Mount options that are not understood by the system are anyway ignored, so backward compatibility is preserved. Signed-off-by: Jan Kundrát <jan.kundrat@cesnet.cz> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: fix commit title, adjust commit log.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system(d): allow auto net configuration with networkdGravatar Eric Le Bihan2017-02-061-6/+3
| | | | | | | | | | | | | | | Allow automatic network configuration via systemd-networkd if selected. If systemd-networkd is enabled and $BR2_SYSTEM_DHCP is set, then create a .network file to configure the selected network interface via DHCP. Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> [Thomas: - merge the two patches from Eric into just one - instead of generating the dhcp.network file completely from the .mk file, use a template file, and "sed" it with the right network interface] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* package: update comments for reverse dependencies of util-linuxGravatar Rahul Bedarkar2017-01-281-1/+1
| | | | | | | | | | | | | | | | | | Commit 006a328ad6be ("util-linux: fix build with ncurses") removed dependency on BR2_USE_WCHAR, but failed to update the reverse dependencies of util-linux. This commit updates comments in Config.in for BR2_USE_WCHAR for reverse dependencies of util-linux which directly uses wchar now or when it is pulled from other dependencies. eudev doesn't use wchar directly, but needs C99 compiler. Autotools generate code with wchar_t for checking C99 compiler. Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: fix typoGravatar Matt Kraai2016-10-131-1/+1
| | | | | Signed-off-by: Matt Kraai <kraai@ftbfs.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* add mksh to system shell choiceGravatar Waldemar Brodkorb2016-10-011-1/+8
| | | | | | | Add mksh as a choice for system shells. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* system: fix unmet dependenciesGravatar Yann E. MORIN2016-09-111-1/+1
| | | | | | | | | | | Don't force remounting / read/write when using a customskeleton and systemd as init system, to fix the following unmet dependencies: warning: (BR2_INIT_SYSTEMD) selects BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW which has unmet direct dependencies (BR2_ROOTFS_SKELETON_DEFAULT) Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Merge branch 'next'Gravatar Peter Korsgaard2016-09-022-2/+2
|\ | | | | | | | | | | Quite some conflicts, so here goes .. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * system/skeleton: use uid/gid 65534 for nobody/nogroupGravatar Peter Korsgaard2016-08-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As recently discussed on lwn.net: https://lwn.net/Articles/695478/ The kernel has special behaviour for uid/gid 65534: 1. The kernel maps UIDs > 65535 to it when some subsystem/API/fs only supports 16bit UIDs, but a 32bit UID is passed to it. 2. it's used by the kernel's user namespacing as the internal UID that external UIDs are mapped to that don't have any local mapping. 3. It's used by NFS for all user IDs that cannot be mapped locally if UID mapping is enabled. Most distributions already map (or are in the progress of changing) nobody/nogroup to the 65534 uid/gid, so lets do so as well. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* | system: sysvinit needs MMUGravatar Yann E. MORIN2016-08-141-0/+1
| | | | | | | | | | | | | | | | | | | | It uses spawn() and thus fork(), so it needs an MMU. Fixes a build issue reported on IRC for a cortex-m4 build: http://pastebin.com/dGCsy0sr Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* | system: zoneinfo usable by musl, tooGravatar Yann E. MORIN2016-08-091-2/+1
|/ | | | | | | | | | | | | | | | | Currently, we limit installing zoneinfo to non-musl toolchain, by lack of knowledge on how it would work on musl. Turns out that musl uses the same zoneinfo format as glibc does. Make it possible to install the TZ info whatever the C library; for musl, use tzdata as for glibc. Thanks Rich! ;-) Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Rich Felker <dalias@aerifal.cx> Cc: Marc Khouri <marc@khouri.ca> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: move locale purging options to the "System configuration" menuGravatar Thomas Petazzoni2016-08-031-0/+34
| | | | | | | | | | | | | | The options to purge locales and to generate locale data are currently located in the toolchain menu. However, these options are not really related to the toolchain per-se, they are more system-level configuration options, much like the timezone selection option we already have in the "System configuration" menu. Therefore, it makes more sense to have the locale-related options in the "System configuration" menu as well. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* board: add blackfin gdb simulator supportGravatar Waldemar Brodkorb2016-07-241-0/+1
| | | | | | | | | With this config you can bootup a Linux kernel in GDB simulator and test Blackfin kernel and userland. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* system: do not set hostname and issue for custom skeletonGravatar Yann E. MORIN2016-07-181-0/+4
| | | | | | | | | | | We expect the custom skeleton to be fully filled with the necessary files, now. There is definitely no reason we should handle setting the hostname and the issue file in there. A user using a custom skeleton should be fully responsible for providing a functional skeleton. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>