source: trunk/openwrt/target/linux/fonera2n/image/Makefile @ 1747

Last change on this file since 1747 was 1747, checked in by matthijs, 9 years ago

Create an empty opkg dir in the images.

This makes it a bit easier for people to actually use opkg on the Fonera (this
prevents the "Could not obtain administrative lock" error from opkg).

File size: 1.3 KB
Line 
1#
2# Copyright (C) 2008 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7include $(TOPDIR)/rules.mk
8include $(INCLUDE_DIR)/image.mk
9
10define Image/Prepare
11        rm -rf $(TARGET_DIR)/usr/lib/opkg
12        rm -rf $(TARGET_DIR)/usr/lib/ikpg
13        # Create an empty opkg dir, to make it easier to use opkg on the
14        # Fonera.
15        mkdir -p $(TARGET_DIR)/usr/lib/opkg
16        for a in `grep usr/bin/lua $(TARGET_DIR)/etc/fonstated/*| cut -d: -f1`; do \
17                ${STAGING_DIR_HOST}/bin/luac -s -o $$$${a}.tmp $$$$a; \
18                echo '#!/usr/bin/lua' > $$$$a; \
19                cat $$$${a}.tmp >> $$$$a; \
20                rm $$$${a}.tmp; \
21        done
22        chmod a+x  $(TARGET_DIR)/etc/fonstated/*
23endef
24
25define Image/BuildKernel
26        $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux -lc1 -lp2 -pb2 $(KDIR)/vmlinux.lzma
27        mkimage -A mips -O linux -T kernel -a 80000000 -C lzma -e \
28                0x80000000 \
29                -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
30                -d $(KDIR)/vmlinux.lzma $(KDIR)/uImage.lzma
31endef
32
33define Image/Build/squashfs
34        # Align and append a JFFS marker
35        $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
36endef
37
38define Image/Build
39        $(call Image/Build/$(1),$(1))
40        ( \
41                dd if=$(KDIR)/uImage.lzma bs=1024k conv=sync; \
42                dd if=$(KDIR)/root.$(1) bs=65536 conv=sync; \
43        ) > $(BIN_DIR)/openwrt-$(BOARD)-$(1).img
44endef
45
46$(eval $(call BuildImage))
Note: See TracBrowser for help on using the repository browser.