Merge branch 'moc' - kernel modules, flashrom and other enhancements.

This commit is contained in:
Trammell Hudson 2017-03-30 17:32:47 -04:00
commit 8343130e9a
Failed to extract signature
24 changed files with 721 additions and 226 deletions

171
Makefile
View File

@ -5,17 +5,33 @@ build := $(pwd)/build
config := $(pwd)/build
INSTALL := $(pwd)/install
log_dir := $(build)/log
initrd_lib_dir := initrd/lib
initrd_bin_dir := initrd/bin
# Controls how many parallel jobs are invoked in subshells
MAKE_JOBS ?= -j8 --max-load 24
# Create the log directory if it doesn't already exist
BUILD_LOG := $(shell [ -d "$(log_dir)" ] || mkdir "$(log_dir)")
BUILD_LOG := $(shell [ -d "$(log_dir)" ] || mkdir -p "$(log_dir)")
# If V is set in the environment, do not redirect the tee
# command to /dev/null.
ifeq "$V" ""
VERBOSE_REDIRECT := > /dev/null
# Not verbose, so we only show the header
define do =
@echo "$(DATE) $1 $2"
@$3
endef
else
# Verbose, so we display what we are doing
define do =
@echo "$(DATE) $1 $2"
$3
endef
endif
# Check that we have a correct version of make
LOCAL_MAKE_VERSION := $(shell $(MAKE) --version | head -1 | cut -d' ' -f3)
include modules/make
@ -40,16 +56,24 @@ heads_cc := $(INSTALL)/bin/musl-gcc \
CROSS := $(build)/../crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-
#heads_cc := $(HOME)/install/x86_64-linux-musl/x86_64-linux-musl/bin/gcc
all: $(BOARD).rom
# Disable all built in rules
.SUFFIXES:
FORCE:
# Timestamps should be in ISO format
DATE=`date --rfc-3339=seconds`
# Make helpers to operate on lists of things
define prefix =
$(foreach _, $2, $1$_)
endef
define map =
$(foreach _,$2,$(eval $(call $1,$_)))
endef
# Bring in all of the module definitions;
# these are the external pieces that will be downloaded and built
# as part of creating the Heads firmware image.
@ -59,10 +83,6 @@ include modules/*
# This increases the build time, so it is commented out for now
#all: $(foreach m,$(modules),$m.intermediate)
define prefix =
$(foreach _, $2, $1$_)
endef
define bins =
$(foreach m,$1,$(call prefix,$(build)/$($m_dir)/,$($m_output)))
endef
@ -94,14 +114,14 @@ define define_module =
( cd $(build)/$($1_dir) ; patch -p1 ) \
< patches/$1.patch; \
fi
touch "$$@"
@touch "$$@"
else
# Fetch and verify the source tar file
$(packages)/$($1_tar):
wget -O "$$@" $($1_url)
$(packages)/.$1_verify: $(packages)/$($1_tar)
echo "$($1_hash) $$^" | sha256sum --check -
touch "$$@"
@touch "$$@"
# Unpack the tar file and touch the canary so that we know
# that the files are all present
@ -111,24 +131,24 @@ define define_module =
( cd $(build)/$($1_dir) ; patch -p1 ) \
< patches/$1-$($1_version).patch; \
fi
touch "$$@"
@touch "$$@"
endif
ifeq "$($1_config)" ""
# There is no official .config file
$(build)/$($1_dir)/.config: $(build)/$($1_dir)/.canary
touch "$$@"
@touch "$$@"
else
# Copy the stored config file into the unpacked directory
$(build)/$($1_dir)/.config: config/$($1_config) $(build)/$($1_dir)/.canary
cp -a "$$<" "$$@"
$(call do,COPY,"$$<",cp -a "$$<" "$$@")
endif
# Use the module's configure variable to build itself
$(build)/$($1_dir)/.configured: \
$(build)/$($1_dir)/.canary \
$(build)/$($1_dir)/.config
@echo "$(DATE) Configuring $1"
@echo "$(DATE) CONFIG $1"
@( \
cd "$(build)/$($1_dir)" ; \
echo "$($1_configure)"; \
@ -138,7 +158,7 @@ define define_module =
2>&1 \
| tee "$(log_dir)/$1.configure.log" \
$(VERBOSE_REDIRECT)
touch "$$@"
@touch "$$@"
# All of the outputs should result from building the intermediate target
$(call outputs,$1): $1.intermediate
@ -151,7 +171,7 @@ define define_module =
$(foreach d,$($1_depends),$d.intermediate) \
$(foreach d,$($1_depends),$(call outputs,$d)) \
$(build)/$($1_dir)/.configured
@echo "$(DATE) Building $1"
@echo "$(DATE) MAKE $1"
@( \
echo "$(MAKE) \
-C \"$(build)/$($1_dir)\" \
@ -178,18 +198,16 @@ define define_module =
.INTERMEDIATE: $1.intermediate
endef
$(foreach _, $(modules), $(eval $(call define_module,$_)))
$(call map, define_module, $(modules))
initrd_lib_dir := initrd/lib
initrd_bin_dir := initrd/bin
#
# Install a file into the initrd, if it changed from
# the destination file.
#
define install =
@echo "$(DATE) Installing $2"
@cp -a "$1" "$2"
@-mkdir -p "$(dir $2)"
$(call do,INSTALL,$2,cp "$1" "$2")
endef
#
@ -198,72 +216,74 @@ endef
#
define initrd_bin_add =
$(initrd_bin_dir)/$(notdir $1): $1
@if [ ! -d "$(initrd_bin_dir)" ]; \
then mkdir -p "$(initrd_bin_dir)"; \
fi
$(call install,$$<,$$@)
$(call do,INSTALL-BIN,$$<,cp -a "$$<" "$$@")
@$(CROSS)strip "$$@" 2>&-; true
initrd_bins += $(initrd_bin_dir)/$(notdir $1)
endef
define initrd_lib_add =
$(initrd_lib_dir)/$(notdir $1): $1
@if [ ! -d "$(initrd_lib_dir)" ]; \
then mkdir -p "$(initrd_lib_dir)"; \
fi
$(call install,$$<,$$@)
@-mkdir -p "$(dir $$@)"
$(call do,INSTALL-LIB,$$@,$(CROSS)strip -o "$$@" "$$<")
initrd_libs += $(initrd_lib_dir)/$(notdir $1)
endef
$(foreach _, $(call bins,kexec), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,tpmtotp), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,pciutils), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,flashrom), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,cryptsetup), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,gpg), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call bins,lvm2), $(eval $(call initrd_bin_add,$_)))
$(foreach _, $(call libs,tpmtotp), $(eval $(call initrd_lib_add,$_)))
$(foreach _, $(call libs,mbedtls), $(eval $(call initrd_lib_add,$_)))
$(foreach _, $(call libs,qrencode), $(eval $(call initrd_lib_add,$_)))
$(foreach _, $(call libs,lvm2), $(eval $(call initrd_lib_add,$_)))
# Install the libraries for every module that we have built
$(foreach m, $(modules), $(call map,initrd_lib_add,$(call libs,$m)))
#$(foreach _, $(call outputs,xen), $(eval $(call initrd_bin,$_)))
# hack to install busybox into the initrd
initrd_bins += initrd/bin/busybox
initrd.cpio: busybox.intermediate
initrd_bins += $(initrd_bin_dir)/busybox
initrd/bin/busybox: $(build)/$(busybox_dir)/busybox
cmp --quiet "$@" "$^" || \
$(MAKE) \
$(initrd_bin_dir)/busybox: $(build)/$(busybox_dir)/busybox
$(do,SYMLINK,$@,$(MAKE) \
-C $(build)/$(busybox_dir) \
CC="$(heads_cc)" \
CONFIG_PREFIX="$(pwd)/initrd" \
$(MAKE_JOBS) \
install
install \
)
#
# hack to build cbmem from coreboot
# this must be built *AFTER* musl
initrd_bins += initrd/bin/cbmem
initrd/bin/cbmem: $(build)/$(coreboot_dir)/util/cbmem/cbmem
cp "$^" "$@"
# this must be built *AFTER* musl, but since coreboot depends on other things
# that depend on musl it should be ok.
#
initrd_bins += $(initrd_bin_dir)/cbmem
$(initrd_bin_dir)/cbmem: $(build)/$(coreboot_dir)/util/cbmem/cbmem
$(call install,$<,$@)
$(build)/$(coreboot_dir)/util/cbmem/cbmem: \
$(build)/$(coreboot_dir)/.canary \
musl.intermediate
@echo "$(DATE) Building cbmem"
@$(MAKE) -C "$(dir $@)" CC="$(heads_cc)"
$(call do,MAKE,cbmem,\
$(MAKE) -C "$(dir $@)" CC="$(heads_cc)" \
)
# Update all of the libraries in the initrd based on the executables
# that were installed.
initrd_lib_install: $(initrd_bins) $(initrd_libs)
-find initrd/bin -type f -a ! -name '*.sh' -print0 \
| xargs -0 $(CROSS)strip --preserve-dates
LD_LIBRARY_PATH="$(INSTALL)/lib" \
./populate-lib \
$(initrd_lib_dir) \
initrd/bin/* \
initrd/sbin/* \
-$(CROSS)strip $(initrd_lib_dir)/* ; true
#
# Linux kernel module installation
#
# This is special cases since we have to do a special strip operation on
# the kernel modules to make them fit into the ROM image.
#
define linux_module =
$(build)/$(linux_dir)/$1: linux.intermediate
initrd.cpio: $(initrd_lib_dir)/modules/$(notdir $1)
$(initrd_lib_dir)/modules/$(notdir $1): $(build)/$(linux_dir)/$1
@-mkdir -p "$(initrd_lib_dir)/modules"
$(call do,INSTALL-MODULE,$$@,$(CROSS)strip --strip-debug -o "$$@" "$$<")
endef
$(call map,linux_module,$(linux_modules))
#
@ -280,53 +300,58 @@ initrd_lib_install: $(initrd_bins) $(initrd_libs)
# unlikely that their device file has a different major/minor)
#
#
initrd.cpio: $(initrd_bins) $(initrd_libs) initrd_lib_install
initrd.cpio: $(initrd_bins) $(initrd_libs) dev.cpio FORCE
$(call do,CPIO,$@, \
cd ./initrd ; \
find . \
| cpio --quiet -H newc -o \
| ../cpio-clean ../dev.cpio - \
> "../$@"
> "../$@" \
)
initrd.intermediate: initrd.cpio
# populate the coreboot initrd image from the one we built.
# 4.4 doesn't allow this, but building from head does.
#$(call outputs,linux): initrd.cpio
#
# Compress the initrd into a xz file that can be included by coreboot.
# The extra options are necessary to let the Linux kernel decompress it.
#
coreboot.intermediate: $(build)/$(coreboot_dir)/initrd.cpio.xz
$(build)/$(coreboot_dir)/initrd.cpio.xz: initrd.cpio
$(call do,COMPRESS,$<,\
xz \
--check=crc32 \
--lzma2=dict=1MiB \
--extreme \
< "$<" \
> "$@"
> "$@" \
)
# hack for the coreboot to find the linux kernel
$(build)/$(coreboot_dir)/bzImage: $(build)/$(linux_dir)/arch/x86/boot/bzImage
@echo "$(DATE) Copying $@"
@cp -a "$^" "$@"
$(call do,COPY,$@,cp -a "$^" "$@")
coreboot.intermediate: $(build)/$(coreboot_dir)/bzImage
# The coreboot gcc won't work for us since it doesn't have libc
#XGCC := $(build)/$(coreboot_dir)/util/crossgcc/xgcc/
#export CC := $(XGCC)/bin/x86_64-elf-gcc
#export LDFLAGS := -L/lib/x86_64-linux-gnu
# Each board output has its own fixup required to turn the coreboot.rom
# into a flashable image.
# This produces a ROM image suitable for writing into the top chip;
# the x230.full.rom is suitable for our modified flashrom program.
x230.rom: $(build)/$(coreboot_dir)/x230/coreboot.rom
"$(build)/$(coreboot_dir)/$(BOARD)/cbfstool" "$<" print
dd if="$<" of="$@" bs=1M skip=8
$(RM) "$<"
$(call do,EXTRACT,$@,dd if="$<" of="$@" bs=1M skip=8)
@mv "$<" x230.full.rom
@sha256sum "$@"
qemu.rom: $(build)/$(coreboot_dir)/qemu/coreboot.rom
"$(build)/$(coreboot_dir)/$(BOARD)/cbfstool" "$<" print
mv "$<" "$@"
$(call do,EXTRACT,$@,mv "$<" "$@")
@sha256sum "$@"
clean-modules:
modules.clean:
for dir in \
$(busybox_dir) \
$(cryptsetup_dir) \
@ -357,14 +382,14 @@ all:
# How to download and build the correct version of make
$(HEADS_MAKE): $(build)/$(make_dir)/Makefile
make -C "`dirname $@`" $(MAKE_JOBS) \
make -C "$(dir $@)" $(MAKE_JOBS) \
2>&1 \
| tee "$(log_dir)/make.log" \
$(VERBOSE_REDIRECT)
$(build)/$(make_dir)/Makefile: $(packages)/$(make_tar)
tar xf "$<" -C build/
cd "`dirname $@`" ; ./configure \
cd "$(dir $@)" ; ./configure \
2>&1 \
| tee "$(log_dir)/make.configure.log" \
$(VERBOSE_REDIRECT)

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.25.0
# Tue Nov 29 14:28:46 2016
# Mon Mar 27 14:21:05 2017
#
CONFIG_HAVE_DOT_CONFIG=y
@ -617,7 +617,7 @@ CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
# CONFIG_IPCRM is not set
# CONFIG_IPCS is not set
CONFIG_LOSETUP=y
CONFIG_LSPCI=y
# CONFIG_LSPCI is not set
CONFIG_LSUSB=y
# CONFIG_MKSWAP is not set
# CONFIG_FEATURE_MKSWAP_UUID is not set
@ -774,20 +774,20 @@ CONFIG_TIME=y
# CONFIG_NAMEIF is not set
# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
# CONFIG_NBDCLIENT is not set
# CONFIG_NC is not set
# CONFIG_NC_SERVER is not set
# CONFIG_NC_EXTRA is not set
CONFIG_NC=y
CONFIG_NC_SERVER=y
CONFIG_NC_EXTRA=y
# CONFIG_NC_110_COMPAT is not set
# CONFIG_PING is not set
CONFIG_PING=y
# CONFIG_PING6 is not set
# CONFIG_FEATURE_FANCY_PING is not set
# CONFIG_WGET is not set
CONFIG_FEATURE_FANCY_PING=y
CONFIG_WGET=y
# CONFIG_FEATURE_WGET_STATUSBAR is not set
# CONFIG_FEATURE_WGET_AUTHENTICATION is not set
# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
# CONFIG_FEATURE_WGET_TIMEOUT is not set
# CONFIG_FEATURE_WGET_OPENSSL is not set
# CONFIG_FEATURE_WGET_SSL_HELPER is not set
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
CONFIG_FEATURE_WGET_TIMEOUT=y
CONFIG_FEATURE_WGET_OPENSSL=y
CONFIG_FEATURE_WGET_SSL_HELPER=y
# CONFIG_WHOIS is not set
# CONFIG_FEATURE_IPV6 is not set
# CONFIG_FEATURE_UNIX_LOCAL is not set
@ -821,12 +821,12 @@ CONFIG_TIME=y
# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
# CONFIG_FEATURE_HTTPD_PROXY is not set
# CONFIG_FEATURE_HTTPD_GZIP is not set
# CONFIG_IFCONFIG is not set
# CONFIG_FEATURE_IFCONFIG_STATUS is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
# CONFIG_FEATURE_IFCONFIG_SLIP is not set
# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
# CONFIG_FEATURE_IFCONFIG_HW is not set
# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
CONFIG_FEATURE_IFCONFIG_HW=y
CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y
# CONFIG_IFENSLAVE is not set
# CONFIG_IFPLUGD is not set
# CONFIG_IFUPDOWN is not set
@ -872,7 +872,7 @@ CONFIG_FEATURE_IP_ROUTE_DIR=""
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
# CONFIG_PSCAN is not set
# CONFIG_ROUTE is not set
CONFIG_ROUTE=y
# CONFIG_SLATTACH is not set
# CONFIG_TCPSVD is not set
# CONFIG_TELNET is not set
@ -902,15 +902,15 @@ CONFIG_FEATURE_IP_ROUTE_DIR=""
# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
CONFIG_DHCPD_LEASES_FILE=""
# CONFIG_UDHCPC is not set
# CONFIG_FEATURE_UDHCPC_ARPING is not set
# CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set
CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
# CONFIG_FEATURE_UDHCP_PORT is not set
CONFIG_UDHCP_DEBUG=0
# CONFIG_FEATURE_UDHCP_RFC3397 is not set
# CONFIG_FEATURE_UDHCP_8021Q is not set
CONFIG_UDHCPC_DEFAULT_SCRIPT=""
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=0
CONFIG_UDHCP_DEBUG=9
CONFIG_FEATURE_UDHCP_RFC3397=y
CONFIG_FEATURE_UDHCP_8021Q=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/sbin/config-dhcp.sh"
CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS=""
# CONFIG_UDPSVD is not set
# CONFIG_VCONFIG is not set

View File

@ -54,7 +54,7 @@ CONFIG_THREAD_INFO_IN_TASK=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION="-heads"
CONFIG_LOCALVERSION="-heads_moc"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
@ -143,7 +143,7 @@ CONFIG_ARCH_SUPPORTS_INT128=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_INITRAMFS_SOURCE="../../dev.cpio"
# CONFIG_RD_GZIP is not set
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
@ -169,7 +169,7 @@ CONFIG_PRINTK_NMI=y
CONFIG_BUG=y
CONFIG_PCSPKR_PLATFORM=y
# CONFIG_BASE_FULL is not set
# CONFIG_FUTEX is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
# CONFIG_SIGNALFD is not set
# CONFIG_TIMERFD is not set
@ -278,8 +278,8 @@ CONFIG_MODULES=y
# CONFIG_MODULE_COMPRESS is not set
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_BSGLIB is not set
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_BSGLIB=y
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_CMDLINE_PARSER is not set
@ -578,16 +578,47 @@ CONFIG_NET=y
#
# Networking options
#
# CONFIG_PACKET is not set
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
# CONFIG_UNIX is not set
# CONFIG_XFRM_USER is not set
# CONFIG_NET_KEY is not set
# CONFIG_INET is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
CONFIG_SYN_COOKIES=y
# CONFIG_NET_UDP_TUNNEL is not set
# CONFIG_NET_FOU is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
# CONFIG_INET_XFRM_MODE_BEET is not set
# CONFIG_INET_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NET_PTP_CLASSIFY is not set
CONFIG_NET_PTP_CLASSIFY=y
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
@ -600,10 +631,14 @@ CONFIG_NET=y
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_MPLS is not set
# CONFIG_HSR is not set
# CONFIG_NET_SWITCHDEV is not set
# CONFIG_NET_L3_MASTER_DEV is not set
# CONFIG_NET_NCSI is not set
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
@ -616,16 +651,20 @@ CONFIG_NET_FLOW_LIMIT=y
#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
# CONFIG_AF_KCM is not set
# CONFIG_STREAM_PARSER is not set
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
# CONFIG_LWTUNNEL is not set
# CONFIG_DST_CACHE is not set
@ -687,10 +726,7 @@ CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
#
# DRBD disabled because PROC_FS or INET not selected
#
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SKD is not set
# CONFIG_BLK_DEV_SX8 is not set
@ -700,6 +736,7 @@ CONFIG_BLK_DEV_RAM_SIZE=65536
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
# CONFIG_BLK_DEV_RSXX is not set
# CONFIG_BLK_DEV_NVME is not set
@ -822,12 +859,15 @@ CONFIG_SCSI_SCAN_ASYNC=y
#
# CONFIG_SCSI_SPI_ATTRS is not set
# CONFIG_SCSI_FC_ATTRS is not set
# CONFIG_SCSI_ISCSI_ATTRS is not set
CONFIG_SCSI_ISCSI_ATTRS=y
# CONFIG_SCSI_SAS_ATTRS is not set
# CONFIG_SCSI_SAS_LIBSAS is not set
# CONFIG_SCSI_SRP_ATTRS is not set
CONFIG_SCSI_LOWLEVEL=y
CONFIG_ISCSI_TCP=y
# CONFIG_ISCSI_BOOT_SYSFS is not set
# CONFIG_SCSI_CXGB3_ISCSI is not set
# CONFIG_SCSI_CXGB4_ISCSI is not set
# CONFIG_SCSI_BNX2_ISCSI is not set
# CONFIG_BE2ISCSI is not set
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
@ -926,7 +966,118 @@ CONFIG_DM_VERITY_FEC=y
# CONFIG_FIREWIRE is not set
# CONFIG_FIREWIRE_NOSY is not set
# CONFIG_MACINTOSH_DRIVERS is not set
# CONFIG_NETDEVICES is not set
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_FC is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_MACSEC is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_TUN is not set
# CONFIG_TUN_VNET_CROSS_LE is not set
# CONFIG_VETH is not set
# CONFIG_NLMON is not set
# CONFIG_ARCNET is not set
#
# CAIF transport drivers
#
#
# Distributed Switch Architecture drivers
#
CONFIG_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_NET_VENDOR_ADAPTEC is not set
# CONFIG_NET_VENDOR_AGERE is not set
# CONFIG_NET_VENDOR_ALTEON is not set
# CONFIG_ALTERA_TSE is not set
# CONFIG_NET_VENDOR_AMAZON is not set
# CONFIG_NET_VENDOR_AMD is not set
# CONFIG_NET_VENDOR_ARC is not set
# CONFIG_NET_VENDOR_ATHEROS is not set
# CONFIG_NET_VENDOR_AURORA is not set
# CONFIG_NET_CADENCE is not set
# CONFIG_NET_VENDOR_BROADCOM is not set
# CONFIG_NET_VENDOR_BROCADE is not set
# CONFIG_NET_VENDOR_CAVIUM is not set
# CONFIG_NET_VENDOR_CHELSIO is not set
# CONFIG_NET_VENDOR_CISCO is not set
# CONFIG_CX_ECAT is not set
# CONFIG_DNET is not set
# CONFIG_NET_VENDOR_DEC is not set
# CONFIG_NET_VENDOR_DLINK is not set
# CONFIG_NET_VENDOR_EMULEX is not set
# CONFIG_NET_VENDOR_EZCHIP is not set
# CONFIG_NET_VENDOR_EXAR is not set
# CONFIG_NET_VENDOR_HP is not set
CONFIG_NET_VENDOR_INTEL=y
# CONFIG_E100 is not set
CONFIG_E1000=m
CONFIG_E1000E=m
CONFIG_E1000E_HWTS=y
# CONFIG_IGB is not set
# CONFIG_IGBVF is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_IXGBEVF is not set
# CONFIG_I40E is not set
# CONFIG_I40EVF is not set
# CONFIG_FM10K is not set
# CONFIG_NET_VENDOR_I825XX is not set
# CONFIG_JME is not set
# CONFIG_NET_VENDOR_MARVELL is not set
# CONFIG_NET_VENDOR_MELLANOX is not set
# CONFIG_NET_VENDOR_MICREL is not set
# CONFIG_NET_VENDOR_MYRI is not set
# CONFIG_FEALNX is not set
# CONFIG_NET_VENDOR_NATSEMI is not set
# CONFIG_NET_VENDOR_NETRONOME is not set
# CONFIG_NET_VENDOR_NVIDIA is not set
# CONFIG_NET_VENDOR_OKI is not set
# CONFIG_ETHOC is not set
# CONFIG_NET_PACKET_ENGINE is not set
# CONFIG_NET_VENDOR_QLOGIC is not set
# CONFIG_NET_VENDOR_QUALCOMM is not set
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_NET_VENDOR_RENESAS is not set
# CONFIG_NET_VENDOR_RDC is not set
# CONFIG_NET_VENDOR_ROCKER is not set
# CONFIG_NET_VENDOR_SAMSUNG is not set
# CONFIG_NET_VENDOR_SEEQ is not set
# CONFIG_NET_VENDOR_SILAN is not set
# CONFIG_NET_VENDOR_SIS is not set
# CONFIG_SFC is not set
# CONFIG_NET_VENDOR_SMSC is not set
# CONFIG_NET_VENDOR_STMICRO is not set
# CONFIG_NET_VENDOR_SUN is not set
# CONFIG_NET_VENDOR_SYNOPSYS is not set
# CONFIG_NET_VENDOR_TEHUTI is not set
# CONFIG_NET_VENDOR_TI is not set
# CONFIG_NET_VENDOR_VIA is not set
# CONFIG_NET_VENDOR_WIZNET is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_NET_SB1000 is not set
# CONFIG_PHYLIB is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_USB_NET_DRIVERS is not set
# CONFIG_WLAN is not set
#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_VMXNET3 is not set
# CONFIG_FUJITSU_ES is not set
# CONFIG_ISDN is not set
# CONFIG_NVM is not set
#
@ -1159,7 +1310,15 @@ CONFIG_I2C_SLAVE=y
#
# PPS support
#
# CONFIG_PPS is not set
CONFIG_PPS=y
# CONFIG_PPS_DEBUG is not set
#
# PPS clients support
#
# CONFIG_PPS_CLIENT_KTIMER is not set
# CONFIG_PPS_CLIENT_LDISC is not set
# CONFIG_PPS_CLIENT_GPIO is not set
#
# PPS generators support
@ -1168,7 +1327,7 @@ CONFIG_I2C_SLAVE=y
#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set
CONFIG_PTP_1588_CLOCK=y
#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
@ -1449,14 +1608,14 @@ CONFIG_USB_DEFAULT_PERSIST=y
# USB Host Controller Drivers
#
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_XHCI_HCD=m
CONFIG_USB_XHCI_PCI=m
CONFIG_USB_XHCI_PLATFORM=m
CONFIG_USB_EHCI_HCD=m
# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_EHCI_PCI=m
CONFIG_USB_EHCI_HCD_PLATFORM=m
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
@ -1559,6 +1718,7 @@ CONFIG_USB_STORAGE=y
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_INFINIBAND is not set
CONFIG_EDAC_ATOMIC_SCRUB=y
CONFIG_EDAC_SUPPORT=y
# CONFIG_EDAC is not set
@ -1858,6 +2018,11 @@ CONFIG_ARCH_HAS_GIGANTIC_PAGE=y
# CONFIG_CONFIGFS_FS is not set
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y

9
initrd/bin/flashrom-x230.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
flashrom \
--force \
--noverify \
--programmer internal \
--layout /etc/x230-layout.txt \
--image BIOS \
-w "$*"

22
initrd/bin/wget-measure.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
# get a file and extend a TPM PCR
die() {
echo >&2 "$@"
exit 1
}
INDEX="$1"
URL="$2"
if [ -z "$INDEX" -o -z "$URL" ]; then
die "Usage: $0 pcr-index url"
fi
wget "$URL" || die "$URL: failed"
FILE="`basename "$URL"`"
tpm extend -ix "$INDEX" -if "$FILE" || die "$FILE: tpm extend failed"

View File

@ -0,0 +1,4 @@
00000000:00000FFF Descriptor
00001000:00002FFF GBe
00003000:004FFFFF ME
00800000:00BFFFFF BIOS

View File

@ -15,11 +15,6 @@ echo '|_| |_|\___|\__,_|\__,_|___/ (_) |_| \_\\___/|_| |_|'
echo ''
echo '====================================================='
echo
echo "Run './start-xen' to load the hypervisor"
echo "Run 'kexec -e' to boot it"
echo
# Load the date from the hardware clock, setting it in local time
hwclock -l -s
@ -33,7 +28,6 @@ if ! unsealtotp.sh ; then
fi
echo
# Start an interactive shell
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
exec /bin/ash

46
initrd/sbin/config-dhcp.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/sh
# udhcpc script
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
RESOLV_CONF="/etc/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"
case "$1" in
deconfig)
grep -q -v ip= /proc/cmdline
if [ $? -eq 0 ]; then
/sbin/ifconfig $interface up
fi
grep -q -v nfsroot= /proc/cmdline
if [ $? -eq 0 ]; then
/sbin/ifconfig $interface 0.0.0.0
fi
;;
renew|bound)
/sbin/ifconfig $interface $ip $BROADCAST $NETMASK
if [ -n "$router" ] ; then
echo "deleting routers"
while route del default gw 0.0.0.0 dev $interface ; do
:
done
for i in $router ; do
route add default gw $i dev $interface
done
fi
echo -n > $RESOLV_CONF
[ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
for i in $dns ; do
echo adding dns $i
echo nameserver $i >> $RESOLV_CONF
done
;;
esac
exit 0

29
initrd/sbin/insmod-measure.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh
# extend a TPM PCR with a module and then load it
# any arguments will also be measured
die() {
echo >&2 "$@"
exit 1
}
INDEX="$1"; shift
MODULE="$1"; shift
if [ -z "$INDEX" -o -z "$MODULE" ]; then
die "Usage: $0 pcr-index module [args...]"
fi
if [ ! -r "$MODULE" ]; then
die "$MODULE: not found?"
fi
tpm extend -ix "$INDEX" -if "$MODULE" || die "$MODULE: tpm extend failed"
if [ ! -z "$@" ]; then
TMPFILE=/tmp/insmod.$$
echo "$@" > $TMPFILE
tpm extend -ix "$INDEX" -if $TMPFILE || die "$MODULE: tpm extend on arguments failed"
fi
insmod "$MODULE" "$@" || die "$MODULE: insmod failed"

View File

@ -11,7 +11,7 @@ busybox_config := busybox.config
busybox_output := busybox
busybox_target := \
CC="$(heads_cc)" \
CONFIG_PREFIX="$(INSTALL)" \
CONFIG_PREFIX="../../initrd/" \
$(MAKE_JOBS) \
install

View File

@ -37,7 +37,7 @@ coreboot_output := $(BOARD)/coreboot.rom
# hack to force a build dependency on the cross compiler
$(build)/$(coreboot_dir)/.configured: $(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc
$(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc:
$(build)/$(coreboot_dir)/util/crossgcc/xgcc/bin/i386-elf-gcc: $(build)/$(coreboot_dir)/.canary
echo '******* Building crossgcc-i386 (this might take a while) ******'
$(MAKE) -C "$(build)/$(coreboot_dir)" crossgcc-i386
#echo '******* Building crossgcc-arm (this might take a while) ******'

View File

@ -30,4 +30,6 @@ cryptsetup_output := \
src/.libs/cryptsetup \
src/.libs/veritysetup \
cryptsetup_libraries := \
lib/.libs/libcryptsetup.so.4 \

47
modules/flashrom Normal file
View File

@ -0,0 +1,47 @@
modules += flashrom
flashrom_depends := pciutils $(musl_dep)
#flashrom_version := git
#flashrom_repo := https://github.com/osresearch/flashrom
flashrom_version := 0.9.9
flashrom_dir := flashrom-$(flashrom_version)
flashrom_tar := flashrom-$(flashrom_version).tar.bz2
flashrom_url := http://download.flashrom.org/releases/$(flashrom_tar)
flashrom_hash := cb3156b0f63eb192024b76c0814135930297aac41f80761a5d293de769783c45
flashrom_target := \
$(MAKE_JOBS) \
CC="$(heads_cc)" \
WARNERROR=no \
CONFIG_ENABLE_LIBUSB0_PROGRAMMERS=no \
CONFIG_ENABLE_LIBUSB1_PROGRAMMERS=no \
CONFIG_DUMMY=no \
CONFIG_RAYER_SPI=no \
CONFIG_NIC3COM=no \
CONFIG_GFXNVIDIA=no \
CONFIG_SATASII=no \
CONFIG_ATAHPT=no \
CONFIG_ATAVIA=no \
CONFIG_ATAPROMISE=no \
CONFIG_IT8212=no \
CONFIG_DRKAISER=no \
CONFIG_NICREALTEK=no \
CONFIG_NICNATSEMI=no \
CONFIG_NICINTEL=no \
CONFIG_NICINTEL_EEPROM=no \
CONFIG_NICINTEL_SPI=no \
CONFIG_OGP_SPI=no \
CONFIG_SATAMV=no \
CONFIG_BUSPIRATE_SPI=no \
CONFIG_SERPROG=no \
CONFIG_PONY_SPI=no \
CONFIG_LINUX_SPI=no \
flashrom_output := \
flashrom
flashrom_libraries := \
flashrom_configure :=

View File

@ -17,5 +17,5 @@ libuuid_target := $(MAKE_JOBS) && \
prefix="$(INSTALL)" \
install
libuuid_libraries := .libs/libuuid.so
libuuid_libraries := .libs/libuuid.so.1
libuuid_depends := $(musl_dep)

View File

@ -17,6 +17,16 @@ linux_configure := \
linux_output := arch/x86/boot/bzImage
linux_config := linux.config
linux_modules := \
drivers/net/ethernet/intel/e1000/e1000.ko \
drivers/net/ethernet/intel/e1000e/e1000e.ko \
drivers/usb/host/xhci-hcd.ko \
drivers/usb/host/ehci-platform.ko \
drivers/usb/host/ehci-hcd.ko \
drivers/usb/host/xhci-plat-hcd.ko \
drivers/usb/host/xhci-pci.ko \
drivers/usb/host/ehci-pci.ko \
EXTRA_FLAGS := -fdebug-prefix-map=$(pwd)=heads -gno-record-gcc-switches
linux_target := \
@ -29,7 +39,6 @@ linux_target := \
KBUILD_BUILD_TIMESTAMP="1970-00-00" \
KBUILD_BUILD_VERSION=0 \
-j $(MAKE_JOBS) \
bzImage
# We cross compile linux now
linux_depends := $(musl_dep)

View File

@ -25,7 +25,7 @@ lvm2_target := \
$(MAKE_JOBS) \
install_device-mapper \
#lvm2_libraries := libdm/libdevmapper.so
lvm2_libraries := libdm/libdevmapper.so.1.02
lvm2_output := tools/dmsetup

View File

@ -6,10 +6,10 @@ mbedtls_tar := mbedtls-$(mbedtls_version)-gpl.tgz
mbedtls_url := https://tls.mbed.org/download/$(mbedtls_tar)
mbedtls_hash := d01f2d5586a52055329d194d909103f445bd2d0b6b2b5f1c830fbf828ac6299f
mbedtls_libraries := \
library/libmbedcrypto.so.0 \
mbedtls_libraries := library/libmbedcrypto.so.0
mbedtls_configure :=
mbedtls_target := \
SHARED=1 \
DESTDIR=$(INSTALL) \

View File

@ -22,6 +22,8 @@ musl_configure := ./configure \
--enable-shared \
CC=$(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-gcc
musl_libraries := \
lib/libc.so \
musl_target := $(MAKE_JOBS) install

30
modules/pciutils Normal file
View File

@ -0,0 +1,30 @@
modules += pciutils
pciutils_depends := $(musl_dep)
#pciutils_version := git
#pciutils_repo := https://github.com/osresearch/pciutils
pciutils_version := 3.5.4
pciutils_dir := pciutils-$(pciutils_version)
pciutils_tar := pciutils-$(pciutils_version).tar.xz
pciutils_url := https://www.kernel.org/pub/software/utils/pciutils/$(pciutils_tar)
pciutils_hash := 64293c6ab9318c40ef262b76d87bd9097531759752bac556e50979b1e63cfe66
pciutils_target := \
$(MAKE_JOBS) \
CC="$(heads_cc)" \
ZLIB=no \
HWDB=no \
SHARED=yes \
PREFIX=$(INSTALL) \
install \
install-lib \
pciutils_output := \
lspci \
pciutils_libraries := \
../../install/lib/libpci.so.3 \
pciutils_configure :=

View File

@ -17,5 +17,6 @@ popt_target := $(MAKE_JOBS) \
prefix="$(INSTALL)" \
install
popt_libraries := ./libs/libpopt.so
popt_libraries := .libs/libpopt.so.0
popt_depends := $(musl_dep)

View File

@ -6,7 +6,7 @@ qrencode_tar := qrencode-$(qrencode_version).tar.gz
qrencode_url := https://fukuchi.org/works/qrencode/$(qrencode_tar)
qrencode_hash := e794e26a96019013c0e3665cb06b18992668f352c5553d0a553f5d144f7f2a72
qrencode_output := .libs/libqrencode.so.$(qrencode_version)
qrencode_libraries := .libs/libqrencode.so.3
qrencode_configure := ./configure \
CC="$(heads_cc)" \

View File

@ -2,10 +2,10 @@ modules += tpmtotp
tpmtotp_depends := mbedtls qrencode $(musl_dep)
#tpmtotp_version := git
#tpmtotp_repo := https://github.com/osresearch/tpmtotp
tpmtotp_version := git
tpmtotp_repo := https://github.com/osresearch/tpmtotp
tpmtotp_version := 0.2.1
#tpmtotp_version := 0.2.1
tpmtotp_dir := tpmtotp-$(tpmtotp_version)
tpmtotp_tar := tpmtotp-$(tpmtotp_version).tar.gz
tpmtotp_url := https://github.com/osresearch/tpmtotp/archive/v$(tpmtotp_version).tar.gz

View File

@ -0,0 +1,198 @@
diff -u --recursive ../clean/flashrom-0.9.9/board_enable.c flashrom-0.9.9/board_enable.c
--- ../clean/flashrom-0.9.9/board_enable.c 2016-03-13 11:16:30.000000000 -0400
+++ flashrom-0.9.9/board_enable.c 2017-03-30 16:50:21.727748288 -0400
@@ -2305,6 +2305,7 @@
/* first pci-id set [4], second pci-id set [4], dmi identifier, coreboot id [2], phase, vendor name, board name max_rom_... OK? flash enable */
#if defined(__i386__) || defined(__x86_64__)
+#if 0
{0x10DE, 0x0547, 0x147B, 0x1C2F, 0x10DE, 0x0548, 0x147B, 0x1C2F, NULL, NULL, NULL, P3, "abit", "AN-M2", 0, NT, nvidia_mcp_gpio2_raise},
{0x1106, 0x0282, 0x147B, 0x1415, 0x1106, 0x3227, 0x147B, 0x1415, "^AV8 ", NULL, NULL, P3, "abit", "AV8", 0, OK, board_abit_av8},
{0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, NULL /* "^I440BX-W977$" */, "abit", "bf6", P3, "abit", "BF6", 0, OK, intel_piix4_gpo26_lower},
@@ -2427,6 +2428,7 @@
{0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^SE440BX-2$", NULL, NULL, P3, "Intel", "SE440BX-2", 0, NT, intel_piix4_gpo27_lower},
{0x1022, 0x7468, 0, 0, 0x1022, 0x7460, 0, 0, NULL, "iwill", "dk8_htx", P3, "IWILL", "DK8-HTX", 0, OK, w83627hf_gpio24_raise_2e},
{0x8086, 0x27A0, 0x8086, 0x27a0, 0x8086, 0x27b8, 0x8086, 0x27b8, NULL, "kontron", "986lcd-m", P3, "Kontron", "986LCD-M", 0, OK, board_kontron_986lcd_m},
+#endif
{0x8086, 0x2917, 0x17AA, 0x20F5, 0x8086, 0x2930, 0x17AA, 0x20F9, "^ThinkPad T400", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T400", 0, OK, p2_whitelist_laptop},
{0x8086, 0x1E22, 0x17AA, 0x21F6, 0x8086, 0x1E55, 0x17AA, 0x21F6, "^ThinkPad T530", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T530", 0, OK, p2_whitelist_laptop},
{0x8086, 0x27a0, 0x17aa, 0x2015, 0x8086, 0x27b9, 0x17aa, 0x2009, "^ThinkPad T60", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad T60", 0, OK, p2_whitelist_laptop},
@@ -2435,6 +2437,7 @@
{0x8086, 0x3B07, 0x17AA, 0x2166, 0x8086, 0x3B30, 0x17AA, 0x2167, "^Lenovo X201", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X201", 0, OK, p2_whitelist_laptop},
{0x8086, 0x1E22, 0x17AA, 0x21FA, 0x8086, 0x1E55, 0x17AA, 0x21FA, "^ThinkPad X230", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X230", 0, OK, p2_whitelist_laptop},
{0x8086, 0x27A0, 0x17AA, 0x2017, 0x8086, 0x27B9, 0x17AA, 0x2009, "^ThinkPad X60", NULL, NULL, P2, "IBM/Lenovo", "ThinkPad X60(s)", 0, OK, p2_whitelist_laptop},
+#if 0
{0x8086, 0x2411, 0x8086, 0x2411, 0x8086, 0x7125, 0x0e11, 0xb165, NULL, NULL, NULL, P3, "Mitac", "6513WU", 0, OK, board_mitac_6513wu},
{0x8086, 0x8186, 0x8086, 0x8186, 0x8086, 0x8800, 0, 0, "^MSC Vertriebs GmbH$", NULL, NULL, P2, "MSC", "Q7-TCTC", 0, OK, p2_not_a_laptop},
{0x8086, 0x7190, 0, 0, 0x8086, 0x7110, 0, 0, "^MS-6163 (i440BX)$", NULL, NULL, P3, "MSI", "MS-6163 (MS-6163 Pro)", 0, OK, intel_piix4_gpo14_raise},
@@ -2470,6 +2473,7 @@
{0x1106, 0x3177, 0x1106, 0xAA01, 0x1106, 0x3123, 0x1106, 0xAA01, NULL, NULL, NULL, P3, "VIA", "EPIA M/MII/...", 0, OK, via_vt823x_gpio15_raise},
{0x1106, 0x0259, 0x1106, 0x3227, 0x1106, 0x3065, 0x1106, 0x3149, NULL, NULL, NULL, P3, "VIA", "EPIA-N/NL", 0, OK, via_vt823x_gpio9_raise},
#endif
+#endif
{ 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, P3, NULL, NULL, 0, NT, NULL}, /* end marker */
};
diff -u --recursive ../clean/flashrom-0.9.9/chipset_enable.c flashrom-0.9.9/chipset_enable.c
--- ../clean/flashrom-0.9.9/chipset_enable.c 2016-01-23 11:16:49.000000000 -0500
+++ flashrom-0.9.9/chipset_enable.c 2017-03-30 16:46:10.496413767 -0400
@@ -1482,6 +1482,7 @@
/* Please keep this list numerically sorted by vendor/device ID. */
const struct penable chipset_enables[] = {
#if defined(__i386__) || defined(__x86_64__)
+#if 0
{0x1002, 0x4377, OK, "ATI", "SB400", enable_flash_sb400},
{0x1002, 0x438d, OK, "AMD", "SB600", enable_flash_sb600},
{0x1002, 0x439d, OK, "AMD", "SB7x0/SB8x0/SB9x0", enable_flash_sb600},
@@ -1624,7 +1625,9 @@
{0x8086, 0x1e49, DEP, "Intel", "B75", enable_flash_pch7},
{0x8086, 0x1e4a, DEP, "Intel", "H77", enable_flash_pch7},
{0x8086, 0x1e53, NT, "Intel", "C216", enable_flash_pch7},
+#endif
{0x8086, 0x1e55, DEP, "Intel", "QM77", enable_flash_pch7},
+#if 0
{0x8086, 0x1e56, NT, "Intel", "QS77", enable_flash_pch7},
{0x8086, 0x1e57, DEP, "Intel", "HM77", enable_flash_pch7},
{0x8086, 0x1e58, NT, "Intel", "UM77", enable_flash_pch7},
@@ -1786,6 +1789,7 @@
{0x8086, 0x9d48, BAD, "Intel", "Sunrise Point (Skylake-U Premium)", NULL},
{0x8086, 0x9d46, BAD, "Intel", "Sunrise Point (Skylake-Y Premium)", NULL},
#endif
+#endif
{0},
};
diff -u --recursive ../clean/flashrom-0.9.9/flashchips.c flashrom-0.9.9/flashchips.c
--- ../clean/flashrom-0.9.9/flashchips.c 2016-03-13 11:16:30.000000000 -0400
+++ flashrom-0.9.9/flashchips.c 2017-03-30 16:44:00.474681255 -0400
@@ -33,7 +33,7 @@
* alphabetically sorted. Within families keep them in order of density.
*/
const struct flashchip flashchips[] = {
-
+#if 0
/*
* .vendor = Vendor name
* .name = Chip name
@@ -15902,6 +15902,7 @@
.feature_bits = 0,
.block_erasers = {},
},
+#endif
{
.vendor = "Programmer",
@@ -15925,6 +15926,7 @@
.read = read_opaque,
},
+#if 0
{
.vendor = "AMIC",
.name = "unknown AMIC SPI chip",
@@ -16085,6 +16087,7 @@
.probe = probe_spi_rems,
.write = NULL,
},
+#endif
{0}
};
diff -u --recursive ../clean/flashrom-0.9.9/flashrom.c flashrom-0.9.9/flashrom.c
--- ../clean/flashrom-0.9.9/flashrom.c 2016-02-22 03:59:27.000000000 -0500
+++ flashrom-0.9.9/flashrom.c 2017-03-30 16:06:35.121301300 -0400
@@ -1983,7 +1983,7 @@
uint8_t *newcontents;
int ret = 0;
unsigned long size = flash->chip->total_size * 1024;
- int read_all_first = 1; /* FIXME: Make this configurable. */
+ int read_all_first = 0; /* FIXME: Make this configurable. */
if (chip_safety_check(flash, force, read_it, write_it, erase_it, verify_it)) {
msg_cerr("Aborting.\n");
diff -u --recursive ../clean/flashrom-0.9.9/layout.c flashrom-0.9.9/layout.c
--- ../clean/flashrom-0.9.9/layout.c 2016-03-13 13:36:49.000000000 -0400
+++ flashrom-0.9.9/layout.c 2017-03-30 16:28:31.853958644 -0400
@@ -259,6 +259,7 @@
static int copy_old_content(struct flashctx *flash, int oldcontents_valid, uint8_t *oldcontents, uint8_t *newcontents, unsigned int start, unsigned int size)
{
+#if 0
if (!oldcontents_valid) {
/* oldcontents is a zero-filled buffer. By reading the current data into oldcontents here, we
* avoid a rewrite of identical regions even if an initial full chip read didn't happen. */
@@ -269,6 +270,7 @@
return 1;
}
}
+#endif
memcpy(newcontents + start, oldcontents + start, size);
return 0;
}
diff -u --recursive ../clean/flashrom-0.9.9/print.c flashrom-0.9.9/print.c
--- ../clean/flashrom-0.9.9/print.c 2016-03-13 11:16:30.000000000 -0400
+++ flashrom-0.9.9/print.c 2017-03-30 15:40:11.681082983 -0400
@@ -518,6 +518,7 @@
/* Please keep this list alphabetically ordered by vendor/board. */
const struct board_info boards_known[] = {
+#if 0
#if defined(__i386__) || defined(__x86_64__)
B("A-Trend", "ATC-6220", OK, "http://www.motherboard.cz/mb/atrend/atc6220.htm", NULL),
B("abit", "A-S78H", OK, NULL, NULL),
@@ -1140,12 +1141,13 @@
B("ZOTAC", "ZBOX AD02 (PLUS)", OK, NULL, NULL),
B("ZOTAC", "ZBOX HD-ID11", OK, NULL, NULL),
#endif
-
+#endif
{0},
};
/* Please keep this list alphabetically ordered by vendor/board. */
const struct board_info laptops_known[] = {
+#if 0
#if defined(__i386__) || defined(__x86_64__)
B("Acer", "Aspire 1520", OK, "http://support.acer.com/us/en/acerpanam/notebook/0000/Acer/Aspire1520/Aspire1520nv.shtml", NULL),
B("Acer", "Aspire One", BAD, NULL, "http://www.coreboot.org/pipermail/coreboot/2009-May/048041.html"),
@@ -1174,6 +1176,7 @@
//B("MSI", "GT60-2OD", OK, "http://www.msi.com/product/nb/GT60_2OD.html", NULL), requires layout patches
B("Teclast", "X98 Air 3G", OK, NULL, NULL),
#endif
+#endif
{0},
};
diff -u --recursive ../clean/flashrom-0.9.9/spi.c flashrom-0.9.9/spi.c
--- ../clean/flashrom-0.9.9/spi.c 2014-07-19 18:03:29.000000000 -0400
+++ flashrom-0.9.9/spi.c 2017-03-30 15:10:38.192254930 -0400
@@ -100,6 +100,20 @@
return spi_write_chunked(flash, buf, start, len, max_data);
}
+static int my_ffs(int x)
+{
+ int rc = 0;
+ while(x)
+ {
+ if (x & 1)
+ return rc;
+ rc++;
+ x >>= 1;
+ }
+
+ return 0;
+}
+
int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
unsigned int len)
{
@@ -119,7 +133,7 @@
/* Check if alignment is native (at least the largest power of two which
* is a factor of the mapped size of the chip).
*/
- if (ffs(flash->chip->total_size * 1024) > (ffs(addrbase) ? : 33)) {
+ if (my_ffs(flash->chip->total_size * 1024) > (my_ffs(addrbase) ? : 33)) {
msg_perr("Flash chip is not aligned natively in the allowed "
"access window.\n");
msg_perr("Read will probably return garbage.\n");

View File

@ -1,88 +0,0 @@
#!/usr/bin/perl
# Find all libraries for the executables
#
use warnings;
use strict;
use Data::Dumper;
use File::Copy;
use File::Basename;
my $dest = shift
or die "Usage: $0 dest-dir [programs...]\n";
my %libraries;
my %deps;
for my $file (@ARGV)
{
my @libs = `ldd "$file"`;
for (@libs)
{
if (/ not found/)
{
# check to see if it is already installed
my ($lib) = /^\s*(.*?)\s*=>/;
warn "$file: '$lib' $_"
unless -r "$dest/$lib";
next;
}
if (/ => ([^ ]+)/)
{
# Normal library
$libraries{$1}++;
push @{$deps{$file}}, $1;
}
elsif (/^\s+([^ ]+) \(/)
{
# Dynamic linker
$libraries{$1}++;
}
}
}
#print Dumper(\%libraries);
if(0)
{
print "$_: ", join(" ", @{$deps{$_}}), "\n"
for keys %deps;
print "\n";
}
unless( -d $dest )
{
system("mkdir", "-p", $dest)
and die "$dest: Unable to make directory: $!\n";
}
my $size = 0;
for my $lib (keys %libraries)
{
# skip vdso
next if $lib =~ /vdso/;
warn "$lib\n";
$size += -s $lib;
my $libname = basename $lib;
# my $dirname = dirname "$dest/$lib";
#
# unless( -d $dirname )
# {
# system("mkdir", "-p", $dirname)
# and die "$dirname: Unable to make directory: $!\n";
# }
my $dest_lib = "$dest/$libname";
copy $lib, $dest_lib
or die "$lib: Unable to copy: $!\n";
# make them executable because otherwise chroot barfs
system("chmod", "+x", $dest_lib);
}
print "Total size $size\n";
__END__