[uClibc] PATCH: buildroot configuration profiles
Kristian Hoffmann
khoff at fire2wire.com
Fri Nov 12 20:48:29 UTC 2004
In an attempt to seperate my customizations (package patches and config
files) I've introduced a profile directory (targets/profiles/)
to contain all of the per-package config files, patches, and other files
that are typically modified when building for a particular application.
Hopefully, if accepted, this will make it easier for someone to stay in
sync with the buildroot CVS tree without having to hand merge as many
changes.
Along with the attached patch, these changes are required...
--BEGIN--
mkdir target/profiles
mv target/default/ target/profiles/default/
mkdir target/profiles/default/config
mkdir target/profiles/default/patches
mv package/linux/kernel-patches/ target/profiles/default/patches/linux/
mv package/linux/linux.config target/profiles/default/config/linux.config
mv toolchain/uClibc/uClibc.config target/profiles/default/config/uClibc.config
mv toolchain/uClibc/uClibc.config-locale target/profiles/default/config/uClibc.config-locale
--END--
Thanks,
-Kristian
-------------- next part --------------
--- buildroot/.defconfig 2004-10-08 18:05:18.000000000 -0700
+++ buildroot_devel/.defconfig 2004-11-11 12:07:00.000000000 -0800
@@ -14,6 +14,7 @@
# BR2_sparc is not set
BR2_ARCH="i386"
BR2_WGET="wget --passive-ftp"
+BR2_CONFIG_PROFILE="default"
#
# Toolchain Options
--- buildroot/Makefile 2004-11-09 12:33:05.000000000 -0800
+++ buildroot_devel/Makefile 2004-11-11 12:07:00.000000000 -0800
@@ -108,8 +108,8 @@
$(TARGET_DIR):
rm -rf $(TARGET_DIR)
- zcat target/default/skel.tar.gz | tar -C $(BUILD_DIR) -xf -
- cp -a target/default/target_skeleton/* $(TARGET_DIR)/
+ zcat $(PROFILE_DIR)/skel.tar.gz | tar -C $(BUILD_DIR) -xf -
+ cp -a $(PROFILE_DIR)/target_skeleton/* $(TARGET_DIR)/
-find $(TARGET_DIR) -type d -name CVS -exec rm -rf {} \; > /dev/null 2>&1
source: $(TARGETS_SOURCE)
--- buildroot/package/Makefile.in 2004-11-09 12:33:05.000000000 -0800
+++ buildroot_devel/package/Makefile.in 2004-11-11 12:07:00.000000000 -0800
@@ -16,6 +16,7 @@
BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX)
TARGET_DIR:=$(BUILD_DIR)/root
STAGING_DIR=$(BUILD_DIR)/staging_dir
+PROFILE_DIR:=$(BASE_DIR)/target/profiles/$(BR2_CONFIG_PROFILE)
TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)
TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
IMAGE:=$(BASE_DIR)/root_fs_$(ARCH)$(ARCH_FPU_SUFFIX)
--- buildroot/package/linux/linux.mk 2004-11-09 12:33:05.000000000 -0800
+++ buildroot_devel/package/linux/linux.mk 2004-11-11 12:07:00.000000000 -0800
@@ -38,7 +38,7 @@
LINUX_DIR=$(BUILD_DIR)/linux-$(LINUX_VERSION)
LINUX_SOURCE=linux-$(DOWNLOAD_LINUX_VERSION).tar.bz2
LINUX_SITE=http://www.kernel.org/pub/linux/kernel/v2.4
-LINUX_KCONFIG=package/linux/linux.config
+LINUX_KCONFIG=$(PROFILE_DIR)/config/linux.config
LINUX_KERNEL=$(BUILD_DIR)/buildroot-kernel
# Used by pcmcia-cs and others
LINUX_SOURCE_DIR=$(LINUX_DIR)
@@ -56,8 +56,9 @@
# Rename the dir from the downloaded version to the AFTER patch version
mv -f $(BUILD_DIR)/linux-$(DOWNLOAD_LINUX_VERSION) $(BUILD_DIR)/linux-$(LINUX_VERSION)
endif
- mkdir -p package/linux/kernel-patches
- toolchain/patch-kernel.sh $(LINUX_DIR) package/linux/kernel-patches
+ #mkdir -p package/linux/kernel-patches
+ [ -d $(PROFILE_DIR)/patches/linux/ ] && \
+ toolchain/patch-kernel.sh $(LINUX_DIR) $(PROFILE_DIR)/patches/linux/
touch $(LINUX_DIR)/.unpacked
$(LINUX_KCONFIG):
--- buildroot/target/Config.in 2004-10-08 21:30:18.000000000 -0700
+++ buildroot_devel/target/Config.in 2004-11-11 12:07:00.000000000 -0800
@@ -2,6 +2,12 @@
menu "Target Options"
+config BR2_CONFIG_PROFILE
+ string "Target config profile"
+ default "default"
+ help
+ Name of the config profile to use. See target/profiles.
+
source "target/cramfs/Config.in"
source "target/ext2/Config.in"
source "target/jffs2/Config.in"
--- buildroot/target/ext2/ext2root.mk 2004-11-09 12:33:12.000000000 -0800
+++ buildroot_devel/target/ext2/ext2root.mk 2004-11-11 12:07:00.000000000 -0800
@@ -42,7 +42,7 @@
#- at find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP) --strip-unneeded 2>/dev/null || true;
- at find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
$(GENEXT2_DIR)/genext2fs -i $(GENEXT2_INODES) -b $(GENEXT2_SIZE) \
- -d $(TARGET_DIR) -q -D target/default/device_table.txt $(IMAGE).ext2
+ -d $(TARGET_DIR) -q -D $(PROFILE_DIR)/device_table.txt $(IMAGE).ext2
ext2root-source: $(DL_DIR)/$(GENEXT2_SOURCE)
--- buildroot/target/jffs2/jffs2root.mk 2004-11-09 12:33:12.000000000 -0800
+++ buildroot_devel/target/jffs2/jffs2root.mk 2004-11-11 12:10:45.000000000 -0800
@@ -34,7 +34,7 @@
@rm -rf $(TARGET_DIR)/usr/man
@rm -rf $(TARGET_DIR)/usr/info
$(MKFS_JFFS2) --pad --little-endian --squash -e 0x20000 \
- -D target/default/device_table.txt -d $(TARGET_DIR) \
+ -D $(PROFILE_DIR)/device_table.txt -d $(TARGET_DIR) \
-o $(IMAGE).jffs2
jffs2root-source: $(DL_DIR)/$(MTD_SOURCE)
--- buildroot/target/cramfs/cramfs.mk 2004-11-09 12:33:12.000000000 -0800
+++ buildroot_devel/target/cramfs/cramfs.mk 2004-11-11 12:10:55.000000000 -0800
@@ -39,7 +39,7 @@
- at find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
@rm -rf $(TARGET_DIR)/usr/man
@rm -rf $(TARGET_DIR)/usr/info
- $(CRAMFS_DIR)/mkcramfs -q -D target/default/device_table.txt $(TARGET_DIR) $(IMAGE).cramfs
+ $(CRAMFS_DIR)/mkcramfs -q -D $(PROFILE_DIR)/device_table.txt $(TARGET_DIR) $(IMAGE).cramfs
cramfsroot-source: cramfs-source
--- buildroot/toolchain/uClibc/uclibc.mk 2004-11-09 12:33:13.000000000 -0800
+++ buildroot_devel/toolchain/uClibc/uclibc.mk 2004-11-11 12:07:00.000000000 -0800
@@ -45,9 +45,9 @@
$(UCLIBC_DIR)/.configured: $(UCLIBC_DIR)/.unpacked
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR)/Rules.mak
ifeq ($(BR2_ENABLE_LOCALE),y)
- cp toolchain/uClibc/uClibc.config-locale $(UCLIBC_DIR)/.config
+ cp $(PROFILE_DIR)/config/uClibc.config-locale $(UCLIBC_DIR)/.config
else
- cp toolchain/uClibc/uClibc.config $(UCLIBC_DIR)/.config
+ cp $(PROFILE_DIR)/config/uClibc.config $(UCLIBC_DIR)/.config
endif
$(SED) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
$(UCLIBC_DIR)/.config
More information about the uClibc
mailing list