diff options
author | Silvino Silva <silvino@bk.ru> | 2016-08-20 05:35:06 +0100 |
---|---|---|
committer | Silvino Silva <silvino@bk.ru> | 2016-08-20 05:35:06 +0100 |
commit | c178db81d64eed21177b4c5d78ab3db7a785b7fe (patch) | |
tree | 986f5a2a25b3e7ab65de1fcba71648b1c405064f /core | |
parent | aa990cd7e4f7be6e760e9cbdd402041dfecca8c7 (diff) | |
download | doc-c178db81d64eed21177b4c5d78ab3db7a785b7fe.tar.gz |
initial ports, scripts revision
Diffstat (limited to 'core')
-rw-r--r-- | core/configure.html | 44 | ||||
-rw-r--r-- | core/install.html | 127 | ||||
-rw-r--r-- | core/ports.html | 233 |
3 files changed, 316 insertions, 88 deletions
diff --git a/core/configure.html b/core/configure.html index 744e340..c283adc 100644 --- a/core/configure.html +++ b/core/configure.html @@ -226,49 +226,47 @@ #shm /dev/shm tmpfs defaults 0 0 #usb /proc/bus/usb usbfs defaults 0 0 - #/ #/dev/sda3: - UUID=f7fce1b0-5117-4b76-8c0e-00870a824ab2 / ext4 defaults 0 1 + UUID=4ed0d5c1-d0c6-4eeb-bbbf-dc94f6f66efd / ext4 defaults 0 1 #/boot #/dev/sda2: - UUID=c8489141-7e72-4ddd-b27f-d21a6686bc23 /boot ext4 defaults,nodev,noexec,nosuid 0 2 + UUID=c304a4a0-bb4f-4d19-be62-75aaa6b713f3 /boot ext4 defaults,nodev,noexec,nosuid 0 2 #/boot/efi #/dev/sda1: - UUID=F74C-0993 /boot/efi vfat umask=0077 0 2 + UUID=15B2-1D41 /boot/efi vfat umask=0077 0 2 - #swap + #/var #/dev/sda4: - UUID=0ec84a34-8255-465d-83b0-091dabafeb41 none swap sw 0 0 + UUID=182a7038-1f14-4cea-88f8-4347a3e9c3a2 /var ext4 defaults,nodev,noexec,nosuid 0 2 - #/var + #/tmp #/dev/sda5: - UUID=8a417c13-95cd-40e3-bac7-e71a5a432985 /var ext4 defaults,nodev,noexec,nosuid 0 2 - + UUID=1325ee41-27c9-4621-ab69-125bb6e1c63b /tmp ext4 defaults,nodev,nosuid,noexec 1 2 - #/tmp + #/usr #/dev/sda6: - UUID=2ce9a85c-fc86-4583-9146-5e23de8a000c /tmp ext4 defaults,nodev,nosuid,noexec 1 2 + UUID=9004d59a-310c-44cc-a0f5-b338c2619af6 /usr ext4 defaults,nodev 0 2 - #/usr - #/dev/sda7: - UUID=c16a02a6-a1bc-4a5a-bdf3-b843a3e9b196 /usr ext4 defaults,nodev 0 2 + #/home + #/dev/sda7 + UUID=d1df6743-d3cb-4d5a-badb-96cef3181095 /home ext4 defaults,nodev,nosuid,noexec 0 2 + + #/usr/ports + #/dev/sda8 + #UUID=d1df6743-d3cb-4d5a-badb-96cef3181095 /usr/ports ext4 defaults,nodev,nosuid,noexec 0 2 - #/var/ports/work - #pkgmk /var/ports/work tmpfs size=20G,gid=101,uid=101,defaults 0 0 + #swap + #/dev/sda9: + #UUID=182a7038-1f14-4cea-88f8-4347a3e9c3a2 none swap sw 0 0 - ## Home /home - #UUID=935a4189-aea5-46c4-8e29-f9e9ace3addf /home ext4 defaults,nodev,nosuid,noexec 0 2 + #/usr/ports/work + #pkgmk /usr/ports/work tmpfs size=30G,gid=101,uid=101,defaults 0 0 devpts /dev/pts devpts noexec,nosuid,gid=tty,mode=0620 0 0 - #/dev/sda8: UUID="d2ba3926-0839-4179-b2b1-62256b51e964" TYPE="ext4" PARTUUID="71c78b3c-2898-47b7-adad-133f2b47eca8" - #/dev/sda10: UUID="1158f1d1-71d9-4f76-a54e-538e34419d0b" TYPE="ext4" PARTUUID="b90776d1-8051-4751-acc6-7477dbb04e4e" - #/dev/sda11: UUID="935a4189-aea5-46c4-8e29-f9e9ace3addf" TYPE="ext4" PARTUUID="6dd2492e-bd14-4177-9bc7-60bc3e330203" - # - # End of file </pre> diff --git a/core/install.html b/core/install.html index 93f2625..74e5cd0 100644 --- a/core/install.html +++ b/core/install.html @@ -33,8 +33,8 @@ <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, swap, var, tmp, - user, home and srv.</p> + separate partitions such as; boot, root, var, tmp, + usr, ports, swap and home.</p> <h3>/boot/efi</h3> @@ -42,18 +42,20 @@ with between 500M and 100M is recommended for standard installations.</p> - <pre>(parted) mkpart ESP fat32 2M 514M</pre> + <pre> + (parted) mkpart ESP fat32 1MiB 120MiB + </pre> <pre> - (parted) align-check optimal 1 + (parted) align-check opt 1 </pre> <h3>/boot</h3> - <p>Boot partition. Partition with 2G provides - room for bootable ISO.</p> + <p>Boot partition. Partition with 1G provides + room for crux iso to boot directly from grub.</p> - <pre>(parted) mkpart primary ext4 516M 2524M</pre> + <pre>(parted) mkpart primary ext4 120MiB 1000MiB</pre> <pre> (parted) align-check optimal 2 @@ -61,97 +63,91 @@ <h3>/</h3> - <p>Root partition with 2G is used in this example since i - usr and var are mounted on other partitions</p> + <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 2548M 4564M</pre> + <pre> + (parted) mkpart primary ext4 1000MiB 3000MiB + </pre> <pre> (parted) align-check optimal 3 </pre> - <h3>Swap (ram)</h3> - - <p>Swap partition with same memory as ram, example with - 4G. Other swap partitions can be added later for port - build on ram.</p> - - <pre>(parted) mkpart primary linux-swap 4568M 8576M</pre> - <h3>/var</h3> - <p>Var partition with 2G;</dd> + <p>Var partition is recommended 100MiB-500MiB, we will + use 1G;</dd> - <pre>(parted) mkpart primary ext4 8584M 10592M</pre> + <pre> + (parted) mkpart primary ext4 3000MiB 4000MiB + </pre> <pre> - (parted) align-check optimal 5 + (parted) align-check optimal 4 </pre> <h3>/tmp</h3> - <p>Temp partition with 1G;</dd> + <p>Temp partition with 20M-50M;</dd> - <pre>(parted) mkpart primary ext4 10640M 11648M</pre> + <pre> + (parted) mkpart primary ext4 4000MiB 4050MiB + </pre> <pre> - (parted) align-check optimal 6 + (parted) align-check optimal 5 </pre> <h3>/usr</h3> - <p>User partition with 8G;</dd> + <p>User partition with 4G is recommended for a desktop + setup, we will use 8G;</dd> - <pre>(parted) mkpart primary ext4 11656M 19664M</pre> + <pre> + (parted) mkpart primary ext4 4050MiB 12000MiB + </pre> <pre> - (parted) align-check optimal 7 + (parted) align-check optimal 6 </pre> ->>> <h3>/home</h3> + <h3>/home</h3> - <p>Home partition with 220G;</dd> + <p>Home partition with 180G;</dd> - <pre>(parted) mkpart primary ext4 19672M 220000M</pre> + <pre> + (parted) mkpart primary ext4 12000MiB 192000MiB + </pre> <pre> - (parted) align-check optimal 8 + (parted) align-check optimal 7 </pre> - <h3>/srv</h3> + <h3>/usr/ports</h3> - <p>Server data partition 300G, will contain services data, + <p>Ports partition with 120G allows to host sources, package backups and ports;</dd> - <pre>(parted) mkpart primary ext4 220008M 220016M</pre> - <pre> - (parted) align-check optimal 9 + (parted) mkpart primary ext4 192000MiB 312000MiB </pre> - <p>Check partition layout;</p> - <pre> - (parted) print - Model: ATA TOSHIBA MQ01ABD1 (scsi) - Disk /dev/sda: 1000GB - Sector size (logical/physical): 512B/512B - Partition Table: gpt - Disk Flags: + (parted) align-check optimal 8 + </pre> + + <h3>Swap (ram)</h3> - Number Start End Size File system Name Flags - 1 2097kB 514MB 512MB fat32 ESP - 2 516MB 2524MB 2008MB ext4 primary - 3 2548MB 4564MB 2016MB ext4 primary - 4 4568MB 8576MB 4009MB linux-swap(v1) primary - 5 8584MB 10.6GB 2008MB ext4 primary - 6 10.6GB 11.6GB 1008MB ext4 primary - 7 11.7GB 19.7GB 8008MB ext4 primary ->>> 8 238GB 260GB 21.7GB ext4 boot, esp - 10 260GB 277GB 17.8GB ext4 - 11 277GB 371GB 93.7GB ext4 + <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> - (parted) quit + <pre> + (parted) mkpart primary linux-swap 312000MiB 342000MiB </pre> <p>Create filesystems;</p> @@ -160,12 +156,12 @@ $ export BLK_EFI=/dev/sda1 $ export BLK_BOOT=/dev/sda2 $ export BLK_ROOT=/dev/sda3 - $ export BLK_SWAP=/dev/sda4 - $ export BLK_VAR=/dev/sda5 - $ export BLK_TMP=/dev/sda6 - $ export BLK_USR=/dev/sda7 ->>> $ # export BLK_HOME=/dev/sda8 - $ export BLK_SRV=/dev/sda10 + $ 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> @@ -182,8 +178,8 @@ $ sudo mkfs.ext4 $BKL_VAR $ sudo mkfs.ext4 $BKL_TMP $ sudo mkfs.ext4 $BKL_USR ->>> $ sudo mkfs.ext4 $BKL_HOME - $ sudo mkfs.ext4 $BKL_SRV + $ sudo mkfs.ext4 $BKL_HOME + $ sudo mkfs.ext4 $BKL_PRT </pre> <h2 id="step3">1.1.3. Prepare Target</h2> @@ -218,8 +214,9 @@ $ 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> diff --git a/core/ports.html b/core/ports.html new file mode 100644 index 0000000..9150430 --- /dev/null +++ b/core/ports.html @@ -0,0 +1,233 @@ +<!DOCTYPE html> +<html dir="ltr" lang="en"> + <head> + <meta charset='utf-8'> + <title>1.3. Ports</title> + </head> + <body> + + <a href="index.html">Core OS Index</a> + + <h1>1.3. Ports</h1> + + <p>For more information read crux handbook: + <a href="https://crux.nu/Main/Handbook3-2#ntoc14">Introduction to pkgutils</a>.</p> + + <dl> + <dt>pkgmk(8)</dt> + + <dd>Makes a software package. A package is an archive of + files (.pkg.tar.gz, .pkg.tar.bz2 or .pkg.tar.xz) + that can be installed using pkgadd(8).</dd> + + <dt>pkgadd(8)</dt> + + <dd>install a software package. A package is an + archive of files (.pkg.tar.gz).</dd> + + <dt>pkginfo(8)</dt> + + <dd>Displays information about software packages that + are installed on the system or that reside in a + particular directory.</dd> + + <dt>pkgrm(8)</dt> + + <dd>Removes/uninstalls a previously installed software + packages.</dd> + + <dt>prt-get(8)</dt> + + <dd>prt-get is a package management tool which + provides additional functionality to crux' package + management system. It works with the local ports tree + and is therefore fully compatible with ports(8) and + pkgmk(8)/pkgadd(8)</dd> + </dl> + + <p>This instructions are done + <a href="configure.html#chroot">inside chroot</a>.</p> + + <h2 id="fakeroot">1.3.1. Build as user</h2> + + <p>Install fakeroot and create user account, read + <a href="https://crux.nu/Wiki/FakerootPorts">Fakeroot Ports</a>;</p> + + <pre> + # pkgadd /media/crux/opt/fakeroot#1.20.2-1.pkg.tar.xz + </pre> + + <p>Add a user that will be used by ports tools, this example pkgmk;</p> + + <pre> + # useradd -U -m -d /usr/ports -s /bin/false pkgmk + </pre> + + <p>You can add your self to group pkgmk,</p> + + <pre> + # usermod -a -G pkgmk c9admin + </pre> + + <pre> + # chmod -R 774 /usr/ports + # chmod 775 /usr/ports + </pre> + + <h2 id="filesystem">1.3.2. Ports Layout</h2> + + <p>This configuration will build and save files + inside home directory of the user pkgmk. Work directory + will be mounted on ram to speed up the build process and + added to fstab. Let's start by creating layout directories</p> + + <pre> + # sudo -u pkgmk mkdir /usr/ports/distfiles + # sudo -u pkgmk mkdir /usr/ports/packages + # sudo -u pkgmk mkdir /usr/ports/work + # sudo -u pkgmk mkdir /usr/ports/pkgbuild + </pre> + + <p>Configure to + <a href="https://crux.nu/Wiki/HowToSpeedUpBuildingPackages#ram">compile in ram</a> + average of 3GB is recommended for core while firefox need at least 30G. + Discover id of pkgmk user;</p> + + <pre> + # id pkgmk + uid=102(pkgmk) gid=102(pkgmk) groups=102(pkgmk) + </pre> + + <p>Edit fstab, change uid to id of pkgmk, this example 102;</p> + + <pre> + pkgmk /usr/ports/work tmpfs size=30G,uid=102,defaults 0 0 + </pre> + + + <h2 id="pkgmk">1.3.3. Configure pkgmk</h2> + + <p>Read <a href="systemdoc/Handbook3-1.html#ntoc22">4.5. Adjust/Configure the Package Build Process</a> + and <a href="https://crux.nu/Wiki/HowToSpeedUpBuildingPackage">How to speed up building package</a> + to take advantage of your specific hardware. Packages build with + native flag will not run on different hardware. This is the best choice + if you want gcc to find the best settings based on your hardware.</p> + + <p>Edit /etc/pkgmk.conf and remove pipe from compiler + flags;</p> + + <pre> + export CFLAGS="-O2 -march=x86-64" + </pre> + + <p>If you want native build change the above example to;</p> + + <pre> + export CFLAGS="-O2 -march=native -mtune=native" + </pre> + + <p>Discover number of cores/cpus to hard code -j option.</p> + + <pre> + $ nproc + 2 + </pre> + + <p>Set number of cores to use;</p> + + <pre> + export MAKEFLAGS="-j2" + </pre> + + <p>Set separate distribution files, packages and work directories;</p> + + <pre> + # PKGMK_SOURCE_MIRRORS=() + # PKGMK_SOURCE_MIRRORS=(http://crux.nu/distfiles/) + PKGMK_SOURCE_DIR="/usr/ports/distfiles" + PKGMK_PACKAGE_DIR="/usr/ports/packages" + PKGMK_WORK_DIR="/usr/ports/work/$name" + </pre> + + <h2 id="prtget">1.3.4. Configure prt-get</h2> + + <p>Edit /etc/prt-get.conf and change to activate contrib port collection;</p> + + <pre> + # the following line enables the user maintained contrib collection + prtdir /usr/ports/contrib + </pre> + + <pre> + ### log options: + writelog enabled # (enabled|disabled) + logmode overwrite # (append|overwrite) + rmlog_on_success yes # (no|yes) + logfile /usr/ports/pkgbuild/%n.log + # path, %p=path to port dir, %n=port name + # %v=version, %r=release + </pre> + + <pre> + ### print README information: + readme verbose # (verbose|compact|disabled) + </pre> + + <pre> + ### prefer higher versions in sysup / diff + preferhigher yes # (yes|no) + </pre> + + <pre> + ### run pre- and post-installs scripts; yes is equivalent to the + ### --install-scripts option + runscripts yes # (no|yes) + </pre> + + <pre> + ### alternative commands + makecommand sudo -H -u pkgmk fakeroot pkgmk + addcommand pkgadd + removecommand pkgrm + runscriptcommand sh + </pre> + + <h2 id="pkginst">1.3.5. Install extra ports</h2> + + <p>Install additional ports like wireless-tools and grub2</p> + + <pre> + cp $CHROOT/media/crux/opt/* $CHROOT/usr/ports/packages + cp $CHROOT/media/crux/xorg/* $CHROOT/usr/ports/packages + </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> + + <a href="index.html">Core OS Index</a> + <p> + This is part of the SysDoc Manual. + Copyright (C) 2016 + Silvino Silva. + See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> + for copying conditions.</p> + </body> +</html> |