-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandbook.txt
1667 lines (1293 loc) · 71.3 KB
/
handbook.txt
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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
NOTE: This CRUX PPC 3.5 handbook was derived from the CRUX PPC 2.7 handbook.
Although it is generally useful for the 3.5 CRUX PPC release, it has not
yet been carefully adjusted to reflect CRUX PPC 3.5. Various parts of
this handbook are not yet entirely accurate in regards to CRUXPPC3.5. When
using this handbook, keep in mind:
1) CRUX PPC 3.5 only supports Apple 32bit PowerPC machines. All references
to non Apple machines in this handbook should be disregarded.
2) Alenia was part of the previous CRUX PPC project. It is not part of
3.5 nor is it planned to be. The regular CRUX prt-get utility is
included in CRUX PPC 3.5 and it should be used instead of Alenia.
3) For now at least, the user must manually maintain the ppc specific
portion of their ports tree by using git to pull a copy from the
cruxppc-ng-3.5 repository and then cp the ppc ports into the /usr/ports
tree. "ports -u" updates the non-ppc ports but does not update the
the ppc ports.
git can be installed from the install CD by either selecting the entire
opt set or by selecting git manually.
HANDBOOK FOR CRUX PPC 3.5
1. Preface
1. What is CRUX PPC?
2. Why use CRUX PPC?
3. License
1. Packages
2. Build Scripts
3. GPL
4. NO WARRANTY
3. Installing CRUX PPC
1. Supported Hardware
2. Installing From CD-ROM
3. Upgrading From CD-ROM
4. Alternative Installation Methods
1. Network Installation
4. The Package System
1. Introduction
2. Using the Package System
1. Installing a Package
2. Upgrading a Package
3. Removing a Package
4. Querying the Package Database
3. Package management frontend: ilenia
1. prt-get and CRUX PPC
2. ilenia and CRUX PPC
4. Creating Packages
1. Adjusting/Configuring the Package Build Process
5. Package Guidelines
1. General
2. Directories
6. Remove Junk Files
1. Pkgfile
2. Pkgfile Header
5. The Ports System
1. Introduction
1. What is a Port?
2. What is the Ports System?
1. Port collections
2. The official collection 'opt' and 'core'
3. The user contributed collection 'contrib'
4. The individual collections from CRUX users
3. Using the Ports System
1. Synchronizing Your Local Ports Structure
2. Listing Local Ports
3. Listing Version Differences
4. Building and Installing Packages
5. Enabling the 'contrib' collection
6. Additional Tools
1. Building ports as unprivileged user
2. Useful scripts
6. Configuration
1. Initialization Scripts
1. Runlevels
2. Layout
3. Configuration Variables in /etc/rc.conf
4. Generating Locales
5. Network Configuration
2. Passwords
3. Upgrading the Kernel
7. Appendix
1. Troubleshooting
2. Installation
3. Configuration
CRUX PPC Handbook - release 3.5
Copyright (c) 2001-2004 Per Liden
Copyright (c) 2004-2005 Giulivo Navigante
Copyright (c) 2005-2019 The CRUX PPC team
This handbook covers the installation, configuration and administration of
CRUX PPC and most in general of the CRUX distribution. For further
information about the GNU/Linux system see the GNU's Not Unix project page
and the Linux Documentation Project.
Preface
Per Liden wrote this handbook. Robert McMeekin converted it to DocBook.
Giulivo Navigante and further on The CRUX PPC Team adapted it for PPC
users and made a Wiki version. Numerous others have given feedback and
improvement suggestions.
Introduction
What is CRUX PPC?
CRUX PPC is a port for the Power Architecture^(R) platform of CRUX, a
lightweight and optimized GNU/Linux distribution targeted at experienced
GNU/Linux users. The primary focus of this distribution is "keep it
simple", which it reflects in a simple tar.gz-based package system,
BSD-style initscripts, and a relatively small collection of trimmed
packages. The secondary focus is utilization of new Linux kernel features
and recent tools and libraries. CRUX PPC also has a ports system which
makes it easy to install and upgrade applications.
Why use CRUX PPC?
There are many GNU/Linux distributions out there these days, so what makes
this distribution any better than the others? Well, it's all about taste
really. Here are a few hints about the tastes and goals of the people
behind CRUX PPC. CRUX PPC is made with simplicity in mind from beginning
to end. Making it easy to create new and update old packages is essential;
updating a package in CRUX PPC is often just a matter of typing pkgmk -d
-u (or ilenia -u). The usage of ports helps keep your packages up-to-date;
not the latest bleeding-edge-alpha version, but the latest stable version.
Other features include creating packages optimized for your processor, eg.
by compiling with -mcpu=G4 -maltivec -mabi=altivec, and avoiding
cluttering the filesystem with files you'll never use, eg. /usr/doc/*,
etc. If you need more information about a specific program, other than
information found in the man-page, a web search engine usually knows all
about it. Finally, it strives to use new features as they become
available, as long as they are consistent with the rest of the goals.
If you are a somewhat experienced GNU/Linux user that wants a clean and
solid GNU/Linux distribution as the foundation of your installation,
prefers editing configuration files with an editor to using a GUI, and
doesn't hesitate to download and compile programs yourself, then this
istribution might suit you well.
License
Packages
Since CRUX PPC is a GNU/Linux distribution, it contains software written
by a lot of different people. Each software package comes with its own
license, chosen by its author(s). To find out how a particular package is
licensed, have a look at its source code.
Build Scripts
Package build scripts in CRUX PPC (initially in package categories ppc)
are Copyright (c) by CRUX PPC Team and licensed through the GNU General
Public License. Other build scripts (in package categories x86/core and
x86/opt) are Copyright (c) 2000-2010 by Per Liden and the CRUX development
team and licensed through the GNU General Public License.
GPL
Any code or documentation authored by the CRUX PPC Team that comes with
CRUX PPC is released under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 or (at your
option) later. You should have received a copy of the GNU General Public
License along with CRUX PPC.
NO WARRANTY
CRUX PPC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. Use it at YOUR OWN RISK.
Installing CRUX PPC
Supported Hardware
Packages on the official CRUX PPC ISO image are compiled with
optimizations to support Power Architecture(R) processors. CRUX PPC supports
Apple NewWorld (G3, G4, 32 bit only).
The kernel used during installation, i.e. when booting from the CRUX PPC
ISO image is configured according to the platform; you will usually find
support for the following disk controllers, along with USB and FireWire
support (except for the kernels targeted to embedded platforms):
Unchecked, possibly inaccurate, table:
+------------------------------------------------------------------------+
| Subsystem | Driver(s) included in bootkernels (varies with platform) ||
|-----------+-----------------------------------------------------------||
| | Generic PCI IDE chipset, Silicon Image, ServerWorks, ||
| PATA | OSB4/CSB5/CSB6/HT1000, CMD64x, Apple MacIO IDE, ||
| | VIA82Cxxx, AMD81xx, Freescale MPC5200B, Promise PDC2027x, ||
| | SIL680, JMicron, Winbond SL82c105 ||
|-----------+-----------------------------------------------------------||
| SATA | ServerWorks Frodo/Apple K2, Silicon Image, SIL24, ||
| | Marvell, DWC, VITESSE VSC-7174 ||
|-----------+-----------------------------------------------------------||
| | 3ware 9xxx, ACARD, Adaptec AACRAID, Adaptec AIC7xxx, ||
| | Adaptec AIC79xx U320, AdvanSys, LSI Logic NewGen RAID, ||
| SCSI/SAS | LSI Logic MegaRAID (SAS), SYM53C8XX, Tekram DC390(T) and ||
| | Am53/79C974, IBM Power Linux RAID adapter, MESH (Power ||
| | Mac internal/external SCSI), IBM ServeRAID, IBM Virtual ||
| | SCSI, IBM Virtual FC ||
|-----------+-----------------------------------------------------------||
| | USB device filesystem, EHCI HCD (USB 2.0) support, UHCI ||
| | (VIA, many add-on cards,...) support, OHCI (iMacs, OPTi, ||
| USB | SiS, ALi, NEC,...) support, USB Mass Storage support, USB ||
| | Human Interface Device (full HID) support, HID input ||
| | layer support ||
|-----------+------------------------------------------------------------|
| Firewire | OHCI-1394 controllers, Storage devices (SBP-2), IP |
| | networking over 1394 |
+------------------------------------------------------------------------+
In order to install CRUX PPC, your disk controller must be present in the
list above. Some add-on controllers (the ones your openfirmware won't be
able to boot from) are supported with modules. If your hardware is not
supported or you have other problems installing CRUX PPC you might find a
solution in Section 3.4, Alternative Installation Methods but consider
they could be intended for different hardware.
A minimum of 128Meg of RAM is needed to boot the install CD and
install CRUX PPC 3.5.
Installing From CD-ROM
Prior to installing CRUX PPC, it is important to make a backup copy of
any data on the installation system that may be of importance.
Although unlikely, it is possible that attempting to install CRUX PPC
on your system could in some way damage existing data on the system. To
ensure that you don't lose anything of importance, back it up first.
Fix this. Only 32 bit G3/G4 Apple is supported:
1. Download the CRUX PPC ISO image (crux-ppc-3.5.iso or
crux-ppc64-3.5.iso). To ensure that the download was successful you
should examine its checksum using md5sum.
Compare the output with the file crux-ppc-3.5.iso.md5 (or
crux-ppc64-3.5.iso.md5), which can be found in the same directory as the
ISO image on the download site. If the checksums match the download was
successful and you can continue with burning the ISO image on a CD.
2. The ISO image is bootable, on Apple computers just insert the newly
burned CD into the first CD-ROM drive, reboot your computer and keep the C
key pressed to boot from CD. Select at the boot prompt the kernel chrp32
for 604e cpu based systems, apple32 for G3/G4 cpu based systems, apple64
and ppc970 for G5 and PPC970 cpu based systems or pseries for RS64/POWERn
cpu based machines.
Note On all systems you might have to adjust the root= parameter (that
defaults to /dev/sr0) to your cdrom device. Please keep in mind that
device names vary according to your hardware configuration: The first
SCSI, SATA (or EFIKA IDE) disk is called /dev/sda, while the first SCSI
cdrom is called /dev/scd0 or /dev/sr0; the first IDE disk or cdrom is
called /dev/sda too. For more information about harddisk naming
conventions please checkout this HOWTO.
Some systems have slower startup CDROM drives and you may need to
specifiy a larger rootdelay than the default. e.g. "rootdelay=45"
3. Login as root (no password required).
4. Use mac-fdisk (on Macs), parted (on PegasosII, EFIKA and Sam4x0), fdisk
or cfdisk (on RISC/6000 and pSeries) to create and format the partition(s)
you want CRUX PPC to be installed on.
$ mac-fdisk /dev/sd?
$ mkfs.ext4 /dev/sd??
$ mkswap /dev/sd??
Note A special bootstrap partition of 800k is needed to install the yaboot
loader on Macs; mac-fdisk has a special key to do this. Also consider that
yaboot can't read kernel images from JFS and Ext4fs partitions, so if you
intend to use those as root filesystem, a supplementary ext2/ext3
partition is needed to store the boot kernel images. Please note that
mac-fdisk works with existing MacOS partition tables, it can create/delete
partitions on a drive with MacOS installed; cfdisk and fdisk do not
recognize MacOS partition table and will destroy it creating a PC
compatible table from which you won't be able to boot, so use mac-fdisk on
Apple computers.
Note If you're using a PegasosII system or an EFIKA embedded board, you
should use parted to create an Amiga partition table; the partition where
the kernel image resides should be a primary one and formatted as ext2
with 128-byte inodes.
Note If you're using a Sam4x0, you should use parted to create an Amiga
partition table; the partition where the kernel image resides should be
formatted as ext2 with 128-byte inodes.
Note If you're using an IBM Power System, creating PC-Style partition
table is recommended; cfdisk or fidks are suitable for this. You will need
a special PReP Boot partition (type 41) of 8 megabytes.
The amount of disk space you need depends on how many packages you choose
to install. I recommend having at least a 5G root partition (CRUX PPC will
use about 500MB-1.5GB depending on your configuration).
Using ReiserFS is possible, but there is support for
Ext2fs/Ext3fs/Ext4fs, XFS, JFS and BTRFS as well. Further, I highly
recommend separating system data from user data, i.e. use a separate
partition for /home (and possibly /var) since that will make your life a
lot easier the day you want to upgrade/reinstall/remove your system.
5. Mount the partition on which you want to install this distribution.
$ mount -t type /dev/sd?? /mnt
If you want the installation to span more than one partition, mount those
partitions as well. For example, if you want to have a different partition
for /home or /var, then do:
$ mkdir /mnt/var
$ mount -t type /dev/sd?? /mnt/var
6. Activate your swap partition(s).
$ swapon /dev/sd??
7. Type setup to start the package installation script. The script will
ask where you mounted your new root partition and which packages you want
to install. Just select the packages you want and nothing else will be
installed. However, I recommend at least installing all the packages
marked core. Also git (from opt) is also recommended as it is used
for updates of the powerpc specific portions of the ports tree.
In this Alpha release, the dependency list has not been carefully checked
for accuracy. It is suggested to install either all of "core" or all of
"core", "opt" and "xorg" to ensure that all dependencies are satisfied.
Once it has installed the selected packages, the setup script will display
an installation log. Make sure the last line in the log says "0 error(s)".
If you at a later stage find that you need some additional packages you
can just mount the CRUX PPC CD-ROM and use pkgadd to install them.
Note There is only a simple package dependency checking. This means that
it is up to you to figure out that if you for example install the exim
package you also need to install the db package.
Note On Sam4x0 you need opt/mkimage package to compile your own kernel.
Note On EFIKA boards you should now create the device /dev/ttyPSC0 needed
for the serial port of the console.
$ mknod /mnt/dev/ttyPSC0 c 204 148
Note that unlike previous crux ppc install cds, the kernel source is
not automatically installed into the target system. The kernel source
tarball is included under /crux/kernel and if desired, the user may
copy this tarball to the target system and unpack and build it.
A prebuilt starter kernel tarball is provided on the install CD
(look in /crux/kernel). If desired, it can be copied to the target
system and used as a quick start kernel. The other option is to
build the initial kernel from source as part of the CRUX install.
Part of installing CRUX is that the user must generate the locales. A
script containing a small subset (of the many possible) locales is
provided on the install CD (in /crux/makelocales). Copy it to your
target system, modify it as needed for your needs, and then later execute
it from within the installed system.
8. Now it's time to install your kernel and do basic system configuration.
The kernel compilation requires that you "chroot" into your new CRUX PPC
installation.
$ mount --bind /dev /mnt/dev
$ mount --bind /tmp /mnt/tmp
$ mount -t proc proc /mnt/proc
$ mount -t sysfs none /mnt/sys
$ chroot /mnt /bin/bash
You can type setup-chroot instead of issuing the previous commands to
chroot in the system installed in /mnt
9. Set the root password.
$ passwd
10. Edit /etc/fstab to configure your filesystem(s). Editors vim, nano and
mcedit are available.
NOTE If you want access your computer via serial console (as it should be
for IBM RS/6000, pSeries, Apple Xserve or Genesi EFIKA users) you also
have to add ttyS0 (ttyPZ0 for Xserve or ttyPSC0 for EFIKA) in the
/etc/securetty and c7:2:respawn:/sbin/agetty 9600 ttyS0
(c7:2:respawn:/sbin/agetty 57600 ttyPZ0 for Xserve or
c7:2:respawn:/sbin/agetty 115200 ttyPSC0 for EFIKA) in the /etc/inittab
file. For IBM Power Systems (POWER5 and newer) and PPC970 cpu based
systems if you want access your computer via serial console (and to have a
working prompt using keyboard/monitor too) you also have to add hvsi0 or
hvc0 in the /etc/securetty and c7:2:respawn:/sbin/agetty 19200 hvsi0 (or
c7:2:respawn:/sbin/agetty hvc0) in the /etc/inittab file.
11. Edit /etc/rc.conf to configure font, keyboard, timezone, hostname and
services. See Section 6.1.3, Configuration Variables in /etc/rc.conf for
details about /etc/rc.conf .
12. Generate locales for your system. See Section 6.1.4, Generating
Locales for more information.
13. Edit /etc/rc.d/net, /etc/hosts and /etc/resolv.conf to configure your
network (ip-address/gateway/hostname/domain/dns).
14. Go to /usr/src/linux-4.19.24.x, patch (if needed), configure and
compile a new kernel.
Alternatively, a prebuilt starter kernel for Apple 32 bit machines is
included in the install cd under /crux/kernel. The user can then compile
their own kernel later to suit their needs. To install the prebuilt
kernel at the top of the target filesystem run the command.
cd /; tar xvfp <path to prebuilt kernel tarball>
Note On some systems, you should apply the provided patches; these patches
are found in the file /usr/src/
On a 32 bit system:
* for IBM RS/6000
$ cd /usr/src/linux-4.19.24.x
$ patch -p1 < ../your_patch
$ make menuconfig
$ make all
$ make modules_install
$ cp vmlinux /boot/vmlinux
$ cp System.map /boot/System.map
* for Apple
$ cd /usr/src/linux-4.19.24.x
$ patch -p1 < ../your_patch
$ make menuconfig
$ make all
$ make modules_install
$ cp arch/powerpc/boot/zImage.pmac /boot/zImage
$ cp System.map /boot/System.map
* for PegasosII, Efika
$ cd /usr/src/linux-4.19.24.x
$ patch -p1 < ../your_patch
$ make menuconfig
$ make all
$ make modules_install
$ cp arch/powerpc/boot/zImage.chrp /boot/zImage
$ cp System.map /boot/System.map
* for Sam4x0
$ cd /usr/src/linux-4.19.24.x
$ patch -p1 < ../your_patch
$ make menuconfig
$ make all
$ make uImage (for Sam460ex)
$ make canyonlands.dtb (for Sam460ex)
$ make modules_install
$ cp arch/powerpc/boot/cuImage.sam440ep /boot/uImage (for Sam440ep)
$ cp arch/powerpc/boot/uImage /boot/uImage (for Sam460ex)
$ cp arch/powerpc/boot/canyonlands.dtb /boot/canyonlands.dtb (for Sam460ex)
$ cp System.map /boot/System.map
On a 64 bit system:
$ cd /usr/src/linux-4.19.24.x
$ patch -p1 < ../your_patch
$ make menuconfig
$ make all
$ make modules_install
$ cp vmlinux /boot/vmlinux
$ cp System.map /boot/System.map
Useful kernel config files and patches are placed into the /usr/src
directory. They are the config files used to build the boot kernels.
15. On Apple computers, edit /etc/yaboot.conf to boot the kernel you just
compiled and run mkofboot -v to install yaboot into the boostrap
partition, then ybin -v to make the new system bootable.
On IBM RS/6000 and pSeries/System_p computers, edit /etc/yaboot.conf to
boot the kernel you just compiled and type dd
if=/usr/lib/yaboot/yaboot.chrp of=/dev/sd?? where sd?? is the device
corresponding to the disk and PReP Boot partition.
Note Remember that where /etc/yaboot.conf resides must be the first Ext2fs
formatted partition available on your disk.
On PegasosII systems, enter the SmartFirmware? and type boot hd:Y-1
boot/zImage root=/dev/sd?Y where hd?Y is the disc and partition and Y is
the number of the partition where CRUX PPC has been installed.
On Sam4x0 you could use Parthenope as your second level bootloader. Create
the file /boot/menu.lst with the following syntax:
delay 5
title CRUX PPC 3.5 (Sam440ep)
kernel /uImage root=/dev/sdaY console=tty0 quiet
title CRUX PPC 3.5 (Sam460ex)
kernel /uImage root=/dev/sdaY console=tty0 quiet
dtb /canyonlands.dtb
Where X is the partition number where is located the kernel image and Y is
the root partition.
You also need to install Parthenope in the RDB with the following command:
$ parthenope-install /usr/share/parthenope/ub2lb
Parthenope is smart enough to search for other operating system and boot
them.
16. Remove the CRUX PPC CD-ROM from your drive and reboot from harddisk.
Upgrading From CD-ROM
Upgrading from a previous crux ppc to crux ppc 3.5 is not supported.
It is not likely to work.
1. Download the CRUX PPC ISO image (crux-ppc-3.5.iso or
crux-ppc64-3.5.iso). To ensure that the download was successful you
should examine its checksum using md5sum.
Compare the output with the file crux-ppc-3.5.iso.md5 (or
crux-ppc64-3.5.iso.md5), which can be found in the same directory as the
ISO image on the download site. If the checksums match the download was
successful and you can continue with burning the ISO image on a CD.
2. The ISO image is bootable, on Apple computers just insert the newly
burned CD-ROM into the first CD-ROM drive, reboot your computer and keep
the C key pressed to boot from CD-ROM. Select at the boot prompt the
kernel chrp32 for 604e cpu based systems, apple32 for G3/G4 cpu based
systems, apple64 and ppc970 for G5 cpu based systems or pseries for
RS64/POWERn cpu based machines.
On PegasosII systems you have to access the SmartFirmware? prompt and
type:
boot cd ppc/pegasos2/zImage.chrp root=/dev/sd??
where sd?? is the device of the CD-ROM Drive with the CRUX PPC CD-ROM
inserted in (e.g. sr0 or scd0).
On YDL PowerStation and others Maple/Bimini SLOF motherboard based
systems, as the cd does not autoboot, you have to access the SLOF prompt,
holding the S key during startup, and type:
boot cdrom [ENTER]
and when you are presented with the yaboot prompt, type:
cdrom:0,/ppc/ppc64/vmlinux root=/dev/sr0 [ENTER]
On Sam4x0 and IBM Power Systems, if the cd does not autoboot, you have to
set up your cdrom as a bootable device in the multi-boot menu (F1 or 1 at
the startup for IBM Power Systems or Enter for Sam4x0).
Note On all systems you might have to adjust the root= parameter (that
defaults to /dev/sr0) to your cdrom device. Please keep in mind that
device names vary according to your hardware configuration: The first
SCSI, SATA (or EFIKA IDE) disk is called /dev/sda, while the first SCSI
cdrom is called /dev/scd0 or /dev/sr0; the first IDE disk or cdrom is
called /dev/sda too. For more information about harddisk naming
conventions please checkout this HOWTO.
3. Login as root (no password required).
4. Mount your CRUX PPC root partition.
$ mount -t type /dev/sd?? /mnt
If your installation spans over more than one partition, then mount those
partitions as well. For example, if you have a different partition for
/var, then do:
$ mount -t type /dev/sd?? /mnt/var
5. Activate your swap partition(s).
$ swapon /dev/sd??
6. Type setup to start the package installation script. The script will
ask you where you mounted your root partition and which packages you want
to upgrade. It is a good idea to upgrade all packages, else you might get
into trouble later, e.g. in case a new version of some library isn't 100%
backwards compatible.
Note The setup script uses the /etc/pkgadd.conf of the target system to
determine which files to upgrade and which files not to upgrade. The files
that are not upgraded are put in /var/lib/pkg/rejected/ (Section 4.2.2,
Upgrading a Package).
When the setup script has upgraded the selected packages an upgrade log
will be displayed. Make sure the last line in the log says "0 error(s)".
If you at a later stage find that you need some additional packages you
can just mount the CRUX PPC CD-ROM and use pkgadd to install them (e.g.
pkgadd /mnt/crux/opt/package#1.0-1.pkg.tar.gz).
7. Now it's time to compile your kernel. The kernel compilation requires
that you "chroot" into your CRUX PPC installation.
$ mount -o bind /dev /mnt/dev
$ chroot /mnt /bin/bash
8. Go to /usr/src/linux-4.19.24.x, patch (if needed), configure and compile
a new kernel.
Useful kernel config files and patches are placed into the /usr/src
directory. They are the config files used to build the boot kernels.
Adjust /etc/fstab if needed.
WARNING udev reads files in /sys/* and /proc/*. Make sure that those
pseudo filesystems are enabled in your kernel configuration and available
during system-startup. Also note that unlike devfsd, udev doesn't
automatically mount /dev/pts. Terminal applications such as xterm(1) will
not work if you forget to mount it. If you want udev to detect your
connected USB hardware you'll need the USB-Filesystem mounted on
/proc/bus/usb. We highly recommend you check your fstab file.
9. On Apple computers, edit /etc/yaboot.conf to boot the kernel you just
compiled and run mkofboot -v to install yaboot into the boostrap
partition, then ybin -v to make the new system bootable.
For IBM RS/6000 and pSeries/System_p computers, edit /etc/yaboot.conf to
boot the kernel you just compiled and type dd if=/usr/lib/yaboot/yaboot
of=/dev/sd?? where sd?? is the device corresponding to the disk and PReP
Boot partition.
Note Remember that where /etc/yaboot.conf resides must be the first Ext2fs
formatted partition available on your disk.
10. Remove the CRUX PPC CD-ROM from your drive and reboot from harddisk.
Alternative Installation Methods
Network Installation
If you do not have a CD burner, are unable to boot your machine using the
CRUX CD-ROM or for any other reason are unable to install CRUX the normal
way (Section 2.2, Installing From CD-ROM) you might want to check out
HOWTO install GNU/Linux CRUX PPC on Genesi EFIKA or HOWTO install CRUX via
NFS by Juergen Daubert.
The Package System
Introduction
The package system (pkgutils) is made with simplicity in mind, where all
packages are plain tar.gz files (i.e. without any kind of meta data).
Packages follow the naming convention
<name>#<version>-<release>.pkg.tar.gz, where <name> is the name of the
program, <version> is the version number of the program, and <release> is
the version number of the package. The pkg.tar.gz extension is used
(instead of just tar.gz) to indicate that this is not just any tar.gz
file, but a tar.gz that is meant to be installed using pkgadd. This way it
is easy to tell packages apart from other tar.gz files.
pkgadd(8), pkgrm(8), pkginfo(8), and pkgmk(8) are the package management
utilities. With these utilities you can install, uninstall, inspect, make
packages and query the package database.
When a package is installed using pkgadd a new record is added to the
package database (stored in /var/lib/pkg/db). The basic package system
does not have any kind of dependency checking, thus it will not warn you
if you install a package that requires other packages to be installed. The
included prt-get and ilenia tools, however, do support dependencies.
The following sections will in short describe how to use the package
utilities. Additional information about these utilities can be found on
their respective man page.
Using the Package System
Installing a Package
Installing a package is done by using pkgadd. This utility requires at
least one argument, the package you want to install. Example:
$ pkgadd bash#3.2.33-1.pkg.tar.gz
When installing a package the package manager will ensure that no
previously installed files are overwritten. If conflicts are found an
error message will be printed and pkgadd will abort without installing the
package. The error message will contain the names of the conflicting
files. Example:
$ pkgadd bash#3.2.33-1.pkg.tar.gz
bin/sh
usr/man/man1/sh.1.gz
pkgadd error: listed file(s) already installed (use -f to ignore and overwrite)
To force the installation and overwrite the conflicting files you can use
the option -f (or --force). Example:
$ pkgadd -f bash#3.2.33-1.pkg.tar.gz
The package system allows a file to be owned by exactly one package. When
forcing an installation the ownership of the conflicting files will be
transferred to the package that is currently being installed. Directories
can however be owned by more than one package.
WARNING It is often not a good idea to force the installation unless you
really know what you are doing. If a package conflicts with already
installed files it could be a sign that the package is broken and installs
unexpected files. Use this option with extreme care, preferably not at
all.
As said earlier the package file itself does not contain any meta data.
Instead the package manager uses the package filename to determine the
package name and version. Thus, when installing a package file named
bash#3.2.33-1.pkg.tar.gz the package manager will interpret this as a
package named bash at version 3.2.33-1. If pkgadd is unable to interpret
the filename (e.g. # is missing or the filename does not end with
.pkg.tar.gz) an error message will be printed and pkgadd will abort
without installing the package.
Upgrading a Package
Upgrading a package is done using pkgadd with the -u option. Example:
$ pkgadd -u bash#3.2.33-1.pkg.tar.gz
This will replace the previously installed bash package with the new one.
If you have not previously installed bash, pkgadd will print an error
message. The package system does not care about the version number of the
package in that you can "upgrade" version 3.2.33-1 with version 2.04-1 (or
even with version 3.2.33-1 itself). The installed package will be replaced
with the specified package.
Upgrading a package is equivalent to executing pkgrm followed by pkgadd
with one (big) exception. When upgrading a package (with pkgadd -u) you
have the option to prevent some of the already installed files from
getting replaced. This is typically useful when you want to preserve
configuration and log files.
When executing pkgadd the file /etc/pkgadd.conf will be read. This file
can contain rules describing how pkgadd should behave when doing upgrades.
A rule is built out of three fragments; event, pattern and action. The
event describes in what kind of situation this rule applies. Currently
only one type of event is supported, that is UPGRADE. The pattern is a
filename pattern expressed as a regular expression and the action
applicable to the UPGRADE event is YES or NO. More than one rule of the
same event type is allowed, in which case the first rule will have the
lowest priority and the last rule will have the highest priority. Example:
#
# /etc/pkgadd.conf: pkgadd(8) configuration
#
UPGRADE ^etc/.*$ NO
UPGRADE ^var/log/.*$ NO
UPGRADE ^etc/X11/.*$ YES
UPGRADE ^etc/X11/xorg.conf$ NO
# End of file
The above example will cause pkgadd to never upgrade anything in /etc/ or
/var/log/ (subdirectories included), except files in /etc/X11/
(subdirectories included), unless it is the file /etc/X11/xorg.conf. The
default rule is to upgrade everything, rules in this file are exceptions
to that rule.
Note A pattern should never contain an initial "/" since you are referring
to the files in the package, not the files on the disk.
If pkgadd finds that a specific file should not be upgraded it will
install it under /var/lib/pkg/rejected/. Files in this directory are never
added to the package database. The user is then free to examine, use
and/or remove that file manually. Another option is to use rejmerge. For
each rejected file found in /var/lib/pkg/rejected/, rejmerge will display
the difference between the installed version and the rejected version. The
user can then choose to keep the installed version, upgrade to the
rejected version or perform a merge of the two. Example (using the above
/etc/pkgadd.conf):
$ pkgadd -u bash#3.2.33-1.pkg.tar.gz
pkgadd: rejecting etc/profile, keeping existing version
$ ls /var/lib/pkg/rejected/
etc/
$ ls /var/lib/pkg/rejected/etc/
profile
Removing a Package
Removing a package is done by using pkgrm. This utility requires one
argument, the name of the package you want to remove. Example:
$ pkgrm bash
WARNING This will remove all files owned by the package, no questions
asked. Think twice before doing it and make sure that you did not misspell
the package name since that could remove something completely different
(e.g. think about what could happen if you misspelled glib as glibc).
Querying the Package Database
Querying the package database is done using pkginfo. This utility has a
few options to answer different queries.
+------------------------------------------------------------------------+
| Option | Description ||
|-------------------------+---------------------------------------------||
| -i, --installed | List installed packages and their version. ||
|-------------------------+---------------------------------------------||
| -l, --list package|file | List files owned by the specified package ||
| | or contained in file ||
|-------------------------+----------------------------------------------|
| -o, --owner pattern | List owner(s) of file(s) matching pattern. |
+------------------------------------------------------------------------+
Examples:
$ pkginfo -i
atk 1.20.0-1
autoconf 2.61-1
automake 1.10-1
<...>
yaboot 1.3.14-1
zip 2.32-1
zlib 1.2.3-1
$ pkginfo -l bash
bin/
bin/bash
bin/sh
etc/
etc/profile
usr/
usr/man/
usr/man/man1/
usr/man/man1/bash.1.gz
usr/man/man1/sh.1.gz
$ pkginfo -l grep#2.5.3-1.pkg.tar.gz
usr/
usr/bin/
usr/bin/egrep
usr/bin/fgrep
usr/bin/grep
usr/man/
usr/man/man1/
usr/man/man1/egrep.1.gz
usr/man/man1/fgrep.1.gz
usr/man/man1/grep.1.gz
$ pkginfo -o bin/ls
Package File
coreutils bin/ls
e2fsprogs usr/bin/lsattr
module-init-tools sbin/lsmod
pciutils usr/sbin/lspci
usbutils usr/sbin/lsusb
Package management frontend: ilenia
Alenia is no longer part of cruxppc and all references to it should be
ignored. Use the regular crux "prt-get" utility instead.
To address the different requirements towards package management in CRUX
PPC, a number of users started discussion about an advanced package
management frontend to pkgutils, with dependency handling and support for
large install transactions. Ilenia and prt-get, are two tools which
provide a number of features on top of pkgutils while keeping pkgutils'
original character and power. Its main features are:
* Dependency handling
* Build logging
* Powerful search and query functionality
* Ports repositories hierarchy
Prt-get, instead, is the official project and tool of the CRUX project. A
full description can be found in the manual of prt-get.
Creating Packages
Creating a package is done using pkgmk. This utility uses a file called
Pkgfile, which contains information about the package (such as name,
version, etc) and the commands that should be executed in order to compile
the package in question. To be more specific, the Pkgfile file is actually
a bash(1) script, which defines a number of variables (name, version,
release and source) and a function (build). Below is an example of what a
Pkgfile file might look like. The example shows how to package the grep(1)
utility. Some comments are inserted for explanation.
# Specify the name of the package.
name=grep
# Specify the version of the package.
version=2.4.2
# Specify the package release.
release=1
# The source(s) used to build this package.
source=(ftp://ftp.gnu.org/gnu/$name/$name-$version.tar.gz)
# The build() function below will be called by pkgmk when
# the listed source files have been unpacked.
build() {
# The first thing we do is to cd into the source directory.
cd $name-$version
# Run the configure script with desired arguments.
# In this case we want to put grep under /usr/bin and
# disable national language support.
./configure --prefix=/usr --disable-nls
# Compile.
make
# Install the files, BUT do not install it under /usr, instead
# we redirect all the files to $PKG/usr by setting the DESTDIR
# variable. The $PKG variable points to a temporary directory
# which will later be made into a tar.gz-file. Note that the
# DESTDIR variable is not used by all Makefiles, some use prefix
# and others use ROOT, etc. You have to inspect the Makefile in
# question to find out. Some Makefiles do not support redirection
# at all. In those cases you will have to create a patch for it.
make DESTDIR=$PKG install
# Remove unwanted files, in this case the info-pages.
rm -rf $PKG/usr/info
}
In reality you do not include all those comments, thus the real Pkgfile
for grep(1) looks like this:
# Description: GNU grep, egrep and fgrep
# URL: http://www.gnu.org/software/grep/grep.html
# Maintainer: Per Lideacute;n, per at fukt dot bth dot se
name=grep
version=2.4.2
release=1
source=(ftp://ftp.ibiblio.org/pub/gnu/$name/$name-$version.tar.gz)
build() {
cd $name-$version
./configure --prefix=/usr --disable-nls
make
make DESTDIR=$PKG install
rm -rf $PKG/usr/info
}
Note The build() function in the example above is just an example of how
grep is built. The contents of the function can differ significantly if
the program is build in some other way, e.g. does not use autoconf.
When the build() function has been executed, the $PKG directory will be
made into a package named <name>#<version>-<release>.pkg.tar.gz. Before
the package creation is completed, pkgmk will check the content of the
package against the .footprint file. If this file does not exist, it will
be created and the test will be skipped. The .footprint file will contain
a list of all files that should be in the package if the build was
successful or a list of all the files that were installed in $PKG (if the
.footprint did not already exist). If there is a mismatch the test will
fail and an error message will be printed. You should not write the
.footprint file by hand. Instead, when a package has been upgraded and you
need to update the contents of the .footprint file you simply do pkgmk
-uf. This test ensures that a rebuild of the package turned out as
expected.
If the package built without errors it's time to install it by using
pkgadd and try it out. I highly recommend looking at the Pkgfile in
another package(s), since looking at examples is a great way to learn.
Adjusting/Configuring the Package Build Process
Many settings pertaining to the package build process can be adjusted by
editing the pkgmk(8) configuration file /etc/pkgmk.conf . Some of these
configurable settings include: