Changeset 307 for trunk/debian/buildenv


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/buildenv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/buildenv

    • Property svn:ignore
      •  

        old new  
        44prepare
        55create
         6build
         7qemu
  • trunk/debian/buildenv/debian.mk

    r275 r307  
    2222SB2E:=sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c "export LC_ALL=C; cd $(SB2_ARCH)-lenny && sb2 -e"
    2323SB2EF:=sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c "export LC_ALL=C; cd $(SB2_ARCH)-lenny && sb2 -eR"
     24QEMU_BIN=$(DEBIAN_BUILD_DIR)/usr/local/bin/qemu-$(TARGET_ARCH)
     25QEMU_BIN_STATIC=$(QEMU_BIN)-static
     26QEMU_INTERPRETER=$(shell cat /proc/sys/fs/binfmt_misc/qemu-$(TARGET_ARCH) | grep interpreter | awk '{print $$2}')
    2427
    2528sb2:
     
    3740
    3841#debian/buildenv/create: debian/buildenv/prepare debian/buildenv/qemu-build debian/buildenv/scratchbox-prepare
    39 debian/buildenv/create: debian/buildenv/prepare debian/buildenv/emdebian-prepare
     42debian/buildenv/create: debian/buildenv/prepare debian/buildenv/emdebian-prepare debian/buildenv/qemu-build
    4043        touch $@
    4144
     
    5255                                                $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
    5356        sudo bash -c "echo 127.0.0.1 `hostname -s` localhost >$(DEBIAN_BUILD_DIR)/etc/hosts"
    54         sudo bash -c "echo debwrt-$(call qstrip,$(CONFIG_ARCH))-$(DEBIAN_BUILD_VERSION) > $(DEBIAN_BUILD_DIR)/etc/debian_chroot"
     57        sudo bash -c "echo debwrt-$(TARGET_ARCH)-$(DEBIAN_BUILD_VERSION) > $(DEBIAN_BUILD_DIR)/etc/debian_chroot"
    5558        sudo bash -c "echo syntax on >$(DEBIAN_BUILD_DIR)/etc/vimrc"
    5659        sudo bash -c "echo 0 > /proc/sys/vm/mmap_min_addr" # for ARM targets
     
    103106        touch $@
    104107
     108debian/buildenv/qemu: debian/buildenv/qemu-prepare debian/buildenv/qemu-build
     109        touch $@
     110
     111debian/buildenv/qemu-clean:
     112        rm -rf $(DEBIAN_BUILD_DIR)/usr/src/qemu
     113        rm -f debian/buildenv/qemu-prepare
     114        rm -f debian/buildenv/qemu-build
     115
    105116debian/buildenv/qemu-prepare:
    106         sudo chroot $(DEBIAN_BUILD_DIR) bash -c "cd /usr/src && wget http://download.savannah.gnu.org/releases/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.gz && tar xzf qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.gz"
     117        $(CHROOT) bash -c "export LC_ALL=C; apt-get -y install libglib2.0-dev"
     118        mkdir -p $(DEBIAN_BUILD_DIR)/usr/src/qemu
     119        wget -O $(DEBIAN_BUILD_DIR)/usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.gz http://download.savannah.gnu.org/releases/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.gz
     120        tar xzf $(DEBIAN_BUILD_DIR)/usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)).tar.gz -C $(DEBIAN_BUILD_DIR)/usr/src/qemu
    107121        touch $@
    108122
    109123debian/buildenv/qemu-build: debian/buildenv/qemu-prepare
    110         sudo chroot $(DEBIAN_BUILD_DIR) bash -c "cd /usr/src/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && ./configure --target-list=$(SB2_ARCH)-linux-user && make && make install"
     124        $(CHROOT_USER) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && ./configure --static --target-list=$(TARGET_ARCH)-linux-user && make"
     125        $(CHROOT) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make install"
     126        $(CHROOT) cp /usr/local/bin/qemu-$(TARGET_ARCH) /usr/local/bin/qemu-$(TARGET_ARCH)-static
     127        $(CHROOT_USER) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && ./configure --target-list=$(TARGET_ARCH)-linux-user && make"
     128        $(CHROOT) bash -c "cd /usr/src/qemu/qemu-$(call qstrip,$(CONFIG_DEBIAN_BUILDENV_QEMU_VERSION)) && make install"
    111129        touch $@
    112130
     
    117135        sudo chroot $(DEBIAN_BUILD_DIR) su - $(USER) -c bash -c  "cd $(SB2_ARCH)-lenny && sb2 -eR ./debootstrap/debootstrap --second-stage"
    118136
    119 debian/buildenv/clean:
     137debian/buildenv/clean: debian/buildenv/qemu-clean
    120138        # sudo should not be needed if fakechroot would have worked
    121139        sudo rm -rf $(DEBIAN_BUILD_DIR)
     
    124142        rm -f debian/buildenv/qemu-build
    125143
    126 .PHONY: debian/clean
     144.PHONY: debian/buildenv/clean
    127145
Note: See TracChangeset for help on using the changeset viewer.