2021-02-10 13:52:34 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2006-07-20 21:06:47 +00:00
|
|
|
#
|
2021-02-10 13:52:34 +00:00
|
|
|
# Copyright (C) 2006-2010 OpenWrt.org
|
|
|
|
|
2006-07-20 21:06:47 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
define Image/Prepare
|
|
|
|
cp $(LINUX_DIR)/linux $(KDIR)/vmlinux.elf
|
|
|
|
endef
|
|
|
|
|
2016-11-22 16:53:36 +00:00
|
|
|
define Image/Build/squashfs
|
|
|
|
dd if=/dev/zero of=$(KDIR)/root.squashfs bs=1024k count=0 seek=$(CONFIG_TARGET_ROOTFS_PARTSIZE)
|
|
|
|
endef
|
|
|
|
|
2006-07-20 21:06:47 +00:00
|
|
|
define Image/Build
|
2016-11-22 16:53:36 +00:00
|
|
|
$(call Image/Build/$(1))
|
2010-04-12 23:15:56 +00:00
|
|
|
cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
|
|
|
|
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux
|
2006-07-20 21:06:47 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|
2017-05-23 02:35:00 +00:00
|
|
|
|
|
|
|
# UML requires linking against several glibc static libraries: libutil, librt
|
|
|
|
# and libpthread, check that here. We do not check against libpthread
|
|
|
|
# specifically because getting something to build that references a libpthread
|
|
|
|
# symbol is pretty involved and Linux distributions package these 3 libraries
|
|
|
|
# in the same package.
|
|
|
|
|
|
|
|
$(eval $(call TestHostCommand,glibc-static, \
|
|
|
|
Please install a static glibc package. (Missing libutil.a, librt.a or libpthread.a), \
|
|
|
|
echo 'int main(int argc, char **argv) { login(0); timer_gettime(0, 0); return 0; }' | \
|
|
|
|
gcc -include utmp.h -x c -o $(TMP_DIR)/a.out - -static -lutil -lrt))
|