-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathloongarch-bootstrap
264 lines (224 loc) · 9.83 KB
/
loongarch-bootstrap
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#!/bin/bash
# This bash script only works on LoongArch64 buildbot Yukoaioi, since I specify the local path where I built debs.
# After running this stage1 script, chroot into TARGETDIR then use APT locally to install other essential packages. (TODO)
# current temp stage2
# first run a simple flat local APT repository, like
# python3 -m http.server -d /clfs-test-bak/clfs-test/debs
# edit $TARGETDIR/etc/apt/sources.list to add the following line
# deb [allow-insecure=yes] http://0.0.0.0:8000 ./
export TARGETDIR=/mnt/aosc
mkdir -pv /tmp/work
cd /tmp/work
echo "------ar aosc-aaa_8.1.0-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/a/aosc-aaa_8.1.0-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
wget https://repo.aosc.io/debs/pool/stable/main/c/ca-certs_20201201-1_noarch.deb
echo "------ar ca-certs_20201201-1_noarch.deb to /tmp/work------"
ar -x ca-certs_20201201-1_noarch.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar tar_1.32-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/t/tar_1.32-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar diffutils_3.7-5_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/d/diffutils_3.7-5_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar coreutils_8.31-3_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/c/coreutils_8.31-3_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar apt_2.3.8-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/a/apt_2.3.8-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar dpkg_1.20.9-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/d/dpkg_1.20.9-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar xz_5.2.5-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/x/xz_5.2.5-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar zlib_1.2.11-4_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/z/zlib_1.2.11-4_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar zstd_1.5.0-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/z/zstd_1.5.0-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar bzip2_1.0.8-2_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/b/bzip2_1.0.8-2_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar lz4_1.9.2-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/l/lz4_1.9.2-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar gnupg_2.2.23-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/g/gnupg_2.2.23-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar bash_5.1.8-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/b/bash_5.1.8-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar glibc_2.28-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/g/glibc_2.28-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar readline_8.1.1-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/r/readline_8.1.1-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar ncurses_6.2-4_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/n/ncurses_6.2-4_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar gcc-runtime_8.3.0-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/g/gcc-runtime_8.3.0-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar systemd_248.3-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/s/systemd_248.3-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libgcrypt_1.9.1-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libg/libgcrypt_1.9.1-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libgpg-error_1.41-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libg/libgpg-error_1.41-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar xxhash_0.8.0-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/x/xxhash_0.8.0-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libcap_2.43-2_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libc/libcap_2.43-2_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libseccomp_2.5.1-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libs/libseccomp_2.5.1-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar gnutls_3.6.15-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/g/gnutls_3.6.15-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar p11-kit_0.23.18.1-1_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/p/p11-kit_0.23.18.1-1_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libunistring_0.9.10-3_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libu/libunistring_0.9.10-3_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libunistring_0.9.10-3_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libu/libunistring_0.9.10-3_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libtasn1_4.15.0-2_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libt/libtasn1_4.15.0-2_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar nettle_3.7.2-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/n/nettle_3.7.2-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar gmp_6.2.1-0_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/g/gmp_6.2.1-0_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar libffi_3.2.1-11_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/libf/libffi_3.2.1-11_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar acl_2.2.53-2_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/a/acl_2.2.53-2_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
cd /tmp/work
echo "------ar attr_2.4.48-2_loongarch64.deb to /tmp/work------"
ar -x /clfs-test-bak/clfs-test/debs/a/attr_2.4.48-2_loongarch64.deb
cd $TARGETDIR
echo "------extracting data.tar.xz to $TARGETDIR------"
tar xvf /tmp/work/data.tar.xz -C $TARGETDIR
echo "------wget etc-bootstrap.tar.xz to $TARGETDIR------"
wget https://repo.aosc.io/aosc-repacks/etc-bootstrap.tar.xz
echo "------extracting etc-bootstrap.tar.xz to $TARGETDIR------"
tar xvpf etc-bootstrap.tar.xz -C $TARGETDIR
rm etc-bootstrap.tar.xz
echo "------mkdir for $TARGETDIR/var/lib/dpkg, and create empty dpkg/{status, available}------"
mkdir -p "$TARGETDIR/var/lib/dpkg"
: >"$TARGETDIR/var/lib/dpkg/status"
: >"$TARGETDIR/var/lib/dpkg/available"