-
Notifications
You must be signed in to change notification settings - Fork 10
/
beowulf.blend
182 lines (151 loc) · 4.38 KB
/
beowulf.blend
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/usr/bin/env zsh
# See LICENSE file for copyright and license details
vars+=(codename)
codename="leste" && source "$R/../beowulf.config"
case "$device_name" in
n900|droid3|droid4|bionic|sunxi)
skip_arm_device_root="yes"
build_kernel_${arch}() {
fn build_kernel_${arch} "(override)"
#prebuild || { zerr; return 1; }
postbuild || { zerr; return 1; }
}
;;
pine*)
skip_arm_defice_root="yes"
build_kernel_${arch}() {
fn build_kernel_${arch} "(noop override)"
}
blend_postinst() {
fn blend_postinst
req=(loopdevice strapdir)
ckreq || return 1
notice "Flashing u-boot and compiling boot.scr"
sudo dd if="$strapdir/usr/share/pine64-uboot/u-boot-sunxi-with-spl.bin" \
of="$loopdevice" seek=8 bs=1024 || { zerr; return 1; }
sudo mkimage -C none -A arm -T script \
-d "$strapdir/usr/share/pine64-uboot/boot.txt" \
"$workdir/mnt/boot/boot.scr" || { zerr; return 1; }
}
;;
esac
blend_bootstrap_setup() {
fn blend_bootstrap_setup
req=(strapdir maemo_keyring_url)
[[ -n "$armsdk_version" ]] && req +=(device_name)
ckreq || return 1
cat <<EOF | sudo tee ${strapdir}/blend-bootstrap-setup >/dev/null
#!/bin/sh
set -e
wget -O maemo-keyring.deb "$maemo_keyring_url"
dpkg -i maemo-keyring.deb
rm -f maemo-keyring.deb
EOF
chroot-script -d blend-bootstrap-setup || { zerr; return 1; }
case "$device_name" in
droid3|droid4|bionic)
sudo mkdir -p /boot/boot
;;
esac
}
blend_preinst() {
fn blend_preinst
req=(strapdir)
[[ -n "$armsdk_version" ]] && req+=(device_name)
ckreq || return 1
notice "copying rootfs overlays"
sudo rsync -vraX --chown=root:root "$R/../rootfs-overlay/common/" "${strapdir}"
if [[ -n "$armsdk_version" ]]; then
sudo rsync -vraX --chown=root:root "$R/../rootfs-overlay/${device_name}/" "${strapdir}"
echo "devuan-${device_name}" | sudo tee "$strapdir/etc/hostname" >/dev/null
sudo sed -e "s/devuan/devuan-${device_name}/" -i "$strapdir/etc/hosts"
cat <<EOF | sudo tee "$strapdir/etc/fstab" >/dev/null
# fstab for arm system
none /sys/kernel/debug debugfs defaults 0 0
/dev/mmcblk0p1 /boot ${bootfs} defaults 0 1
EOF
fi
blend_finalize || zerr
return 0
}
blend_finalize() {
fn blend_finalize
req=(strapdir)
ckreq || return 1
# Used for disabling screen autolock.
al_gconfkey="/system/osso/dsm/locks/device_autolock_enabled"
al_disable="false"
if [[ -n "$vmsdk_version" ]]; then
al_disable="true"
fi
notice "Finalizing installation"
cat <<EOF | sudo tee ${strapdir}/blend-finalize >/dev/null
#!/bin/sh
apt-get --yes --force-yes purge ${finalize_purge_packages}
apt-get --yes --force-yes --purge autoremove
dpkg -l | awk '/^rc / {print \$2}' | xargs apt-get --yes --force-yes purge
# TODO: Do this through a package when we have a language-changing package
# Generate locales
apt-cache search hildon-common-strings-l10n \
| grep -v mr0 \
| awk -F'[()]' '{printf "%s.UTF-8 UTF-8\n", \$2}' \
>> /etc/locale.gen
locale-gen
setlocale en_US.utf-8 en_US.utf-8
# Screen autolock
su -c 'gconftool -s ${al_gconfkey} -t bool ${al_disable}' user
# ntp parameters
echo "2020-05-29 00:00:00" > /etc/fake-hwclock.data
sed -e '/^NTPDATE_USE_NTP_CONF=/s/yes/no/' \
-e '/^NTPOPTIONS=/s/""/"-b -4"/' \
-i /etc/default/ntpsec-ntpdate
#cd /etc/runlevels
#for i in *; do
# if [ -L "\$i" ]; then
# mv "\$i" default
# fi
#done
rc-update del mountnfs.sh sysinit || true
for i in alsa-utils x11-common networking zzzremove-first-boot-flag; do
rc-update del "$i" sysinit || true
rc-update add "$i" default || true
done
apt-get update
apt-get clean
updatedb
update-ca-certificates
EOF
chroot-script -d blend-finalize || zerr
}
conf_print_sourceslist() {
fn conf_print_sourceslist "(override)"
req=(codename)
[[ -n "$armsdk_version" ]] && req+=(device_name)
ckreq || return 1
devname="$device_name"
case "$device_name" in
pine*)
devname="pinephone"
;;
raspi*)
devname="raspberrypi"
;;
bionic)
devname="droid4 bionic"
;;
droid3)
devname="droid4 droid3"
;;
esac
cat <<EOF
deb https://pkgmaster.devuan.org/merged ${release} main contrib non-free
deb https://pkgmaster.devuan.org/merged ${release}-updates main contrib non-free
deb https://pkgmaster.devuan.org/merged ${release}-security main contrib non-free
deb https://maedevu.maemo.org/${codename} ${release} main contrib non-free ${lima} ${devname}
EOF
if [[ "$devel_image" = true ]]; then
cat <<EOF
deb https://maedevu.maemo.org/${codename} ${release}-devel main contrib non-free ${lima} ${devname}
EOF
fi
}