Commit Graph

40 Commits

Author SHA1 Message Date
Maxime Hadjinlian
8ae4a168de skeleton: Remove bash specific files
Signed-off-by Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-10-04 15:53:01 +01:00
Maxime Hadjinlian
f93c692c04 skeleton: Clean up profile file
There's a lot of code in /etc/profile, which doesn't really belong in a
minimal default skeleton.

Also, add an 'unset i' to avoid clutter.

If the user has a specific needs, it needs to be added in
/etc/profile.d/ by a post-build script.

Signed-off-by Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-10-04 15:52:53 +01:00
Luca Ceresoli
bfd969d29f skeleton: fix absence of /dev/shm on static, read-only systems
/dev/shm is needed for systems using shared memory. On init-based systems
this directory is usually created in the inittab along with /dev/pts, by
the lines:

package/busybox/inittab:
  ::sysinit:/bin/mkdir -p /dev/pts
  ::sysinit:/bin/mkdir -p /dev/shm

package/sysvinit/inittab:
  si2::sysinit:/bin/mkdir -p /dev/pts
  si3::sysinit:/bin/mkdir -p /dev/shm

However this is broken when static /dev management is selected and the root
filesystem is read-only, showing during boot the error:

  mkdir: can't create directory '/dev/shm': Read-only file system

Fix it by creating the empty /dev/shm directory, just like /dev/pts.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-03 15:34:28 +02:00
Maxime Hadjinlian
89d39fc7a3 initscripts: new package
The folder init.d is currently installed by default since it's part of
our skeleton.
This patch creates a package out of it and make busybox/sysvinit depends
on it.

This way, if you chose another init, you don't end up with a useless
init.d folder.

[Thomas:
  - make the initscripts package selectable via a hidden bool
  - remove some unneeded changes in sysvinit.mk.]

Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-14 01:51:52 +02:00
Maxim Mikityanskiy
d3c8da4dd4 skeleton: apply locale settings in user shells
Add /etc/profile.d/locale.sh script from Arch Linux to /etc/profile.
This script looks for locale.conf, sources it, and exports the LANG and
LC_* variables.

[Arnout: put in /etc/profile in the skeleton rather than making it
 systemd specific.]

Signed-off-by: Maxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-13 22:35:59 +02:00
Yann E. MORIN
c1c7e8b788 core/skeleton: drop /etc/securetty
securetty is supposed to restrict the terminals root is allowed to
login from. As it happens, login from busybox (w/ securetty support)
is actually enforcing use of securetty, while login from util-linux
is completely ignoring securetty altogether.

Remove securetty from our skeleton altogether and stop worrying about
it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-13 13:00:50 +02:00
Baruch Siach
f33f766860 system/skeleton: don't use random-seed from a read-only fs
A random-seed from a read-only filesystem is useless.

Also, drop the check for /etc/random-seed existence; it must exist after a
touch.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-07-08 23:52:48 +02:00
Baruch Siach
ed0b44fdce system/skeleton: remove random-seed
Seeding the entropy pool with a known seed makes more harm than good. This is
especially bad for when /etc is not on a persistent writable storage, so the
entropy pool is seeded with the same value on every boot. Just drop it.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-07-08 23:52:32 +02:00
Bartosz Golaszewski
ab6b4c82f4 system/skeleton: fix /etc/group
When using busybox compiled from current git, login emits the following
message:

    login: /etc/group: bad record

Fix it by adding the missing colon to /etc/group in system/skeleton.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-04-21 15:36:56 +02:00
Thomas Petazzoni
c6ca6fc9a3 system/skeleton: fix the new /var/run symbolic link
Reported-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-03 17:09:34 +01:00
Gustavo Zacarias
d380dde1d2 skeleton: make /run a proper directory/filesystem
Making /var/run and /run symlinks to /tmp is bad since the underlying
tmpfs filesystem is mode 1777 which leads to possible security attack
vectors via badly owned/mask-mode pidfiles and state files residing there.

So make /run a proper directory with /var/run symlinked to it.
Eventually all startup scripts and state info should be pointed to /run
directly as per the linux fhs and good practice.

Add a tmpfs filesystem entry for /run so that busybox inittab, systemv
inittab and systemd automount mounts it there to avoid breaking the
system.

