Ignore:
Timestamp:
Aug 8, 2010, 11:25:23 PM (8 years ago)
Author:
amain
Message:

Extend debian rootfs and prepare for second stage install using custom rcS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • debwrt/trunk/debian/rootfs/debian.mk

    r62 r65  
    1717
    1818DEBIAN_ROOTFS_INCLUDE_PACKAGES:=$(call qstrip,$(CONFIG_DEBIAN_ROOTFS_INCLUDE_PACKAGES))
     19DEBWRT_EXTRA_ROOTFS_FILES_DIR:=$(TOPDIR)/debian/rootfs/files
     20DEBWRT_MODULES_ARCHIVE=$(shell ls $(INSTALL_DIR)/debwrt-modules-*.tar.gz)
     21MODULES_VERSION=$(shell echo `basename $(DEBWRT_MODULES_ARCHIVE)` | awk -F '-' '{print $$6}')
    1922
    20 debian/rootfs: debian/rootfs/bootstrap debian/rootfs/debwrt-packages
     23debian/rootfs: debian/rootfs/bootstrap debian/rootfs/debwrt-packages debian/rootfs/unpack debian/rootfs/files-install debian/rootfs/modules-install
     24        touch $@
     25
     26debian/rootfs/install: debian/rootfs
     27        if [ -d /media/DEBWRT_ROOT ]; then \
     28                sudo rm -rf /media/DEBWRT_ROOT/*; \
     29                sudo bash -c "tar cf - -C $(ROOTFS_BUILD_DIR) . | tar xf - -C /media/DEBWRT_ROOT"; \
     30        fi
     31        #touch $@
     32
     33debian/rootfs/files-install: debian/rootfs/bootstrap
     34        if [ ! -f $(ROOTFS_BUILD_DIR)/etc/init.d/rcS.debian ]; then \
     35                sudo mv -v $(ROOTFS_BUILD_DIR)/etc/init.d/rcS $(ROOTFS_BUILD_DIR)/etc/init.d/rcS.debian; \
     36        fi
     37        sudo bash -c "tar cf - -C $(DEBWRT_EXTRA_ROOTFS_FILES_DIR) . | tar -xovf - -C $(ROOTFS_BUILD_DIR)"
     38        touch $@
     39
     40debian/rootfs/modules-install: debian/rootfs/bootstrap
     41ifneq ($(DEBWRT_MODULES_ARCHIVE),)
     42        sudo tar xof $(DEBWRT_MODULES_ARCHIVE) -C $(ROOTFS_BUILD_DIR)
     43        sudo depmod -a -b $(ROOTFS_BUILD_DIR) $(MODULES_VERSION)
     44endif
    2145        touch $@
    2246
     
    2852                     $(ROOTFS_BUILD_DIR) \
    2953                     $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
     54        touch $@
     55
     56debian/rootfs/unpack: debian/rootfs/bootstrap
     57        find $(ROOTFS_BUILD_DIR) -name "*.deb" | while read deb; do \
     58                n=`basename $$deb`; \
     59                echo -n "I: Extracting $${n}..."; \
     60                sudo bash -c "ar -p "$$deb" data.tar.gz | zcat | tar -C $(ROOTFS_BUILD_DIR) -xf -"; \
     61                echo "done"; \
     62        done
    3063        touch $@
    3164
     
    4780debian/rootfs/clean:
    4881        sudo rm -rf $(ROOTFS_BUILD_DIR)
    49         rm -rf debian/rootfs/debwrt-packages
    50         rm -rf debian/rootfs/bootstrap
    51         rm -rf debian/rootfs
     82        rm -f debian/rootfs/debwrt-packages
     83        rm -f debian/rootfs/bootstrap
     84        rm -f debian/rootfs/install
     85        rm -f debian/rootfs/files-install
     86        rm -g debian/rootfs/modules-install
    5287
Note: See TracChangeset for help on using the changeset viewer.