1 ################################################################################
3 # system-related variables and macros
5 ################################################################################
7 # This file exists to define variables and macros that pertain to the system
8 # settings, like rsyncing a directory for skeletons, or the /lib vs. /usr/lib
11 # Some variables may be used as conditions in Makefile code, so they must be
12 # defined properly before they are used; this file is included early, before
15 # - SYSTEM_USR_SYMLINKS_OR_DIRS
16 # create /lib, /bin and /sbin, either as directories or as symlinks to
17 # their /usr conterparts
20 # rsync $(1) to $(2), with proper exclusions and rights
22 # - SYSTEM_LIB_SYMLINK
23 # create the appropriate /lib{32,64} symlinks
26 # - SYSTEM_GETTY_BAUDRATE
28 # - SYSTEM_GETTY_OPTIONS
29 # the un-quoted getty setting
31 # - SYSTEM_REMOUNT_ROOT_INITTAB
32 # set inittab to remount root read-write or read-only
35 # This function handles the merged or non-merged /usr cases
36 ifeq ($(BR2_ROOTFS_MERGED_USR),y)
37 define SYSTEM_USR_SYMLINKS_OR_DIRS
38 ln -snf usr/bin $(1)/bin
39 ln -snf usr/sbin $(1)/sbin
40 ln -snf usr/lib $(1)/lib
43 define SYSTEM_USR_SYMLINKS_OR_DIRS
44 $(INSTALL) -d -m 0755 $(1)/bin
45 $(INSTALL) -d -m 0755 $(1)/sbin
46 $(INSTALL) -d -m 0755 $(1)/lib
50 # This function rsyncs the skeleton directory in $(1) to the destination
51 # in $(2), which should be either $(TARTGET_DIR) or $(STAGING_DIR)
53 rsync -a --ignore-times $(RSYNC_VCS_EXCLUSIONS) \
54 --chmod=u=rwX,go=rX --exclude .empty --exclude '*~' \
58 # Make a symlink lib32->lib or lib64->lib as appropriate.
59 # MIPS64/n32 requires lib32 even though it's a 64-bit arch.
60 # $(1): base dir (either staging or target)
61 ifeq ($(BR2_ARCH_IS_64)$(BR2_MIPS_NABI32),y)
62 define SYSTEM_LIB_SYMLINK
63 ln -snf lib $(1)/lib64
64 ln -snf lib $(1)/usr/lib64
67 define SYSTEM_LIB_SYMLINK
68 ln -snf lib $(1)/lib32
69 ln -snf lib $(1)/usr/lib32
73 SYSTEM_GETTY_PORT = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_PORT))
74 SYSTEM_GETTY_BAUDRATE = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_BAUDRATE))
75 SYSTEM_GETTY_TERM = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_TERM))
76 SYSTEM_GETTY_OPTIONS = $(call qstrip,$(BR2_TARGET_GENERIC_GETTY_OPTIONS))
78 ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
79 # Find commented line, if any, and remove leading '#'s
80 define SYSTEM_REMOUNT_ROOT_INITTAB
81 $(SED) '/^#.*-o remount,rw \/$$/s~^#\+~~' $(TARGET_DIR)/etc/inittab
84 # Find uncommented line, if any, and add a leading '#'
85 define SYSTEM_REMOUNT_ROOT_INITTAB
86 $(SED) '/^[^#].*-o remount,rw \/$$/s~^~#~' $(TARGET_DIR)/etc/inittab