While at it fix inconsistent spacing in /etc/fstab by using tabs and
drop the "static file system information" header whatever that means.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-03 15:58:03 +01:00
Jeremy Rosen
f4f62a3c16 Allow a single DHCP configuration via the system configuration submenu
This patch allows the setup of simple a single interface to be
automatically brought up and configured via DHCP on system startup.

The interface name can be set via a configuration option. This patch
does not support systemd-networkd, any complex network configuration should
be done via overlay of /etc/network/interfaces or the relevant networkd
configuration file

[Peter: rename to BR2_SYSTEM_DHCP, tweak help text & implementation]
Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-02-02 21:42:47 +01:00
Gustavo Zacarias
3a005f10e8 skeleton/S40network: tweak for debian ifupdown
Make the S40network script create the /run/network directory for the
debian variant of ifupdown which uses it as a lock directory.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Tested-by: Karoly Kasza <kaszak@gmail.com>
Reviewed-by: Karoly Kasza <kaszak@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-12 22:23:04 +01:00
Gustavo Zacarias
1dbb7e8a82 system/inittab: adjust shutdown
Drop null id since that means "don't show anything" for busybox init,
hence the shutdown sequence (/etc/init.d/rcK) doesn't show anything
giving the false impression that it's not being run.
If someone wants a really silent console they'll need to adjust much more than
this anyway.
Also swap the root read-only remount with swapoff since the swap can be
a regular (loop) file in the root filesystem and make the operation fail
resulting in a dirty filesystem.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-11-20 19:40:36 +01:00
Gustavo Zacarias
1987e06be0 system/skeleton: drop pcmcia bits
They're obsolete and the package was removed way back in 2010.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-28 19:08:46 +01:00
Gustavo Zacarias
54e8fb12d3 system/skeleton: drop lp user from shadow
It has no counterpart in passwd so it's basically a NOP.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
e7dec51ebe system/skeleton: drop shutdown user from shadow
It has no counterpart in passwd so it's basically a NOP.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
0fb812d38e system/skeleton: drop adm user from shadow
It has no counterpart in passwd so it's basically a NOP.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
0faad74292 system/skeleton: drop valid shell from non-login users
Non-login users shouldn't have a valid shell so drop it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
d1a4aa9c87 system/skeleton: drop proxy user
AFAIK no package uses it and even if it did it would belong there.
And it's not a standard user either.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
e4cb9097f2 system/skeleton: drop backup user
AFAIK no package uses it and even if it did it would belong there.
And it's not a standard user either.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
aa66ce2d57 openssh: drop user from skeleton
The sshd privilege drop user doesn't belong in the skeleton, it's
exclusively used by OpenSSH.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
f449fe5854 dbus: drop user/group from skeleton
It belongs to the package.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
496f39ba7a system/skeleton: remove haldaemon
We dropped the hal package quite some time ago, and it's not even a
properly created user.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-27 19:23:00 +01:00
Gustavo Zacarias
bca37ec97d skeleton/etc/profile: drop aliases
They all depend on having a custom busybox config and/or fully featured
utilities which depend on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 18:40:36 +02:00
Gustavo Zacarias
34853976f9 skeleton/root/.bash_profile: don't set PATH
Even if the main shell is bash /etc/profile is also parsed so it's
redundant.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 18:40:31 +02:00
Gustavo Zacarias
cfad612fc7 skeleton/etc/profile: remove /usr/bin/X11 from PATH
That directory has been unused for ages so remove it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 18:40:25 +02:00
Gustavo Zacarias
e1eba3d97c system/skeleton: make nsswitch install conditional
Don't blindly install the /etc/nsswitch.conf file, it's useless for
toolchains that aren't (e)glibc-based and misleading.
Make the installation conditional on a (e)glibc toolchain.

[Thomas: use $(INSTALL) instead of cp.]

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-25 12:48:17 +02:00
Gustavo Zacarias
bcb835b042 system/inittab: update to fix bug #7442
Update inittabs (skeleton/busybox & sysvinit) to remove the trailing
REMOUNT_ROOTFS_RW comment used as magic string in system/system.mk to
enable/disable remounting the root filesystem rw or not since it affects
sysvinit in doing so properly as reported in bug #7442.

Instead update the sed expressions to match clean non-commented strings
by searching for "-o remount,rw /" and checking that's the end of the
line as well to avoid affecting possibly other remounts that a user can
have in a custom inittab.

