make ramdisk support generic, some cleanups

SVN-Revision: 3911
This commit is contained in:
Felix Fietkau 2006-06-07 23:59:04 +00:00
parent ce3f164ea0
commit de93bede13
8 changed files with 27 additions and 1529 deletions

View file

@ -20,7 +20,10 @@ LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/i386/' \
)
KERNEL_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
LINUX_DIR := $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
ifeq ($(LINUX_NAME),)
LINUX_NAME:=linux-$(LINUX_VERSION)
endif
LINUX_DIR := $(KERNEL_BUILD_DIR)/$(LINUX_NAME)
KMOD_BUILD_DIR := $(KERNEL_BUILD_DIR)/linux-modules
MODULES_DIR := $(KERNEL_BUILD_DIR)/modules/$(MODULES_SUBDIR)

View file

@ -14,10 +14,6 @@ include ../kernel.mk
$(LINUX_DIR)/.patched: $(LINUX_DIR)/.unpacked
[ -d ../generic-$(KERNEL)/patches ] && $(PATCH) $(LINUX_DIR) ../generic-$(KERNEL)/patches $(MAKE_TRACE)
[ -d ./patches ] && $(PATCH) $(LINUX_DIR) ./patches $(MAKE_TRACE)
ifeq ($(CONFIG_ARUBA_RAMDISK),y)
@$(CP) config-ramdisk $(LINUX_DIR)/.config
else
@$(CP) config $(LINUX_DIR)/.config
endif
touch $@

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@ endef
define Image/Prepare
cat $(KDIR)/vmlinux | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
$(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) compile
$(MAKE) -C ../generic/lzma-loader $(LOADER_MAKEOPTS) clean compile
endef
define Image/Build

View file

@ -1,4 +1,4 @@
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.bz2
LINUX_SOURCE:=$(LINUX_NAME).tar.bz2
LINUX_SITE=http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
http://www.us.kernel.org/pub/linux/kernel/v$(KERNEL) \
http://www.kernel.org/pub/linux/kernel/v$(KERNEL) \
@ -43,7 +43,22 @@ $(LINUX_DIR)/.configured: $(LINUX_DIR)/.patched
touch $@
endif
$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile pkg-install
ramdisk-config: $(LINUX_DIR)/.configured FORCE
mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.old
grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
echo 'CONFIG_INITRAMFS_SOURCE="../../root"' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_ROOT_UID=0' >> $(LINUX_DIR)/.config
echo 'CONFIG_INITRAMFS_ROOT_GID=0' >> $(LINUX_DIR)/.config
mkdir -p $(BUILD_DIR)/root/etc/init.d
$(CP) ../generic-2.6/files/init $(BUILD_DIR)/root/
$(CP) ../generic-2.6/files/init.d/S00initramfs $(BUILD_DIR)/root/etc/init.d/
else
rm -f $(BUILD_DIR)/root/init $(BUILD_DIR)/root/etc/init.d/S00initramfs
echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config
endif
$(LINUX_DIR)/vmlinux: $(STAMP_DIR)/.linux-compile pkg-install ramdisk-config
$(MAKE) -C $(LINUX_DIR) CROSS_COMPILE="$(KERNEL_CROSS)" ARCH=$(LINUX_KARCH) PATH=$(TARGET_PATH)
$(LINUX_KERNEL): $(LINUX_DIR)/vmlinux
@ -72,6 +87,7 @@ $(KERNEL_IPKG):
$(BUILD_DIR)/kernel.mk: $(LINUX_DIR) FORCE
echo "BOARD:=$(BOARD)" > $@
echo "LINUX_NAME:=$(LINUX_NAME)" >> $@
echo "LINUX_VERSION:=$(LINUX_VERSION)" >> $@
echo "LINUX_RELEASE:=$(LINUX_RELEASE)" >> $@

View file

@ -9,7 +9,10 @@ endif
MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)
LINUX_BUILD_DIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
LINUX_DIR := $(LINUX_BUILD_DIR)/linux-$(LINUX_VERSION)
ifeq ($(LINUX_NAME),)
LINUX_NAME:=linux-$(LINUX_VERSION)
endif
LINUX_DIR := $(LINUX_BUILD_DIR)/$(LINUX_NAME)
LINUX_KERNEL:=$(LINUX_BUILD_DIR)/vmlinux
LINUX_TARGET_DIR:=$(LINUX_BUILD_DIR)/root