1
1
S3_TARGET ?= s3://$(shell whoami) /
2
2
BUSYBOX_URL ?= http://launchpadlibrarian.net/181784411/busybox-static_1.22.0-8ubuntu1_armhf.deb
3
+ KERNEL_URL ?= http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz
4
+ CMDLINE ?= 'root=/dev/ram'
3
5
4
- uInitrd : initrd.gz
5
- mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d $< $@
6
-
7
- initrd.gz : tree tree/init tree/functions tree/bin/busybox tree/bin/sh
8
- cd tree && find . -print0 | cpio --null -ov --format=newc | gzip -9 > $(PWD ) /$@
9
-
10
- tree/bin/sh :
11
- cd tree && mkdir -p bin sbin etc proc sys newroot usr/bin usr/sbin
12
- ln -s busybox tree/bin/sh || true
13
-
14
- tree/bin/busybox :
15
- mkdir -p $(shell dirname $@ )
16
- docker run -it --rm \
17
- -v $(PWD ) /tree/bin:/host/bin \
18
- busybox \
19
- /bin/sh -xec ' \
20
- cd /tmp && \
21
- wget $(BUSYBOX_URL ) -O busybox.deb && \
22
- ar x busybox.deb && \
23
- xz -d data.tar.xz && \
24
- tar xf data.tar && \
25
- cp bin/busybox /host/bin/busybox \
26
- '
27
- chmod +x $@
28
6
29
- .PHONY : publish_on_s3 qemu dist dist_do dist_teardown
7
+ .PHONY : publish_on_s3 qemu dist dist_do dist_teardown all
30
8
9
+ # Phonies
10
+ all : uInitrd
31
11
32
12
qemu : vmlinuz initrd.gz
33
- qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel ./vmlinuz -initrd ./initrd.gz -m 256 -append ' root=/dev/ram'
13
+ qemu-system-arm \
14
+ -M versatilepb \
15
+ -cpu cortex-a8 \
16
+ -kernel ./vmlinuz \
17
+ -initrd ./initrd.gz \
18
+ -m 256 \
19
+ -append $(CMDLINE )
34
20
35
21
publish_on_s3 : uInitrd initrd.gz
36
22
for file in $< ; do \
37
23
s3cmd put --acl-public $$ file $(S3_TARGET ) ; \
38
24
done
39
25
40
-
41
26
dist :
42
27
$(MAKE ) dist_do || $(MAKE ) dist_teardown
43
28
@@ -53,6 +38,33 @@ dist_do:
53
38
dist_teardown :
54
39
git checkout master
55
40
41
+
42
+ # Files
56
43
vmlinuz :
57
- # wget -O $@ http://ports.ubuntu.com/ubuntu-ports/dists/utopic/main/installer-armhf/current/images/generic/netboot/vmlinuz
58
- wget -O $@ http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz
44
+ wget -O $@ $(KERNEL_URL )
45
+
46
+
47
+ uInitrd : initrd.gz
48
+ mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d $< $@
49
+
50
+ initrd.gz : tree tree/init tree/functions tree/bin/busybox tree/bin/sh
51
+ cd tree && find . -print0 | cpio --null -ov --format=newc | gzip -9 > $(PWD ) /$@
52
+
53
+ tree/bin/sh :
54
+ cd tree && mkdir -p bin sbin etc proc sys newroot usr/bin usr/sbin
55
+ ln -s busybox tree/bin/sh || true
56
+
57
+ tree/bin/busybox :
58
+ mkdir -p $(shell dirname $@ )
59
+ docker run -it --rm \
60
+ -v $(PWD ) /tree/bin:/host/bin \
61
+ busybox \
62
+ /bin/sh -xec ' \
63
+ cd /tmp && \
64
+ wget $(BUSYBOX_URL ) -O busybox.deb && \
65
+ ar x busybox.deb && \
66
+ xz -d data.tar.xz && \
67
+ tar xf data.tar && \
68
+ cp bin/busybox /host/bin/busybox \
69
+ '
70
+ chmod +x $@
0 commit comments