Commit fe2d3261 authored by cvs2svn's avatar cvs2svn

This commit was manufactured by cvs2svn to create tag 'gtw-protogeni-config-

origin'.

Sprout from gtw-protogeni-config 2008-12-16 00:11:14 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'gtw-protogeni-'
Cherrypick from gtw-protogeni-config 2008-12-18 18:56:19 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'gtw-protogeni-':
    mfs/linux_mfs/variables.mk
    mfs/linux_mfs/source/linux/bsdlabel.patch
    mfs/linux_mfs/source/linux/dell_optiplex_745_reboot.patch
    mfs/linux_mfs/source/linux/ipod.patch
    mfs/linux_mfs/source/openssl/uclibc_timeb.patch
    delay/freebsd/ipfw_mods/ipfw-FreeBSD-4.10.patch
Cherrypick from gtw-protogeni-config 2008-12-23 19:38:41 UTC cvs2svn <admin@example.com> 'This commit was manufactured by cvs2svn to create branch 'gtw-protogeni-':
    mfs/linux_mfs/source/perl/sysv_ipc.patch
    mfs/linux_mfs/source/perl/Makefile
    mfs/linux_mfs/source/perl/makedepend.patch
    mfs/linux_mfs/source/perl/config.sh
    mfs/linux_mfs/source/perl/install_modules
Cherrypick from master 2008-12-23 21:35:59 UTC Ryan Jackson <rdjackso@flux.utah.edu> '*** empty log message ***':
    protogeni/scripts/getcacerts.in
    mfs/linux_mfs/Makefile
    protogeni/scripts/shutdownslice.in
    mfs/linux_mfs/source/buildroot/buildroot.config
    tmcd/tmcd.c
    tmcd/linux/GNUmakefile.in
    protogeni/scripts/initsite.in
    www/newproject.php3
    tmcd/freebsd/delaysetup
    mfs/linux_mfs/source/target_template/template/etc/init.d/S60frisbee
    event/delay-agent/main.h
    pxe/bootwhat.h
    protogeni/etc/protogeni.sql
    tmcd/linux/get_edd_map
    sql/database-migrate.txt
    os/imagezip/imagezip.c
    mfs/linux_mfs/source/busybox/busybox.config
    event/delay-agent/callback.c
    pxe/bootinfo_mysql.c
    tmcd/linux/rc.frisbee
    tbsetup/ptopgen.in
    www/beginexp_form.php3
    xmlrpc/emulabserver.py.in
    mfs/linux_mfs/source/linux/linux.config
    protogeni/scripts/gencrl.in
    os/imagezip/ntfs/libntfs/Makefile-linux.sa
    tmcd/linux/slicefix
    delay/freebsd/kmods/freebsd-410_Backfill.patch
    sql/database-create.sql
    mfs/linux_mfs/source/testbed/Makefile
    apache/httpd.conf.in