Long-term the startup block of inittab should just move to a S00sysinit
script or similar so that rcS can pick it up directly.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 01:24:11 +02:00
Yann E. MORIN
908198e756 system/skeleton: remove spurious group 'nobody'
We define the two groups 'nobody' and 'nogroup' in our skeleton, but
they have the same gid, which is not valid.

This breaks the mkuser script, as noticed by Thomas.

Anyway, the user 'nobody' belongs to the group 'nogroup' in any sane
distribution.

So, just remove the spurious 'nobody' group.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-23 23:39:02 +02:00
Stephan Hoffmann
b4f6274585 Remove user "default"
User "default" with no password has been around for long time, but not
used within buildroot. Since we now have BR2_ROOTFS_USERS_TABLES it is
no longer needed.

Signed-off-by: Stephan Hoffmann <sho@relinux.de>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-06-07 00:06:31 +02:00
Luca Ceresoli
fa7697dc2b system/skeleton: add mail group
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-05 18:31:51 +02:00
Peter Korsgaard
a1451719df skeleton: /etc/fstab: make sure /tmp is world writable and sticky
ramfs (which is used instead of tmpfs if CONFIG_SHMEM isn't enabled in the
kernel configuration), defaults to mode 0755 instead of 01777 like tmpfs
uses.

/tmp should be world writable and sticky, so explictly enforce the mode so
ramfs users gets it correct instead of relying on the defaults.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-21 22:30:24 +01:00
Anton Blanchard
ae6e4febf6 Add hypervisor consoles (hvc)
Add /dev/hvc* devices, and add them to securetty. These
are required for ppc64 virtual consoles.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-16 22:39:53 +01:00
Peter Sanford
9332e26125 skeleton: Update /etc/protocols from Debian Jessie
This update adds IP protocols created in the last 20 years.

Signed-off-by: Peter Sanford <psanford@nearbuysystems.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-27 08:27:38 +01:00
Danomi Manchego
3e56504d9f group file: define groups expected by udev
udev-182 requires several groups to be resolvable at udev startup,
including disk, cdrom, floppy, tape, audio, video, lp, tty, dialout,
and kmem.  Only some of these are in the default skeleton's group
file, So let's add the missing groups, and plugdev too.

This avoids getting these logs in /var/logs/messages:

Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'dialout' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'kmem' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'video' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'lp' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'floppy' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'cdrom' unknown
Jan  1 00:00:08 buildroot daemon.err udevd[37]: specified group 'tape' unknown

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-01 08:06:22 +02:00
Peter Korsgaard
9dab397a4f system/skeleton: remove /etc/hostname
We already provide BR2_TARGET_GENERIC_HOSTNAME to set /etc/hostname,
so a default /etc/hostname file isn't needed.

More importantly, if the user has explictly set BR2_TARGET_GENERIC_HOSTNAME
to the empty string, we would still end up with a /etc/hostname containing
'buildroot' which is unlikely to be what the user wanted.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-19 20:27:01 +02:00
Soren Brinkmann
2c4ff68e08 system/securetty: Add ttyPS[0-1]
Adding ttyPS0 and ttyPS1 to securetty for Zynq.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-11 23:32:11 +02:00
Stephan Hoffmann
4c52ff1acf skeleton: add /etc/nsswitch.conf
Toolchain Linaro 2012_09 and possibly other glibc based ones
rely on the existence of nsswitch.conf. If it's missing names
from /etc/hosts are not resolved and thus "localhost" is not
known.

Signed-off-by: Stephan Hoffmann <sho@relinux.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-02 16:32:16 -08:00
Thomas Petazzoni
6c3e3ad419 New top-level directory: system
This directory groups the following elements:
 * the default root filesystem skeleton
 * the default device tables
 * the Config.in options for system configuration (UART port for
   getty, system hostname, etc.)
 * the make rules to apply the system configuration options

Even though the skeleton and device tables could have lived in fs/, it
would have been strange to have the UART, system hostname and other
related options into fs/. A new system/ directory makes more sense.

As a consequence, this patch also removes target/Makefile.in, which
has become useless in the process.

[Peter: fixup TARGET_SKELETON settings / documentation to match]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-11-04 12:51:08 +01:00