-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile.build
More file actions
137 lines (126 loc) · 7.17 KB
/
Makefile.build
File metadata and controls
137 lines (126 loc) · 7.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
KERNEL_VERSION = 3.10.0-1127.19.1.el7.x86_64
INAUGURATOR_VERSION=$(shell python setup.py --version)
PYTHON_DIST_FILENAME=dist/inaugurator-${INAUGURATOR_VERSION}.linux-x86_64.tar.gz
KERNEL_IMAGE_PATH=/boot/vmlinuz-$(KERNEL_VERSION)
.PHONY: build
build: build/inaugurator.vmlinuz build/inaugurator.thin.initrd.img build/inaugurator.fat.initrd.img ${PYTHON_DIST_FILENAME}
build/inaugurator.vmlinuz: $(KERNEL_IMAGE_PATH)
-@mkdir $(@D)
cp $(KERNEL_IMAGE_PATH) $@
build/inaugurator.%.initrd.img: build/inaugurator.%.initrd.dir
( cd $< ; find . | cpio -o -H newc ) | gzip -9 > $@.tmp
cp -rf $@.tmp $@
$(PYTHON_DIST_FILENAME): inaugurator setup.py
python setup.py build
python setup.py bdist
python setup.py bdist_egg
build/inaugurator.thin.initrd.dir: ${PYTHON_DIST_FILENAME} build/osmosis/dist/osmosis-1.1.0b1-py2.7.egg build/osmosis/build/cpp/osmosis.bin
-@mkdir build
-rm -fr $@.tmp $@
mkdir $@.tmp
echo "Installing Inaugurator"
tar -xf $< --directory $@.tmp
cp build/osmosis/dist/osmosis-1.1.0b1-py2.7.egg $@.tmp/usr/lib/
echo "Copying libraries"
DEST=$@.tmp sh/relative_copy_glob.sh /lib64/ld*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/encodings/*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/ctypes/*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/logging/*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/json/*
DEST=$@.tmp sh/relative_copy_executable.sh /usr/lib64/python2.7/lib-dynload/_ctypes.so
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/python2.7/lib-dynload/*
DEST=$@.tmp sh/relative_copy_executable.sh /usr/lib64/python2.7/lib-dynload/_hashlib.so
DEST=$@.tmp sh/relative_copy_executable.sh /usr/lib64/libudev.so.1
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib64/libnss_dns*
DEST=$@.tmp sh/relative_copy_glob.sh /usr/share/hwdata/pci.ids
echo "Copying pika:"
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib/python2.7/site-packages/pika/*.py
DEST=$@.tmp sh/relative_copy_glob.sh /usr/lib/python2.7/site-packages/pika/adapters/*.py
echo "Copying executables"
DEST=$@.tmp sh/relative_copy_executable.sh /bin/bash
DEST=$@.tmp sh/relative_copy_executable.sh /bin/sh
DEST=$@.tmp sh/relative_copy_executable.sh /bin/python2.7
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/busybox
DEST=$@.tmp sh/relative_copy_executable.sh /bin/lsblk
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/kexec
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/ifconfig
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/route
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/sfdisk
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/parted
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/mkfs.ext4
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/mkswap
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/ip
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/ethtool
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/chroot
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/dosfslabel
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/lvm
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/lvmetad
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/fsck.ext4
DEST=$@.tmp sh/relative_copy_executable.sh /usr/bin/rsync
DEST=$@.tmp sh/relative_copy_executable.sh /usr/bin/ipmitool
DEST=$@.tmp sh/create_busybox_links.sh /usr/sbin/busybox
DEST=$@.tmp sh/relative_copy_executable.sh /usr/sbin/smartctl
cp -a build/osmosis/build/cpp/osmosis.bin $@.tmp/usr/bin/osmosis
DEST=$@.tmp sh/relative_copy_executable_dependencies.sh $@.tmp/usr/bin/osmosis
echo "Copying drivers"
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ixgbe
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh virtio_blk
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh isci
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh virtio_net
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh virtio_pci
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh e1000
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh igb
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh 8139cp
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh vfat
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ext4
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh usb_storage
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh dm_mod
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh sd_mod
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ahci
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh isofs
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ata_piix
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh cciss
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_msghandler
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_si
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_devintf
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_ssif
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_watchdog
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh ipmi_poweroff
DEST=$@.tmp sh/relative_copy_glob.sh /lib/modules/$(KERNEL_VERSION)/modules.order
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh aacraid
DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh dm-snapshot
DEST=$@.tmp sh/relative_copy_glob.sh /lib/modules/$(KERNEL_VERSION)/modules.builtin
depmod --basedir=$@.tmp $(KERNEL_VERSION)
echo "Misc"
DEST=$@.tmp sh/relative_copy_glob.sh etc/*
DEST=$@.tmp sh/relative_copy_glob.sh init
mkdir -p $@.tmp/run/udev
mkdir -p $@.tmp/run/lvm
mkdir $@.tmp/proc
mkdir $@.tmp/sys
find $@.tmp -name "*.pyo" | xargs rm -f
mv $@.tmp $@
build/inaugurator.fat.initrd.dir: build/inaugurator.thin.initrd.dir
echo "Creating fat image. Starting from thin image"
cp -a $< $@.tmp
echo "Copying drivers"
set -e; for driver in `sh/list_storage_and_network_driver_names.sh $(KERNEL_VERSION)`; do echo "Copying $$driver"; DEST=$@.tmp KERNEL_UNAME_R=$(KERNEL_VERSION) sh/relative_copy_driver.sh $$driver; done
depmod --basedir=$@.tmp $(KERNEL_VERSION)
cp -a lib $@.tmp/
mv $@.tmp $@
build/build-inaugurator.dockerfile: docker/build-inaugurator.dockerfile
@-mkdir build
KERNEL_VERSION=$(KERNEL_VERSION) m4 $< > $@
build/osmosis: ../osmosis
@-mkdir build
cp -rf ../osmosis build/
$(MAKE) -C build/osmosis clean
build/osmosis/dist/osmosis-1.1.0b1-py2.7.egg: build/osmosis
$(MAKE) -C build/osmosis egg
build/osmosis/build/cpp/osmosis.bin: build/osmosis
$(MAKE) -j 4 -C build/osmosis build
.PHONY: build_container
build_container: build/build-inaugurator.dockerfile setup.py
$(info It seems that a build-inaugurator image for version $(INAUGURATOR_VERSION) of Inaugurator was not built. Trying to build it...)
sudo docker build -f build/build-inaugurator.dockerfile -t build-inaugurator:$(INAUGURATOR_VERSION) build