parent 0c52f791
......@@ -1329,7 +1329,7 @@ SSLVerifyClient none
# Reject the unencrypted certs that all users get.
<Location />
SSLRequire ( %{SSL_CLIENT_S_DN_OU} ne "sslxmlrpc" )
</Location />
</Location>
ScriptAlias /protogeni/xmlrpc/ch @prefix@/protogeni/xmlrpc/protogeni-ch.pl
ScriptAlias /protogeni/xmlrpc/cm @prefix@/protogeni/xmlrpc/protogeni-cm.pl
......
--- sbin/ipfw.orig/ipfw.c Fri Sep 17 11:14:50 2004
+++ sbin/ipfw/ipfw.c Fri Dec 5 16:15:10 2008
@@ -946,6 +946,7 @@
" pipeconfig:\n"
" {bw|bandwidth} <number>{bit/s|Kbit/s|Mbit/s|Bytes/s|KBytes/s|MBytes/s}\n"
" {bw|bandwidth} interface_name\n"
+" backfill <number>{bit/s|Kbit/s|Mbit/s|Bytes/s|KBytes/s|MBytes/s}\n"
" delay <milliseconds>\n"
" queue <size>{packets|Bytes|KBytes}\n"
" plr <fraction>\n"
@@ -1564,6 +1565,27 @@
pipe.bandwidth *= 8;
}
if (pipe.bandwidth < 0)
+ errx(EX_DATAERR,
+ "bandwidth too large");
+ av += 2;
+ ac -= 2;
+ } else if (!strncmp(*av, "backfill", len)) {
+ pipe.backfill =
+ strtoul(av[1], &end, 0);
+ if (*end == 'K'
+ || *end == 'k') {
+ end++;
+ pipe.backfill *=
+ 1000;
+ } else if (*end == 'M') {
+ end++;
+ pipe.backfill *=
+ 1000000;
+ }
+ if (*end == 'B'
+ || !strncmp(end, "by", 2))
+ pipe.backfill *= 8;
+ if (pipe.backfill < 0)
errx(EX_DATAERR,
"bandwidth too large");
av += 2;
diff -r -C 5 4.10/src/sys/netinet/ip_dummynet.c 4.10_Backfill/src/sys/netinet/ip_dummynet.c
*** 4.10/src/sys/netinet/ip_dummynet.c Wed Dec 10 11:06:42 2008
--- 4.10_Backfill/src/sys/netinet/ip_dummynet.c Wed Dec 10 11:07:31 2008
***************
*** 771,780 ****
--- 771,794 ----
q->len-- ;
q->len_bytes -= len ;
pkt->output_time = curr_time + p->delay ;
+ /*pramod-CHANGES:
+ // We encountered one of our dummy packets. Simply drop the packet.
+ // We do not want the dummy packets to be forwarded out of this
+ // delay node.
+ // Free the memory that we allocated for the packet.
diff -u -r /share/freebsd/4.10-release/src/sys/netinet/ip_dummynet.c /tmp/ip_dummynet.c
--- /share/freebsd/4.10-release/src/sys/netinet/ip_dummynet.c Tue Dec 30 05:28:09 2003
+++ /tmp/ip_dummynet.c Wed Dec 17 16:34:51 2008
@@ -513,6 +513,18 @@
pkt->output_time = curr_time + p->delay ;
+#ifdef DN_BACKFILL
+ /*
+ * Backfill dummy packet. The packet has served its purpose and we
+ * don't want to actually put it out on the wire, so drop it now.
+ */
+ if(pkt->isDummy)
+ {
+ m_freem(pkt->dn_m);
+ free(pkt, M_DUMMYNET);
+ return;
+ }
+
+
if (p->head == NULL)
p->head = pkt;
else
DN_NEXT(p->tail) = pkt;
p->tail = pkt;
***************
*** 1020,1029 ****
--- 1034,1144 ----
ready_event_wfq(p) ;
} else
transmit_event(p);
}
}
+
+ /*pramod-CHANGES: */
+
+ /* sweep pipes and insert dummy packets into BackFill 'enabled' ones */
+ for (pe = all_pipes; pe ; pe = pe->next )
+ {
+ if(pe->startBackFill)
+ {
+
+ int ticksElapsed;
+ struct dn_flow_queue *pipeQueue = pe->fs.rq[0];
+ int numPackets = 0;
+
+ if(pe->lastFillTick != 0)
+ ticksElapsed = curr_time - pe->lastFillTick;
+ else
+ {
+ ticksElapsed = 1;
+ }
+
+ pe->lastFillTick = curr_time;
+ pe->outStandingBackFillBits += ((pe->backfill*ticksElapsed)/hz);
+
+ /* Determine the number of full size packets required to be sent. */
+ numPackets = pe->outStandingBackFillBits/12000;
+ pe->outStandingBackFillBits %= 12000;
+
+ while(numPackets > 0)
+ {
+ struct mbuf *backFillBuf = NULL;
+ struct dn_pkt *backFillPkt = NULL;
+ int packetLen = 1500;
+
+ /* We filled up the entire queue with dummy packets..
+ // Assume that the rest of the backfill packets have
+ // been dropped. */
+ if ( pe->fs.flags_fs & DN_QSIZE_IS_BYTES)
+ {
+ if(pipeQueue->len_bytes > pipeQueue->fs->qsize)
+ break;
+ }
+ else
+ {
+ if(pipeQueue->len > pipeQueue->fs->qsize)
+ break;
+ }
+
+ backFillBuf = m_get(M_DONTWAIT,MT_DATA);
+
+ backFillPkt = (struct dn_pkt *)malloc(sizeof (*backFillPkt), M_DUMMYNET, M_NOWAIT|M_ZERO);
+
+
+ /*if ( backFillPkt != NULL && backFillBuf != NULL )*/
+ {
+ backFillPkt->hdr.mh_type = MT_TAG;
+ backFillPkt->hdr.mh_flags = PACKET_TAG_DUMMYNET;
+ DN_NEXT(backFillPkt) = NULL;
+ backFillPkt->dn_m = backFillBuf;
+ backFillPkt->isDummy = 1;
+
+ backFillBuf->m_nextpkt = NULL;
+ backFillBuf->m_pkthdr.len = packetLen;
+ }
+
+ if (pipeQueue->head == NULL)
+ pipeQueue->head = backFillPkt;
+ else
+ DN_NEXT(pipeQueue->tail) = backFillPkt;
+
+ pipeQueue->tail = backFillPkt;
+ pipeQueue->len++;
+ pipeQueue->len_bytes += packetLen;
+
+ /* If we reach this point the flow was previously idle, so we need
+ * to schedule it. */
+ if ( pipeQueue->head == backFillPkt ) /* flow was idle*/
+ {
+ /*
+ * Fixed-rate queue: just insert into the ready_heap.
+ */
+ dn_key t = 0 ;
+ if (pe->bandwidth)
+ t = SET_TICKS(backFillPkt, pipeQueue, pe);
+ pipeQueue->sched_time = curr_time ;
+ if (t == 0) /* must process it now */
+ ready_event( pipeQueue );
+ else
+ heap_insert(&ready_heap, curr_time + t , pipeQueue );
+ }
+
+ numPackets--;
+
+
+ }
+ }
+ }
+
+
+
+
+
/* sweep pipes trying to expire idle flow_queues */
for (pe = all_pipes; pe ; pe = pe->next )
if (pe->idle_heap.elements > 0 &&
DN_KEY_LT(pe->idle_heap.p[0].key, pe->V) ) {
struct dn_flow_queue *q = pe->idle_heap.p[0].object ;
***************
*** 1410,1419 ****
--- 1525,1544 ----
if ( q == NULL )
goto dropit ; /* cannot allocate queue */
/*
* update statistics, then check reasons to drop pkt
*/
+
+ /*pramod-CHANGES:
+ // If Backfill has been enabled for this pipe, we now
+ // have a queue to fill up. Start putting dummy packets
+ // into this queue from the next tick. */
+ if(fs->pipe->enableBackFill)
+ {
+ fs->pipe->startBackFill = 1;
+ }
+
q->tot_bytes += len ;
q->tot_pkts++ ;
if ( fs->plr && random() < fs->plr )
goto dropit ; /* random pkt drop */
if ( fs->flags_fs & DN_QSIZE_IS_BYTES) {
***************
*** 1857,1866 ****
--- 1982,1992 ----
x = malloc(sizeof(struct dn_pipe), M_DUMMYNET, M_NOWAIT | M_ZERO);
if (x == NULL) {
printf("dummynet: no memory for new pipe\n");
return ENOSPC;
}
+
x->pipe_nr = p->pipe_nr;
x->fs.pipe = x ;
/* idle_heap is the only one from which we extract from the middle.
*/
x->idle_heap.size = x->idle_heap.elements = 0 ;
***************
*** 1875,1892 ****
--- 2001,2029 ----
q->numbytes = 0;
}
splx(s);
}
+
s = splimp();
x->bandwidth = p->bandwidth ;
x->numbytes = 0; /* just in case... */
bcopy(p->if_name, x->if_name, sizeof(p->if_name) );
x->ifp = NULL ; /* reset interface ptr */
x->delay = p->delay ;
set_fs_parms(&(x->fs), pfs);
+ /*pramod-CHANGES: */
+ x->enableBackFill = 0;
+ x->startBackFill = 0;
+ x->backfill = p->backfill;
+ /*pramod-CHANGES: */
+ if(x->backfill > 0)
+ {
+ x->enableBackFill = 1;
+ /*x->lastFillTick = 0; */
+ }
if ( x->fs.rq == NULL ) { /* a new pipe */
r = alloc_hash(&(x->fs), pfs) ;
if (r) {
free(x, M_DUMMYNET);
***************
*** 1929,1938 ****
--- 2066,2076 ----
x = b;
}
s = splimp();
set_fs_parms(x, pfs);
+
if ( x->rq == NULL ) { /* a new flow_set */
r = alloc_hash(x, pfs) ;
if (r) {
free(x, M_DUMMYNET);
splx(s);
diff -r -C 5 4.10/src/sys/netinet/ip_dummynet.h 4.10_Backfill/src/sys/netinet/ip_dummynet.h
*** 4.10/src/sys/netinet/ip_dummynet.h Wed Dec 10 11:06:42 2008
--- 4.10_Backfill/src/sys/netinet/ip_dummynet.h Wed Dec 10 11:07:36 2008
***************
*** 139,148 ****
--- 139,150 ----
dn_key output_time; /* when the pkt is due for delivery */
struct ifnet *ifp; /* interface, for ip_output */
struct sockaddr_in *dn_dst ;
struct route ro; /* route, for ip_output. MUST COPY */
int flags ; /* flags, for ip_output (IPv6 ?) */
+ /* pramod-CHANGES */
+ int isDummy;
};
/*
* Overall structure of dummynet (with WF2Q+):
***************
*** 348,357 ****
--- 350,367 ----
char if_name[IFNAMSIZ];
struct ifnet *ifp ;
int ready ; /* set if ifp != NULL and we got a signal from it */
struct dn_flow_set fs ; /* used with fixed-rate flows */
+
+
+ /* pramod - CHANGES: */
+ long backfill;
+ int enableBackFill;
+ int startBackFill;
+ int outStandingBackFillBits;
+ dn_key lastFillTick;
};
#ifdef _KERNEL
typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */
typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */
+ if (pkt->isDummy) {
+ m_freem(pkt->dn_m);
+ free(pkt, M_DUMMYNET);
+ return;
+ }
+#endif
+
if (p->head == NULL)
p->head = pkt;
else
@@ -746,6 +758,93 @@
transmit_event(p);
}
}
+
+#ifdef DN_BACKFILL
+ /* sweep pipes and insert dummy packets into BackFill 'enabled' ones */
+ for (pe = all_pipes; pe ; pe = pe->next ) {
+ if (pe->startBackFill) {
+ int ticksElapsed;
+ struct dn_flow_queue *pipeQueue = pe->fs.rq[0];
+ int numPackets = 0;
+
+ if (pe->lastFillTick != 0)
+ ticksElapsed = curr_time - pe->lastFillTick;
+ else
+ ticksElapsed = 1;
+
+ pe->lastFillTick = curr_time;
+ pe->outStandingBackFillBits += ((pe->backfill*ticksElapsed) / hz);
+
+ /* Determine the number of full size packets to be sent. */
+ numPackets = pe->outStandingBackFillBits / 12000;
+ pe->outStandingBackFillBits %= 12000;
+
+ while (numPackets > 0) {
+ struct mbuf *backFillBuf = NULL;
+ struct dn_pkt *backFillPkt = NULL;
+ int packetLen = 1500;
+
+ /*
+ * We filled up the entire queue with dummy packets.
+ * Assume that the rest of the backfill packets have
+ * been dropped.
+ */
+ if (pe->fs.flags_fs & DN_QSIZE_IS_BYTES) {
+ if (pipeQueue->len_bytes > pipeQueue->fs->qsize)
+ break;
+ } else {
+ if (pipeQueue->len > pipeQueue->fs->qsize)
+ break;
+ }
+
+ backFillBuf = m_get(M_DONTWAIT, MT_DATA);
+
+ backFillPkt = (struct dn_pkt *)malloc(sizeof(*backFillPkt),
+ M_DUMMYNET, M_NOWAIT|M_ZERO);
+
+ /*if (backFillPkt != NULL && backFillBuf != NULL)*/
+ {
+ backFillPkt->hdr.mh_type = MT_TAG;
+ backFillPkt->hdr.mh_flags = PACKET_TAG_DUMMYNET;
+ DN_NEXT(backFillPkt) = NULL;
+ backFillPkt->dn_m = backFillBuf;
+ backFillPkt->isDummy = 1;
+
+ backFillBuf->m_nextpkt = NULL;
+ backFillBuf->m_pkthdr.len = packetLen;
+ }
+
+ if (pipeQueue->head == NULL)
+ pipeQueue->head = backFillPkt;
+ else
+ DN_NEXT(pipeQueue->tail) = backFillPkt;
+
+ pipeQueue->tail = backFillPkt;
+ pipeQueue->len++;
+ pipeQueue->len_bytes += packetLen;
+
+ /*
+ * If we reach this point the flow was previously idle,
+ * so we need to schedule it.
+ */
+ if (pipeQueue->head == backFillPkt) {
+ /* Fixed-rate queue: just insert into the ready_heap. */
+ dn_key t = 0 ;
+ if (pe->bandwidth)
+ t = SET_TICKS(backFillPkt, pipeQueue, pe);
+ pipeQueue->sched_time = curr_time ;
+ if (t == 0) /* must process it now */
+ ready_event(pipeQueue);
+ else
+ heap_insert(&ready_heap, curr_time + t, pipeQueue);
+ }
+
+ numPackets--;
+ }
+ }
+ }
+#endif
+
/* sweep pipes trying to expire idle flow_queues */
for (pe = all_pipes; pe ; pe = pe->next )
if (pe->idle_heap.elements > 0 &&
@@ -1132,6 +1231,17 @@
q = find_queue(fs, &(fwa->f_id));
if ( q == NULL )
goto dropit ; /* cannot allocate queue */
+
+#ifdef DN_BACKFILL
+ /*
+ * If Backfill has been enabled for this pipe, we now
+ * have a queue to fill up. Start putting dummy packets
+ * into this queue from the next tick.
+ */
+ if (fs->pipe->enableBackFill)
+ fs->pipe->startBackFill = 1;
+#endif
+
/*
* update statistics, then check reasons to drop pkt
*/
@@ -1578,6 +1688,15 @@
x->delay = p->delay ;
set_fs_parms(&(x->fs), pfs);
+#ifdef DN_BACKFILL
+ x->enableBackFill = 0;
+ x->startBackFill = 0;
+ x->backfill = p->backfill;
+ if (x->backfill > 0) {
+ x->enableBackFill = 1;
+ /*x->lastFillTick = 0; */
+ }
+#endif
if ( x->fs.rq == NULL ) { /* a new pipe */
r = alloc_hash(&(x->fs), pfs) ;
diff -u -r /share/freebsd/4.10-release/src/sys/netinet/ip_dummynet.h /tmp/ip_dummynet.h
--- /share/freebsd/4.10-release/src/sys/netinet/ip_dummynet.h Tue May 13 03:31:06 2003
+++ /tmp/ip_dummynet.h Wed Dec 17 16:35:35 2008
@@ -141,6 +141,9 @@
struct sockaddr_in *dn_dst ;
struct route ro; /* route, for ip_output. MUST COPY */
int flags ; /* flags, for ip_output (IPv6 ?) */
+ /* #ifdef DN_BACKFILL */
+ int isDummy ; /* this is a dummy packet */
+ /* #endif */
};
/*
@@ -350,8 +353,19 @@
int ready ; /* set if ifp != NULL and we got a signal from it */
struct dn_flow_set fs ; /* used with fixed-rate flows */
+
+ /* #ifdef DN_BACKFILL */
+ long backfill;
+ int enableBackFill;
+ int startBackFill;
+ int outStandingBackFillBits;
+ dn_key lastFillTick;
+ /* #endif */
};
+/* Argh, why are there internal fields in the user interface struct!? */
+#define DN_HAVE_BACKFILL 1
+
#ifdef _KERNEL
typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */
typedef void ip_dn_ruledel_t(void *); /* ip_fw.c */
......@@ -426,6 +426,10 @@ void set_link_params(int l_index, int blackhole, int p_which)
pipe.bandwidth = p_params->bw;
pipe.delay = p_params->delay;
#ifdef DN_HAVE_BACKFILL
pipe.backfill = p_params->backfill;
#endif
/* set the pipe number*/
pipe.pipe_nr = link_map[l_index].pipes[p_index];
......@@ -552,6 +556,7 @@ void set_link_params(int l_index, int blackhole, int p_which)
}
/* else DROPTAIL*/
/* now call setsockopt*/
if (setsockopt(s_dummy,IPPROTO_IP, IP_DUMMYNET_CONFIGURE, &pipe,sizeof pipe)
< 0)
......@@ -596,7 +601,17 @@ int get_new_link_params(int l_index, event_handle_t handle,
while((argvalue = strsep(&temp," \n"))){
if(strcmp(argtype,"BANDWIDTH")== 0){
#ifdef DN_HAVE_BACKFILL
/* Backfill parameters. */
if(strcmp(argtype,"BACKFILL")== 0){
link_map[l_index].params[p_num].backfill = atoi(argvalue) * 1000;
if (! gotpipe) {
link_map[l_index].params[1].backfill =
link_map[l_index].params[0].backfill;
}
} else
#endif
if(strcmp(argtype,"BANDWIDTH")== 0){
info("Bandwidth = %d\n", atoi(argvalue) * 1000);
link_map[l_index].params[p_num].bw = atoi(argvalue) * 1000;
if (! gotpipe) {
......
......@@ -111,6 +111,7 @@ typedef enum {
typedef struct {
int delay; /* pipe delay*/
int bw; /* pipe bw*/
int backfill; /*pramod-CHANGES, -add backfill to the pipe*/
double plr; /* queue loss rate*/
int q_size; /* queuq size in slots/bytes*/
structRed_params red_gred_params; /* red/gred params*/
......
SOURCE_PATH = $(PWD)/source
SCRIPTS_PATH = $(PWD)/scripts
TOOLCHAIN_BUILD_PATH = $(PWD)/toolchain_build
SOURCE_PATH = $(PWD)/source
TARGET_PATH = $(PWD)/target
TARGET_BUILD_PATH = $(PWD)/build
TARGET_PATH = $(PWD)/target
TEMPLATE_PATH = $(PWD)/target_template
TARGET_INITRAMFS = $(PWD)/target.cpio.gz
FAKEROOT_ENVIRONMENT = $(PWD)/$(BUILD)_fs_fakeroot.env
TARGET_CC = i386-linux-uclibc-gcc
TARGET_CFLAGS = -Os -mtune=i386 -march=i386
TARGET_MODULES = uclibc-install-target zlib-install-target busybox-install dropbear-install linux-modules-install openssl-install-target kexec-install tmcc-install imagezip-install frisbee-install e2fsprogs-install
TARGET_FS_SIZE = 13568
BUILDROOT_PATH = $(PWD)/buildroot
BUILDROOT_VERSION = 20080705
BINUTILS_VERSION = 2.18
GCC_VERSION = 4.2.4
UCLIBC_VERSION = 0.9.29
OPENSSL_VERSION = 0.9.7m
OPENSSL_PATH = $(TARGET_BUILD_PATH)/openssl-$(OPENSSL_VERSION)
DROPBEAR_VERSION = 0.51
DROPBEAR_PATH = $(TARGET_BUILD_PATH)/dropbear-$(DROPBEAR_VERSION)
E2FSPROGS_VERSION = 1.41.1
E2FSPROGS_PATH = $(TARGET_BUILD_PATH)/e2fsprogs-$(E2FSPROGS_VERSION)
BUSYBOX_VERSION = 1.11.0
BUSYBOX_PATH = $(TARGET_BUILD_PATH)/busybox-$(BUSYBOX_VERSION)
ZLIB_VERSION = 1.2.3
ZLIB_PATH = $(TARGET_BUILD_PATH)/zlib-$(ZLIB_VERSION)
FAKEROOT_VERSION = 1.8.1
FAKEROOT_PATH = $(TOOLCHAIN_BUILD_PATH)/fakeroot-$(FAKEROOT_VERSION)
GENEXT2FS_VERSION = 1.4.1
GENEXT2FS_PATH = $(TOOLCHAIN_BUILD_PATH)/genext2fs-$(GENEXT2FS_VERSION)
LINUX_VERSION = 2.6.25.9
LINUX_PATH = $(BUILDROOT_PATH)/toolchain_build_i386/linux-$(LINUX_VERSION)
KEXEC_VERSION = 20080324
KEXEC_PATH = $(TARGET_BUILD_PATH)/kexec-tools-$(KEXEC_VERSION)
STAGING_DIR = $(BUILDROOT_PATH)/build_i386/staging_dir/
#HOSTMAKE=make
#HOSTAR=ar
#HOSTAS=as
#HOSTCC=gcc
#HOSTCXX=g++
#HOSTLD=ld
#HOST_CFLAGS=-g -O2
#TOOLCHAIN_PATH="$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
CROSS_COMPILER_PREFIX=i386-linux-uclibc-
STRIPCMD=$(STAGING_DIR)/usr/bin/$(CROSS_COMPILER_PREFIX)strip
#CC=$(STAGING_DIR)/usr/bin/i386-linux-uclibc-gcc -Os -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include --sysroot=$(STAGING_DIR)/ -isysroot $(STAGING_DIR) -mtune=i386 -march=i386
# Hack for building uClibc -- it can't handle parallel make processes.
#MAKE1:=$(HOSTMAKE) MAKE="$(firstword $(HOSTMAKE)) -j1"
HOSTCC=gcc
HOST_CONFIGURE_OPTS=PATH=$(STAGING_DIR)/usr/bin:$(PATH) \
AR_FOR_BUILD="$(HOSTAR)" \
AS_FOR_BUILD="$(HOSTAS)" \
CC_FOR_BUILD="$(HOSTCC)" \
GCC_FOR_BUILD="$(HOSTCC)" \
CXX_FOR_BUILD="$(HOSTCXX)" \
LD_FOR_BUILD="$(HOSTLD)" \
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
AR_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ar \
AS_FOR_TARGET=$(CROSS_COMPILER_PREFIX)as \
LD_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ld \
NM_FOR_TARGET=$(CROSS_COMPILER_PREFIX)nm \
RANLIB_FOR_TARGET=$(CROSS_COMPILER_PREFIX)ranlib \
STRIP_FOR_TARGET=$(CROSS_COMPILER_PREFIX)strip \
OBJCOPY_FOR_TARGET=$(CROSS_COMPILER_PREFIX)objcopy
modules := $(addprefix $(SOURCE_PATH)/, buildroot busybox zlib dropbear linux fakeroot openssl kexec-tools testbed e2fsprogs)
build-env: toolchain build-env-libraries build-tools
build-env-libraries: zlib-install-sysroot openssl-install-sysroot
include $(addsuffix /Rules.mk,$(modules))
.PHONY: all root clean root-template-install toolchain build-tools build-env devices \
root-base root-install
all: toolchain
toolchain: buildroot-build
$(TARGET_PATH)/lib/libc.so.0: toolchain
SCRIPTS_PATH = $(PWD)/scripts
INITRAMFS_PATH = $(PWD)/initramfs.tmp
BUILDROOT_PATH = $(PWD)/buildroot
FAKEROOT_ENVIRONMENT = $(PWD)/fs_fakeroot.env
STAGING_DIR = $(PWD)/buildroot/build_i386/staging_dir
INITRAMFS = $(PWD)/initramfs.gz
BOOT_PATH = $(PWD)/boot
MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl wget perl
INSTALL_MODULES := $(addsuffix -install,$(MODULES))
EXTRACT_MODULES := $(addsuffix -extract,$(MODULES))
PATCH_MODULES := $(addsuffix -patch,$(MODULES))
CLEAN_MODULES := $(addsuffix -clean,$(MODULES))
.PHONY: all clean install root-template-install devices \
root-base root-install $(MODULES) $(INSTALL_MODULES) \
$(CLEAN_MODULES) initramfs
all: $(MODULES)
install: uclibc-install $(INSTALL_MODULES)
clean:
rm -rf $(TARGET_PATH)
rm -f $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)
rm -f $(INITRAMFS)
rm -rf $(TARGET_BUILD_PATH)
rm -rf $(BOOT_PATH)
$(MODULES):
$(MAKE) -C $(SOURCE_PATH)/$@ all
$(CLEAN_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -clean,,$@) clean
$(EXTRACT_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -extract,,$@) extract
$(PATCH_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -patch,,$@) patch
$(INSTALL_MODULES):
$(MAKE) -C $(SOURCE_PATH)/$(subst -install,,$@) install
$(TARGET_PATH)/lib/libc.so.0:
mkdir -p $(TARGET_PATH)/lib
cp -dpR $(BUILDROOT_PATH)/project_build_i386/uclibc/root/lib/* $(TARGET_PATH)/lib
uclibc-install-target: $(TARGET_PATH)/lib/libc.so.0
build-tools: fakeroot-install
uclibc-install: $(TARGET_PATH)/lib/libc.so.0
$(FAKEROOT_ENVIRONMENT):
touch $@
#target-base:
# $(SCRIPTS_PATH)/mk_basic_fs.sh $(TARGET_PATH)
# #rm -f $(FAKEROOT_ENVIRONMENT)
target-install: target-template-install $(TARGET_MODULES)
devices: $(FAKEROOT_ENVIRONMENT)
rm -rf $(TARGET_PATH)/dev
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
......@@ -122,19 +67,19 @@ permissions: $(FAKEROOT_ENVIRONMENT) devices target-install
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(TARGET_PATH)
target-initramfs:
initramfs: install
rm -rf $(INITRAMFS_PATH)
cp -dpR $(TARGET_PATH) $(INITRAMFS_PATH)
cat /dev/null > $(FAKEROOT_ENVIRONMENT)
rm -rf $(INITRAMFS_PATH)/dev
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/makedevs.sh \
$(SCRIPTS_PATH)/devices $(INITRAMFS_PATH)
$(STAGING_DIR)/usr/bin/fakeroot -s $(FAKEROOT_ENVIRONMENT) \
-i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/fixperms.sh $(INITRAMFS_PATH)
$(STAGING_DIR)/usr/bin/fakeroot -i $(FAKEROOT_ENVIRONMENT) \
$(SCRIPTS_PATH)/gen_initramfs.sh $(TARGET_PATH) $(TARGET_INITRAMFS)
target-template-install:
mkdir -p $(TARGET_PATH)
cp -dpR $(TEMPLATE_PATH)/* $(TARGET_PATH)
target: target-install devices permissions