Changeset 307 for trunk/debian/rootfs


Ignore:
Timestamp:
Aug 16, 2011, 11:00:33 PM (8 years ago)
Author:
amain
Message:

debian/buildenv/rootfs: execute second stage install with qemu - fixes ticket:138

Location:
trunk/debian/rootfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/rootfs

    • Property svn:ignore
      •  

        old new  
        66clean-rootfs-dir
        77debwrt-packages
        8 
        98bootstrap
         9second-stage-qemu
  • trunk/debian/rootfs/debian.mk

    r303 r307  
    1717
    1818DEBIAN_ROOTFS_INCLUDE_PACKAGES:=$(call qstrip,$(CONFIG_DEBIAN_ROOTFS_INCLUDE_PACKAGES))
     19DEBIAN_ROOTFS_QEMU_2ND_STAGE:=$(call qstrip, $(CONFIG_DEBIAN_ROOTFS_QEMU_2ND_STAGE))
    1920DEBWRT_EXTRA_ROOTFS_FILES_DIR:=$(TOPDIR)/debian/rootfs/files
    2021DEBWRT_MODULES_ARCHIVE=$(shell ls $(INSTALL_DIR)/debwrt-modules-*.tar.gz 2>/dev/null)
    2122MODULES_VERSION=$(shell echo `basename $(DEBWRT_MODULES_ARCHIVE) 2>/dev/null` | awk -F '-' '{print $$6}')
    2223
    23 debian/rootfs: debian/rootfs/bootstrap debian/rootfs/unpack debian/rootfs/files-install debian/rootfs/debwrt-packages debian/rootfs/modules-install debian/rootfs/post-setup
     24chr: debian/rootfs/qemu-check
     25        @sudo bash -c "echo "debwrt-$(TARGET_ARCH)" > $(ROOTFS_BUILD_DIR)/etc/debian_chroot"
     26        @sudo cp $(ROOTFS_BUILD_DIR)/etc/resolv.conf $(ROOTFS_BUILD_DIR)/etc/resolv.conf_debwrt
     27        @sudo bash -c "cat /etc/resolv.conf | grep nameserver >$(ROOTFS_BUILD_DIR)/etc/resolv.conf"
     28        @sudo chroot $(ROOTFS_BUILD_DIR)
     29        @sudo rm -f $(ROOTFS_BUILD_DIR)$(QEMU_INTERPRETER)
     30        @sudo rm -f $(ROOTFS_BUILD_DIR)/debian_chroot
     31        @sudo cp $(ROOTFS_BUILD_DIR)/etc/resolv.conf_debwrt $(ROOTFS_BUILD_DIR)/etc/resolv.conf
     32
     33debian/rootfs/qemu-check:
     34        @if [ ! -x $(QEMU_BIN_STATIC) ]; then echo "E: can't find qemu ($(QEMU_BIN_STATIC))"; fi
     35        @if [ ! -e /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH) ]; then echo "E: can't find binfmt_misc qemu-$(TARGET_ARCH) ( /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH)).\nE: install qemu-user-static, or\nE: disable second stage with qemu with menuconfig (DEBIAN_ROOTFS_QEMU_2ND_STAGE)."; fi
     36        @if [ ! -x $(QEMU_BIN_STATIC) -o ! -e /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH) ]; then echo "E: abort"; exit 1; fi
     37        @sudo cp $(QEMU_BIN_STATIC) $(ROOTFS_BUILD_DIR)$(QEMU_INTERPRETER)
     38        @if ! sudo chroot $(ROOTFS_BUILD_DIR) /bin/ls >/dev/null; then echo "E: qemu can't execute binaries for $(TARGET_ARCH)"; echo "E: abort"; exit 1; fi
     39
     40debian/rootfs: debian/rootfs/bootstrap         \
     41               debian/rootfs/unpack            \
     42               debian/rootfs/files-install     \
     43               debian/rootfs/debwrt-packages   \
     44               debian/rootfs/modules-install   \
     45               debian/rootfs/post-setup        \
     46               debian/rootfs/second-stage-qemu \
    2447        touch $@
    2548
     
    109132        touch $@
    110133
     134ifeq ($(DEBIAN_ROOTFS_QEMU_2ND_STAGE),y)
     135debian/rootfs/second-stage-qemu: debian/rootfs/bootstrap debian/buildenv/qemu-build debian/rootfs/qemu-check
     136        sudo chroot $(ROOTFS_BUILD_DIR) /debootstrap/debootstrap --second-stage
     137        sudo chroot $(ROOTFS_BUILD_DIR) /usr/sbin/PostInstall && sudo rm -f $(ROOTFS_BUILD_DIR)/usr/sbin/PostInstall
     138        sudo rm -f $(ROOTFS_BUILD_DIR)$(QEMU_INTERPRETER)
     139else
     140debian/rootfs/second-stage-qemu: debian/rootfs/bootstrap debian/buildenv/qemu-build
     141        @echo "I: Qemu 2nd stage install disabled. Second stage needs now to be performend on the target device itself."
     142        @echo "I: Qemu 2nd stage install can be enabled using menuconfig (DEBIAN_ROOTFS_QEMU_2ND_STAGE)."
     143endif
     144        touch $@
     145
    111146debian/rootfs/clean:
    112147        sudo rm -rf $(ROOTFS_BUILD_DIR)
Note: See TracChangeset for help on using the changeset viewer.