Commit 92831215 authored by Ryan Jackson's avatar Ryan Jackson

- Added dropbear (for development)

- Added iPOD, o745-reboot, and bsdlabel kernel patches
- Updated kernel config
parent faf13fd5
......@@ -11,6 +11,8 @@ BOOT_PATH = $(PWD)/boot
MODULES := busybox zlib linux dropbear testbed hdparm target_template
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 \
......@@ -35,6 +37,12 @@ $(MODULES):
$(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
......
This diff is collapsed.
--- linux-2.6.23.i686/arch/x86/kernel/reboot.c~ 2008-02-29 10:06:46.000000000 -0700
+++ linux-2.6.23.i686/arch/x86/kernel/reboot.c 2008-02-29 10:05:50.000000000 -0700
@@ -122,6 +122,15 @@
DMI_MATCH(DMI_BOARD_NAME, "0WF810"),
},
},
+ { /* Handle problems with rebooting on Dell Optiplex 745's SFF*/
+ .callback = set_bios_reboot,
+ .ident = "Dell OptiPlex 745",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
+ DMI_MATCH(DMI_BOARD_NAME, "0RF703"),
+ },
+ },
{ /* Handle problems with rebooting on Dell 2400's */
.callback = set_bios_reboot,
.ident = "Dell PowerEdge 2400",
--- linux-2.6.25/net/ipv4/Kconfig 2008-08-29 09:50:50.000000000 -0600
+++ linux-2.6.25-emulab/net/ipv4/Kconfig 2008-08-29 09:53:39.000000000 -0600
@@ -632,5 +632,11 @@
If unsure, say N.
+#
+# Emulab special
+#
+config ICMP_PINGOFDEATH
+ bool "ICMP: ICMP Ping-of-Death (Emulab)"
+
source "net/ipv4/ipvs/Kconfig"
--- linux-2.6.25/net/ipv4/icmp.c 2008-08-29 09:51:02.000000000 -0600
+++ linux-2.6.25-emulab/net/ipv4/icmp.c 2008-08-29 09:57:02.000000000 -0600
@@ -973,6 +973,67 @@
out:;
}
+#ifdef CONFIG_ICMP_PINGOFDEATH
+#include <linux/reboot.h>
+
+int sysctl_ipod_version = 2;
+int sysctl_ipod_enabled = 0;
+u32 sysctl_ipod_host = 0xffffffff;
+u32 sysctl_ipod_mask = 0xffffffff;
+char sysctl_ipod_key[32+1] = { "SETMETOSOMETHINGTHIRTYTWOBYTES!!" };
+#define IPOD_CHECK_KEY \
+ (sysctl_ipod_key[0] != 0)
+#define IPOD_VALID_KEY(d) \
+ (strncmp(sysctl_ipod_key, (char *)(d), strlen(sysctl_ipod_key)) == 0)
+
+static void icmp_ping_of_death(struct sk_buff *skb)
+{
+ struct icmphdr *icmph = icmp_hdr(skb);
+ struct iphdr *iph = ip_hdr(skb);
+ int doit = 0;
+
+#if 0
+ printk(KERN_INFO "IPOD: got type=6, code=%d, host=%u.%u.%u.%u\n", icmph->code, ntohs(iph->tot_len), NIPQUAD(iph->saddr));
+#endif
+
+ /*
+ * If IPOD not enabled or wrong ICMP code, ignore.
+ */
+ if (!sysctl_ipod_enabled || icmph->code != 6)
+ return;
+
+ /*
+ * First check the source address info.
+ * If host not set, ignore.
+ */
+ if (sysctl_ipod_host != 0xffffffff &&
+ (ntohl(iph->saddr) & sysctl_ipod_mask) == sysctl_ipod_host) {
+ /*
+ * Now check the key if enabled.
+ * If packet doesn't contain enough data or key
+ * is otherwise invalid, ignore.
+ */
+ if (IPOD_CHECK_KEY) {
+ if (pskb_may_pull(skb, sizeof(sysctl_ipod_key)-1) &&
+ IPOD_VALID_KEY(skb->data))
+ doit = 1;
+ } else {
+ doit = 1;
+ }
+ }
+
+ if (doit) {
+ sysctl_ipod_enabled = 0;
+ printk(KERN_CRIT "IPOD: reboot forced by %u.%u.%u.%u...\n",
+ NIPQUAD(iph->saddr));
+ machine_restart(NULL);
+ } else {
+ printk(KERN_WARNING "IPOD: from %u.%u.%u.%u rejected\n",
+ NIPQUAD(iph->saddr));
+ }
+}
+#endif
+
static void icmp_discard(struct sk_buff *skb)
{
}
@@ -1094,10 +1155,18 @@
.handler = icmp_redirect,
.error = 1,
},
+#ifdef CONFIG_ICMP_PINGOFDEATH
+ /* PING_OF_DEATH (6) */
+ [6] = {
+ .handler = icmp_ping_of_death,
+ .error = 1,
+ },
+#else
[6] = {
.handler = icmp_discard,
.error = 1,
},
+#endif
[7] = {
.handler = icmp_discard,
.error = 1,
--- linux-2.6.25/net/ipv4/sysctl_net_ipv4.c 2008-08-29 09:51:18.000000000 -0600
+++ linux-2.6.25-emulab/net/ipv4/sysctl_net_ipv4.c 2008-08-29 09:58:52.000000000 -0600
@@ -23,6 +23,14 @@
#include <net/cipso_ipv4.h>
#include <net/inet_frag.h>
+#ifdef CONFIG_ICMP_PINGOFDEATH
+extern int sysctl_ipod_version;
+extern int sysctl_ipod_enabled;
+extern u32 sysctl_ipod_host;
+extern u32 sysctl_ipod_mask;
+extern char sysctl_ipod_key[32+1];
+#endif
+
static int zero;
static int tcp_retr1_max = 255;
static int ip_local_port_range_min[] = { 1, 1 };
@@ -801,6 +809,49 @@
.strategy = &sysctl_intvec,
.extra1 = &zero
},
+#ifdef CONFIG_ICMP_PINGOFDEATH
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "icmp_ipod_version",
+ .data = &sysctl_ipod_version,
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .proc_handler = &proc_dointvec,
+ },
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "icmp_ipod_enabled",
+ .data = &sysctl_ipod_enabled,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "icmp_ipod_host",
+ .data = &sysctl_ipod_host,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "icmp_ipod_mask",
+ .data = &sysctl_ipod_mask,
+ .maxlen = sizeof(int),
+ .mode = 0644,
+ .proc_handler = &proc_dointvec,
+ },
+ {
+ .ctl_name = CTL_UNNUMBERED,
+ .procname = "icmp_ipod_key",
+ .data = sysctl_ipod_key,
+ .maxlen = sizeof(sysctl_ipod_key),
+ .mode = 0600,
+ .proc_handler = &proc_dostring,
+ .strategy = &sysctl_string,
+ },
+#endif
{ .ctl_name = 0 }
};
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.27.8
# Fri Dec 12 16:43:35 2008
# Tue Dec 16 17:16:40 2008
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
......@@ -354,6 +354,7 @@ CONFIG_INET_TCP_DIAG=y
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
CONFIG_ICMP_PINGOFDEATH=y
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
......
TOPDIR = $(PWD)
SOURCE_PATH = $(TOPDIR)/source
SCRIPTS_PATH = $(TOPDIR)/scripts
TOOLCHAIN_BUILD_PATH = $(TOPDIR)/toolchain_build
TARGET_BUILD_PATH = $(TOPDIR)/build
TARGET_PATH = $(TOPDIR)/target
TEMPLATE_PATH = $(TOPDIR)/target_template
TARGET_INITRAMFS = $(TOPDIR)/target.cpio.gz
FAKEROOT_ENVIRONMENT = $(TOPDIR)/$(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
BUILDROOT_PATH = $(TOPDIR)/buildroot
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment