# busybox image for initramfs
#
#############################################################
+ifeq ($(strip $(BR2_PACKAGE_BUSYBOX_INITRAMFS)),y)
BUSYBOX_INITRAMFS_DIR:=$(BUSYBOX_DIR)-initramfs
BR2_INITRAMFS_DIR:=$(PROJECT_BUILD_DIR)/initramfs
+BB_INITRAMFS_TARGET:=$(IMAGE).initramfs_lst
$(BUSYBOX_INITRAMFS_DIR)/.unpacked: $(DL_DIR)/$(BUSYBOX_SOURCE)
rm -rf $(BUILD_DIR)/tmp $(BUSYBOX_INITRAMFS_DIR)
echo CONFIG_FALSE=y; \
echo CONFIG_GUNZIP=y; \
echo CONFIG_HALT=y; \
+ echo CONFIG_INIT=y; \
echo CONFIG_INSMOD=y; \
echo CONFIG_KILL=y; \
echo CONFIG_LN=y; \
echo CONFIG_FEATURE_CHECK_TAINTED_MODULE=n; \
echo CONFIG_FEATURE_2_4_MODULES=n; \
echo CONFIG_MOUNT=y; \
- echo CONFIG_MSH=y; \
- echo CONFIG_FEATURE_SH_IS_MSH=y; \
+ echo CONFIG_ASH=y; \
+ echo CONFIG_FEATURE_SH_IS_ASH=y; \
echo CONFIG_PS=y; \
echo CONFIG_READLINK=y; \
echo CONFIG_RMMOD=y; \
install
$(STRIP) $(STRIP_STRIP_ALL) $@
-$(PROJECT_BUILD_DIR)/.initramfs_done: $(BR2_INITRAMFS_DIR)/bin/busybox
+
+$(BB_INITRAMFS_TARGET): $(BR2_INITRAMFS_DIR)/bin/busybox
+ ln -fs bin/busybox $(PROJECT_BUILD_DIR)/initramfs/init
+ mkdir -p $(PROJECT_BUILD_DIR)/initramfs/etc
+ cat target/generic/target_busybox_skeleton/etc/inittab > \
+ $(PROJECT_BUILD_DIR)/initramfs/etc/inittab
+ rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
+ (echo "chown -R 0:0 $(PROJECT_BUILD_DIR)/initramfs"; \
+ echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(PROJECT_BUILD_DIR)/initramfs"; \
+ echo "$(CONFIG_SHELL) target/initramfs/gen_initramfs_list.sh -u 0 -g 0 $(PROJECT_BUILD_DIR)/initramfs > $(BB_INITRAMFS_TARGET)"; \
+ ) > $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
+ chmod +x $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
+ $(STAGING_DIR)/usr/bin/fakeroot -- \
+ $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
+ rm -f $(PROJECT_BUILD_DIR)/_fakeroot.$(notdir $(BB_INITRAMFS_TARGET))
+ touch -c $@
+
+$(PROJECT_BUILD_DIR)/.initramfs_done: $(BR2_INITRAMFS_DIR)/bin/busybox \
+ $(BB_INITRAMFS_TARGET)
touch $@
busybox-initramfs: uclibc $(PROJECT_BUILD_DIR)/.initramfs_done
busybox-initramfs-clean:
rm -f $(BUSYBOX_INITRAMFS_DIR)/busybox $(PROJECT_BUILD_DIR)/.initramfs_*
- rm -rf $(BR2_INITRAMFS_DIR)
+ rm -rf $(BR2_INITRAMFS_DIR) $(BB_INITRAMFS_TARGET)
-$(MAKE) -C $(BUSYBOX_INITRAMFS_DIR) clean
busybox-initramfs-dirclean:
rm -rf $(BUSYBOX_INITRAMFS_DIR) $(BR2_INITRAMFS_DIR) \
$(PROJECT_BUILD_DIR)/.initramfs_*
+endif
#############################################################
#
# Toplevel Makefile options
$(SED) '/INITRAMFS_ROOT_.ID/d' $(LINUX26_DIR)/.config
echo "CONFIG_INITRAMFS_ROOT_UID=0" >> $(LINUX26_DIR)/.config
echo "CONFIG_INITRAMFS_ROOT_GID=0" >> $(LINUX26_DIR)/.config
+endif
+ifeq ($(BR2_PACKAGE_BUSYBOX_INITRAMFS),y)
+ $(SED) '/CONFIG_INITRAMFS_SOURCE/d' $(LINUX26_DIR)/.config
+ echo "CONFIG_INITRAMFS_SOURCE=\"$(BB_INITRAMFS_TARGET)\"" >> \
+ $(LINUX26_DIR)/.config
+ $(SED) '/INITRAMFS_ROOT_.ID/d' $(LINUX26_DIR)/.config
+ echo "CONFIG_INITRAMFS_ROOT_UID=0" >> $(LINUX26_DIR)/.config
+ echo "CONFIG_INITRAMFS_ROOT_GID=0" >> $(LINUX26_DIR)/.config
endif
$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) oldconfig
touch $@
$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) prepare
touch $@
-$(LINUX26_KERNEL): $(LINUX26_DIR)/.depend_done
+$(LINUX26_KERNEL): $(INITRAMFS_TARGET) $(BB_INITRAMFS_TARGET) \
+ $(LINUX26_DIR)/.depend_done
$(MAKE) $(LINUX26_MAKE_FLAGS) LZMA="$(LZMA)" \
-C $(LINUX26_DIR) $(LINUX26_FORMAT)
cp -dpf $(LINUX26_DIR)/$(LINUX26_BINLOC) $(LINUX26_KERNEL)
$(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) menuconfig
-[ -f $(LINUX26_DIR)/.config ] && touch $(LINUX26_DIR)/.configured
-linux26: $(INITRAMFS_TARGET) $(LINUX26_KERNEL)
+linux26: $(LINUX26_KERNEL)
$(LINUX26_DIR)/.modules_installed: $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION)/modules.dep
touch $@