about summary refs log tree commit diff stats
path: root/core/install.html
blob: 194e2454846e4d126f4e86744871b590f7b84f9d (plain) (blame)
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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<!DOCTYPE html>
<html dir="ltr" lang="en">
    <head>
        <meta charset='utf-8'>
        <title>1.1. Install Crux 3.2</title>
    </head>
    <body>

        <a href="index.html">Core OS Index</a>

        <h1>1.1. Install Crux 3.2</h1>

        <p>Installation of minimal Crux 3.2 Gnu\Linux system,
        with selected packages from core, opt and contrib
        ports. Process of installation documented can be
        executed from iso or from existing gnu\linux installation.
        Read
        <a href="http://crux.nu/Main/Handbook3-2">Hand book 3.2</a>,
        .</p>

        <h2 id="step1">1.1.1. Download Iso</h2>

        <a href="http://crux.nu/Main/Download">Download Page</a>

        <pre>
        $ curl -k -O https://serverop.de/crux/crux-3.2/iso/crux-3.2.iso
        $ curl -k -O https://serverop.de/crux/crux-3.2/iso/crux-3.2.md5
        $ md5sum crux-3.2.iso
        2e4144590f6b340de2580255ad21620e  crux-3.2.iso
        </pre>

        <h2 id="step2">1.1.2. Prepare Target</h2>

        <p>Prepare disk or target location where new system will
        be installed. Follow steps describe how to create efi and
        separate partitions such as; boot, root, var, tmp,
        usr, ports, swap and home. Information about
        <a href="http://devil-detail.blogspot.pt/2013/07/install-grub2-on-gpt-disk-dedicated-partition.html">gpt partition table</a>.
        </p>

        <h3>/boot/efi</h3>

        <p>EFI System Partition, ESP type EF00. Partition
        with between 500M and 100M is recommended for standard
        installations.</p>

        <pre>
        (parted) mkpart ESP fat32 1MiB    120MiB
        </pre>

        <pre>
        (parted) align-check opt 1
        </pre>

        <h3>/boot</h3>

        <p>Boot partition. Partition with 1G provides
        room for crux iso to boot directly from grub.</p>

        <pre>(parted) mkpart primary ext4 120MiB 1000MiB</pre>

        <pre>
        (parted) align-check optimal 2
        </pre>

        <h3>/</h3>

        <p>Normal installation root partition uses 200MB-500MB, being
        1G recommended. Since we have plenty of space a partition
        with 2G will be used to host a complete backup of final installation
        configuration.</p>

        <pre>
        (parted) mkpart primary ext4 1000MiB 3000MiB
        </pre>

        <pre>
        (parted) align-check optimal 3
        </pre>

        <h3>/var</h3>

        <p>Var partition is recommended 100MiB-500MiB, we will
        use 1G;</dd>

        <pre>
        (parted) mkpart primary ext4 3000MiB 4000MiB
        </pre>

        <pre>
        (parted) align-check optimal 4
        </pre>

        <h3>/tmp</h3>

        <p>Temp partition with 20M-50M;</dd>

        <pre>
        (parted) mkpart primary ext4 4000MiB 4050MiB
        </pre>

        <pre>
        (parted) align-check optimal 5
        </pre>

        <h3>/usr</h3>

        <p>User partition with 4G is recommended for a desktop
        setup, we will use 8G;</dd>

        <pre>
        (parted) mkpart primary ext4 4050MiB 12000MiB
        </pre>

        <pre>
        (parted) align-check optimal 6
        </pre>

        <h3>/home</h3>

        <p>Home partition with 180G;</dd>

        <pre>
        (parted) mkpart primary ext4 12000MiB 192000MiB
        </pre>

        <pre>
        (parted) align-check optimal 7
        </pre>

        <h3>/usr/ports</h3>

        <p>Ports partition with 120G allows to host sources, package
        backups and ports;</dd>

        <pre>
        (parted) mkpart primary ext4 192000MiB 312000MiB
        </pre>

        <pre>
        (parted) align-check optimal 8
        </pre>

        <h3>Swap (ram)</h3>

        <p>Swap partition general advice is same size as memory ram,
        ports system configured to build on ram need at least 30G
        to build firefox. Other swap partitions can be added later for port
        build on ram.</p>

        <pre>
        (parted) mkpart primary linux-swap 312000MiB 342000MiB
        </pre>

        <p>Create filesystems;</p>

        <pre>
       $ export BLK_EFI=/dev/sda1
       $ export BLK_BOOT=/dev/sda2
       $ export BLK_ROOT=/dev/sda3
       $ export BLK_VAR=/dev/sda4
       $ export BLK_TMP=/dev/sda5
       $ export BLK_USR=/dev/sda6
       $ export BLK_HOME=/dev/sda7
       $ export BLK_PRT=/dev/sda8
       $ export BLK_SWAP=/dev/sda9
        </pre>

        <pre>
        $ sudo mkfs.fat -F 32  $BLK_EFI
        </pre>

        <pre>
        $ sudo mkswap $BLK_SWAP
        </pre>

        <pre>
       $ sudo mkfs.ext4 $BLK_BOOT
       $ sudo mkfs.ext4 $BLK_ROOT
       $ sudo mkfs.ext4 $BKL_VAR
       $ sudo mkfs.ext4 $BKL_TMP
       $ sudo mkfs.ext4 $BKL_USR
       $ sudo mkfs.ext4 $BKL_HOME
       $ sudo mkfs.ext4 $BKL_PRT
        </pre>

        <h2 id="step3">1.1.3. Prepare Target</h2>

        <pre>
        $ export CHROOT=/mnt
        </pre>

        <pre>
        $ sudo mount $BLK_ROOT $CHROOT
        </pre>

        <p>Create directories and mount target partitions;</p>

        <pre>
        $ sudo mkdir -p $CHROOT/boot
        $ sudo mkdir -p $CHROOT/var
        $ sudo mkdir -p $CHROOT/usr
        $ sudo mkdir -p $CHROOT/media
        $ sudo mkdir -p $CHROOT/home

        $ sudo mkdir -p $CHROOT/dev
        $ sudo mkdir -p $CHROOT/tmp
        $ sudo mkdir -p $CHROOT/proc
        $ sudo mkdir -p $CHROOT/sys

        $ sudo mount $BLK_BOOT $CHROOT/boot
        $ sudo mkdir -p $CHROOT/boot/efi
        $ sudo mount $BLK_EFI $CHROOT/boot/efi

        $ sudo mount $BLK_VAR $CHROOT/var
        $ sudo mkdir -p $CHROOT/var/lib/pkg

        $ sudo mount $BLK_USR $CHROOT/usr
        $ sudo mount $BLK_PRT $CHROOT/usr/ports

        $ sudo mount $BLK_HOME $CHROOT/home
        </pre>

        <p>Activate Chroot;</p>

        <pre>
        $ sudo mount --bind /dev $CHROOT/dev
        $ sudo mount -vt devpts devpts $CHROOT/dev/pts
        $ sudo mount -vt tmpfs shm $CHROOT/dev/shm
        $ sudo mount -vt proc proc $CHROOT/proc
        $ sudo mount -vt sysfs sysfs $CHROOT/sys
        </pre>

        <p>Mount iso on target partition;</p>

        <pre>
        # modprobe isofs
        # modprobe loop
        # mount -o loop crux-3.2.iso $CHROOT/media
        </pre>

        <h2 id="step4">1.1.4. Install Crux</h2>

        <p>Create file $CHROOT/core.lst containing
        list of binary packages present in $CHROOT/media/crux/core/;</p>

        <pre>
        $ sudo for p in $CHROOT/media/crux/core/*; do echo $p &lt;&lt; $CHROOT/core.lst; done
        </pre>

        <p>Install temporary pkgadd on $CHROOT;</p>

        <pre>
        $ sudo tar xf /media/crux/core/pkgutils#5.36-2.pkg.tar.xz usr/bin/pkgadd -O > $CHROOT/pkgadd
        $ sudo chmod +x $CHROOT/pkgadd
        </pre>

        <p>Edit $CHROOT/core.lst with your preferences, you can remove
        or add packages from opt collection. Remove lilo if you want
        grub;</p>

        <pre>
        /mnt/iso/crux/core/lilo#24.1-3.pkg.tar.xz
        </pre>

        <p>Create package database, it will contain a list of i
        nstalled packages files.</p>

        <pre>
        $ sudo touch $CHROOT/var/lib/pkg/db
        </pre>

        <p>Install all packages listed in $CHROOT/core.lst;</p>

        <pre>
        $ su
        # cd $CHROOT
        while read line; do
                printf "Installing $line;\n"
                $CHROOT/pkgadd -f -r $CHROOT $line
        done &lt; core.lst
        </pre>

        <h2 id="step5">1.1.5. Install extra packages</h2>

        <p>Install additional ports like wireless-tools, grub2
	and fakeroot </p>

        <pre>
        cp $CHROOT/media/crux/opt/* $CHROOT/usr/ports/packages
        cp $CHROOT/media/crux/xorg/* $CHROOT/usr/ports/packages
        </pre>

        <p>Install fakeroot and create user account, read
        ;</p>

        <pre>
        # pkgadd /media/crux/opt/fakeroot#1.20.2-1.pkg.tar.xz
        </pre>

	<pre>
	# chroot /mnt /bin/bash
	</pre>

        <pre>
        pkgadd /usr/ports/packages/dbus#1.10.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/expat#2.1.0-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libnl#3.2.27-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libpng#1.6.19-1.pkg.tar.xz
        pkgadd /usr/ports/packages/freetype#2.6.1-1.pkg.tar.xz
        pkgadd /usr/ports/packages/libffi#3.2.1-2.pkg.tar.xz
        pkgadd /usr/ports/packages/sqlite3#3.9.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/python#2.7.10-1.pkg.tar.xz
        pkgadd /usr/ports/packages/glib#2.46.2-1.pkg.tar.xz
        pkgadd /usr/ports/packages/grub2#2.00-7.pkg.tar.xz
        pkgadd /usr/ports/packages/grub2-efi#2.00-4.pkg.tar.xz
        pkgadd /usr/ports/packages/wireless-tools#29-1.pkg.tar.xz
        pkgadd /usr/ports/packages/wpa_supplicant#2.5-2.pkg.tar.xz
        pkgadd /usr/ports/packages/lvm2#2.02.133-1.pkg.tar.xz
        pkgadd /usr/ports/packages/mdadm#3.3.4-1.pkg.tar.xz
        pkgadd /usr/ports/packages/efivar#0.21-1.pkg.tar.xz
        pkgadd /usr/ports/packages/efibootmgr#0.12-1.pkg.tar.xz
        pkgadd /usr/ports/packages/dosfstools#3.0.26-1.pkg.tar.xz
        </pre>

	<pre>
	# exit
	</pre>

	<pre>
        $ sudo rm $CHROOT/pkgadd
        $ sudo rm $CHROOT/core.lst
        </pre>

        <h2 id="step6">1.1.6. Install extra ports</h2>

        <p>Create c9 ports;</p>

	<pre>
        $ sudo mkdir $CHROOT/usr/ports/c9-ports
        </pre>

        <p>Copy ports from  c9-doc/core/ports;</p>

        <pre>
        $ sudo cp -r ports/* $CHROOT/usr/ports/c9-ports/
	</pre>

        <h2 id="step7">1.1.7. DNS Resolver</h2>

        <pre>
        $ sudo cp /etc/resolv.conf $CHROOT/etc
        </pre>

        <h2 id="step8">1.1.8. Install Handbook</h2>

        <pre>
        $ sudo cp $CHROOT/media/crux/handbook.txt $CHROOT/home/root/
        </pre>

        <h2 id="step9">1.1.9. Basic Skeleton</h2>

        <p>Copy skeletons from  c9-doc/core/conf;</p>

        <pre>
        $ sudo cp -R  conf/skel $CHROOT/etc/
        </pre>

        <a href="index.html">Core OS Index</a>
        <p>This is part of the c9 Manual.
        Copyright (C) 2016
        c9 team.
        See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a>
        for copying conditions.</p>

    </body>
</html>