-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildrootfs.sh
executable file
·82 lines (70 loc) · 1.5 KB
/
buildrootfs.sh
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
#!/bin/bash
DESTDIR=/mnt/
dd if=/dev/full of=disk0 bs=1M count=4
mkfs.ext2 disk0
mount disk0 ${DESTDIR} -o loop
mkdir -p "${DESTDIR}/usr/bin"
mkdir -p "${DESTDIR}/usr/lib"
mkdir -p "${DESTDIR}/usr/sbin"
mkdir -p "${DESTDIR}/etc"
mkdir -p "${DESTDIR}/bin"
mkdir -p "${DESTDIR}/dev"
mkdir -p "${DESTDIR}/lib"
mkdir -p "${DESTDIR}/proc"
mkdir -p "${DESTDIR}/sbin"
mkdir -p "${DESTDIR}/tmp"
cp -a rootfs/* "${DESTDIR}/"
echo -n "fluxhost" > "${DESTDIR}/etc/hostname"
echo -n "fluxdomain" > "${DESTDIR}/etc/domainname"
#
# Install init services
#
mkdir -p "${DESTDIR}/usr/system/services/"
cp src/init/units/shell.service "${DESTDIR}/usr/system/services/"
mkdir -p "${DESTDIR}/usr/system/mounts/"
cp src/init/units/proc.mount "${DESTDIR}/usr/system/mounts/"
cp src/init/units/tmp.mount "${DESTDIR}/usr/system/mounts/"
mkdir -p "${DESTDIR}/var/lib/network/routes/"
cp src/init/units/local.route "${DESTDIR}/var/lib/network/routes/"
mkdir -p "${DESTDIR}/var/lib/network/interfaces/"
cp src/init/units/eth0.interface "${DESTDIR}/var/lib/network/interfaces/"
cp src/init/init "${DESTDIR}/sbin/"
cp src/fluxsh/fluxsh "${DESTDIR}/bin/"
while read coreutil
do
cp "src/coreutils/${coreutil}" "${DESTDIR}/bin/"
done << EOF
basename
cat
chmod
chown
dirname
domainname
false
hostname
ln
ls
mkdir
mknod
mount
mv
ps
pwd
readlink
reboot
rm
rmdir
touch
true
umount
uname
EOF
while read test
do
cp "src/tests/${test}" "${DESTDIR}/bin/"
done << EOF
mmap
EOF
# default to root:root owner
chown -R root:root "${DESTDIR}/"
umount ${DESTDIR}