Gentoo install debian package




















Here's the relevant part of gentoo 's Makefile [25] :. As explained above, that directory hierarchy is reserved for local use on Debian, so change those paths as follows:.

The exact locations that should be used for binaries, icons, documentation, etc. You should browse through it and read the sections relevant to your package. Some programs don't use Makefile variables to define paths such as these. This means you might have to edit some real C sources in order to fix them to use the right locations.

But where to search, and exactly what for? You can find this out by issuing:. This can be done automatically as follows:. Next you should find the install target searching for the line that starts with install: will usually work and rename all references to directories other than ones defined at the top of the Makefile. Originally, gentoo 's install target said:. Live environments and stage archives can be downloaded using the links below.

Minimal Installation CD , Stage 3. If you are unsure what you need to download, please refer to the Gentoo Handbook for the complete installation documentation. It explains how you can find the right architecture for your machine and which files you need at what stage of the installation process. While the core system packages within the stage files work fine in the main gentoo repository, musl-specific fixes for additional packages can be found in the musl overlay.

If you encounter problems, you may want to consider adding this overlay to your installation. Instructions how to do so can be found, e.

Running iw might show something like:. Confirm the wireless settings by using iw dev wlp9s0 link. Once wireless is working, continue configuring the IP level networking options as described in the next section Understanding network terminology or use the net-setup tool as described previously. If all of the above fails, the network will need to be configured manually. This is not difficult at all. However, some knowledge of network terminology and basic concepts might be necessary.

After reading this section, users will know what a gateway is, what a netmask serves for, how a broadcast address is formed and why systems need nameservers. In a network, hosts are identified by their IP address Internet Protocol address. Such an address is perceived as a combination of four numbers between 0 and Well, at least when using IPv4 IP version 4. In reality, such an IPv4 address consists of 32 bits ones and zeros. Let's view an example:.

Such an IP address is unique to a host as far as all accessible networks are concerned i. In order to distinguish between hosts inside and outside a network, the IP address is divided in two parts: the network part and the host part. The separation is written down with the netmask, a collection of ones followed by a collection of zeros.

The part of the IP that can be mapped on the ones is the network-part, the other one is the host-part. As usual, the netmask can be written down as an IP address. The broadcast address is an IP address with the same network-part as the network, but with only ones as host-part. Every host on the network listens to this IP address. It is truly meant for broadcasting packets.

To be able to surf on the Internet, each computer in the network must know which host shares the Internet connection. This host is called the gateway. Since it is a regular host, it has a regular IP address for instance Previously we stated that every host has its own IP address.

To be able to reach this host by a name instead of an IP address we need a service that translates a name such as dev. Such a service is called a name service. In some cases, the gateway also serves as a nameserver. Otherwise the nameservers provided by the ISP need to be entered in this file.

To assign an IP address, the IP address, broadcast address, and netmask are needed. More than one nameserver can be added:.

Now test the network by pinging an Internet server like Google's 8. Once connected, continue with Preparing the disks. Let's take a good look at disk-oriented aspects of Gentoo Linux and Linux in general, including block devices, partitions, and Linux filesystems. Once the ins and outs of disks are understood, partitions and filesystems can be established for installation.

To begin, let's look at block devices. The following table will help readers determine where to find a certain type of block device on the system:. The block devices above represent an abstract interface to the disk. The program can simply address the storage on the disk as a bunch of contiguous, randomly-accessible byte 4K blocks.

Although it is theoretically possible to use a raw, unpartitioned disk to house a Linux system when creating a btrfs RAID for example , this is almost never done in practice. Instead, disk block devices are split up into smaller, more manageable block devices. On amd64 systems, these are called partitions. The location in which it stores the partition information is much bigger than the bytes of the MBR partition table DOS disklabel , which means there is practically no limit on the amount of partitions for a GPT disk.

Also the size of a partition is bounded by a much greater limit almost 8 ZiB - yes, zebibytes. GPT also takes advantage of checksumming and redundancy.

It carries CRC32 checksums to detect errors in the header and partition tables and has a backup GPT at the end of the disk. This backup table can be used to recover damage of the primary GPT near the beginning of the disk.

MBR uses bit identifiers for the start sector and length of the partitions, and supports three partition types: primary, extended, and logical. Primary partitions have their information stored in the master boot record itself - a very small usually bytes location at the very beginning of a disk. In order to support more partitions, one of the primary partitions in the MBR can be marked as an extended partition.

This partition can then contain additional logical partitions partitions within a partition. LVM increases the flexibility offered by the partitioning setup. The installation instructions below will focus on "regular" partitions, but it is good to know LVM is supported if that route is desired. Visit the LVM article for more details. Newcomers beware: although fully supported, LVM is outside the scope of this guide.

While it is possible to mix and match, that goes beyond the scope of this manual. If this suffices as information, the advanced reader can directly skip ahead to the actual partitioning. Both fdisk and parted are partitioning utilities.

Here, fdisk is used since it has a better text-based user interface. Before going to the creation instructions, the first set of sections will describe in more detail how partitioning schemes can be created and mention some common pitfalls.

The design of disk partition layout is highly dependent on the demands of the system and the file system s applied to the device. How many partitions and how big very much depends on considering the trade-offs and choosing the best option for the circumstance. Separate partitions or volumes have the following advantages:. There is no perfect value for swap space size. The purpose of the space is to provide disk storage to the kernel when internal memory RAM is under pressure.

A swap space allows for the kernel to move memory pages that are not likely to be accessed soon to disk swap or page-out , which will free memory in RAM for the current task. Of course, if the pages swapped to disk are suddenly needed, they will need to be put back in memory page-in which will take considerably longer than reading from RAM as disks are very slow compared to internal memory.

When a system is not going to run memory intensive applications or has lots of RAM available, then it probably does not need much swap space. However do note in case of hibernation that swap space is used to store the entire contents of memory likely on desktop and laptop systems rather than on server systems.

If the system requires support for hibernation, then swap space larger than or equal to the amount of memory is necessary. As a general rule, the swap space size is recommended to be twice the internal memory RAM.

The faster a disk can swap, the faster the system will run when data in swap space must be accessed. When choosing between rotational and solid state disks, it is better for performance to put swap on the SSD. Also, swap files can be used as an alternative to swap partitions; this is mostly interesting for systems with very limited disk space. The instructions below contain the necessary pointers to correctly handle this operation.

After partitioning, format the ESP accordingly:. It is a very small 1 to 2 MB partition in which boot loaders like GRUB2 can put additional data that doesn't fit in the allocated storage. It will not be used in this guide. The example partition layout was mentioned earlier:. Use the p key to display the disk's current partition configuration:. This particular disk was configured to house two Linux filesystems each with a corresponding partition listed as "Linux" as well as a swap partition listed as "Linux swap".

Type g to create a new GPT disklabel on the disk; this will remove all existing partitions. For an existing GPT disklabel see the output of p above , alternatively consider removing the existing partitions one by one from the disk. Type d to delete a partition. The partition has now been scheduled for deletion. It will no longer show up when printing the list of partitions p , but it will not be erased until the changes have been saved.

This allows users to abort the operation if a mistake was made - in that case, type q immediately and hit Enter and the partition will not be deleted.

Repeatedly type p to print out a partition listing and then type d and the number of the partition to delete it. Eventually, the partition table will be empty:. Type n to create a new partition, followed by 1 to select the first partition. When prompted for the first sector, make sure it starts from which may be needed for the boot loader and hit Enter.

When prompted for the first sector, hit Enter. After all this is done, type t to set the partition type, 2 to select the partition just created and then type in 19 to set the partition type to "Linux Swap". Finally, to create the root partition, type n to create a new partition. When prompted for the last sector, hit Enter to create a partition that takes up the rest of the remaining space on the disk.

After completing these steps, typing p should display a partition table that looks similar to this:. To save the partition layout and exit fdisk , type w. The example partition layout mentioned earlier is now:. This particular disk was until now configured to house two Linux filesystems each with a corresponding partition listed as "Linux" as well as a swap partition listed as "Linux swap" , using a GPT table. Type o to create a new MBR disklabel here also named DOS disklabel on the disk; this will remove all existing partitions.

For an existing DOS disklabel see the output of p above , alternatively consider removing the existing partitions one by one from the disk. Type n to create a new partition, followed by p for a primary partition and 1 to select the first primary partition. After all this is done, type t to set the partition type, 2 to select the partition just created and then type in 82 to set the partition type to "Linux Swap".

Now that the partitions have been created, it is time to place a filesystem on them. In the next section the various file systems that Linux supports are described. Readers that already know which filesystem to use can continue with Applying a filesystem to a partition. The others should read on to learn about the available filesystems Linux supports several dozen filesystems, although many of them are only wise to deploy for specific purposes.

Only certain filesystems may be found found stable on the amd64 architecture - it is advised to read up on the filesystems and their support state before selecting a more experimental one for important partitions.

The below is a non-exaustive list. To create a filesystem on a partition or volume, there are user space utilities available for each possible filesystem. Click the filesystem's name in the table below for additional information on each filesystem:. When using ext4 on a small partition less than 8 GiB , then the file system must be created with the proper options to reserve enough inodes.

This can be done using one of the following commands, respectively:. This will generally quadruple the number of inodes for a given file system as its "bytes-per-inode" reduces from one every 16kB to one every 4kB. To activate the swap partition, use swapon :. Now that the partitions have been initialized and are housing a filesystem, it is time to mount those partitions.

Use the mount command, but don't forget to create the necessary mount directories for every partition created. As an example we mount the root partition:.

Later in the instructions the proc filesystem a virtual interface with the kernel as well as other kernel pseudo-filesystems will be mounted. But first we install the Gentoo installation files. Before installing Gentoo, it is a good idea to be sure the date and time are set correctly. A misconfigured clock may lead to strange issues with the installation: base system files should be extracted with accurate time stamps.

In fact, due to Gentoo's web based services using security certificates, it might not be possible to download the installation files if the system clock is too far skewed. An accurate clock is a requirement for proceeding with the installation. Verify the current date and time by running the date command:. It can be used to automatically sync the system clock to UTC time using a time server.

Using this method requires a working network configuration and may not be available on all architectures. For systems that do not have access to a time server, the date command can also be used to set the system clock. UTC time is recommended for all Linux systems. A timezone will be defined later in the installation which will modify the clock to display local time.

Choosing a base tarball for the system can save a considerable amount of time later on in the installation process, specifically when it is time to choose a system profile. The selection of a stage tarball will directly impact future system configuration and can save a headache or two later on down the line. The multilib tarball uses bit libraries when possible, and only falls back to the bit versions when necessary for compatibility. This is an excellent option for the majority of installations because it provides a great amount of flexibility for customization in the future.

Those who desire their systems to be capable of easily switching profiles should download the multilib tarball option for their respective processor architecture.

Most users should not use the 'advanced' tarballs options; they are for specific software or hardware configurations. Selecting a no-multilib tarball to be the base of the system provides a complete bit operating system environment.

This effectively renders the ability to switch to multilib profiles improbable, although still technically possible. It is Gentoo's native and original init system, but is also deployed by a few other Linux distributions and BSD systems. This means a solution can be found to run the dozens of daemons in the Gentoo ebuild repository. For historical reasons only, this manual focuses on installation and configuration using OpenRC. Rewriting and enhancing it to also explain a systemd installation see below is planned.

It is used as the primary init system by a majority of Linux distributions. Unfortunately, the corresponding installation Handbook sections for system still need to be written or are work in progress. It something seems lacking in the Handbook for a systemd install path, review the systemd article before asking for support. Those using environments with fully graphical web browsers will have no problem copying a stage file URL from the main website's download section.

Simply select the appropriate tab, right click the link to the stage file, then Copy Link to copy the link to the clipboard, then paste the link to the wget utility on the command-line to download the stage tarball:.

To download a stage, surf to the Gentoo mirror list like so:. Like links it is a non-graphical browser but it is not menu-driven. On the mirror list, select a mirror close by. Usually HTTP mirrors suffice, but other protocols are available as well. There all available stage files are displayed they might be stored within subdirectories named after the individual sub-architectures.

Select one and press d to download. After the stage file download completes, it is possible to verify the integrity and validate the contents of the stage tarball. Those interested should proceed to the next section.

Those not interested in verifying and validating the stage file can close the command-line browser by pressing q and can move directly to the Unpacking the stage tarball section. Like with the minimal installation CDs, additional downloads to verify and validate the stage file are available. Although these steps may be skipped, these files are provided for users who care about the legitimacy of the file s they just downloaded.

Use openssl and compare the output with the checksums provided by the. Another way is to use the shasum command:. Compare the output of these commands with the value registered in the. The values need to match, otherwise the downloaded file might be corrupt or the digests file is.

Just like with the ISO file, it is also possible to verify the cryptographic signature of the. The fingerprints of the OpenPGP keys used for signing release media can be found on the release media signatures page of the Gentoo webserver. Now unpack the downloaded stage onto the system. Use the tar utility to proceed:. The x stands for e x tract, the p for p reserve permissions and the f to denote that we want to extract a f ile not standard input.

Finally, --numeric-owner is used to ensure that the user and group IDs of the files being extracted from the tarball will remain the same as Gentoo's release engineering team intended even if adventurous users are not using official Gentoo live environments.

Now that the stage file is unpacked, proceed with Configuring the compile options. To optimize the system, it is possible to set variables which impact the behavior of Portage, Gentoo's officially supported package manager.

All those variables can be set as environment variables using export but setting via export is not permanent. Portage reads in the make. Fire up an editor in this guide we use nano to alter the optimization variables we will discuss hereafter.

From the make. Several of those variables are discussed in the next section. Although those are defined generally here, for maximum performance one would need to optimize these flags for each program separately. The reason for this is because every program is different.

However, this is not manageable, hence the definition of these flags in the make. In make. Don't place experimental settings in this variable; too much optimization can make programs misbehave crash, or even worse, malfunction. We will not explain all possible optimization options. To understand them all, read the GNU Online Manual s or the gcc info page info gcc - only works on a working Linux system. The make.

Possible options are described in the make. A commonly used value is native as that tells the compiler to select the target architecture of the current system the one users are installing Gentoo on. A second one is the -O flag that is a capital O, not a zero , which specifies the gcc optimization class flag.

Possible classes are s for size-optimized , 0 zero - for no optimizations , 1, 2 or even 3 for more speed-optimization flags every class has the same flags as the one before, plus some extras. Another popular optimization flag is -pipe use pipes rather than temporary files for communication between the various stages of compilation.

It has no impact on the generated code, but uses more memory. On systems with low memory, gcc might get killed. In that case, do not use this flag. Using -fomit-frame-pointer which doesn't keep the frame pointer in a register for functions that don't need one might have serious repercussions on the debugging of applications.

The default values contained in the stage3 archive that is unpacked should be good enough. The following one is just an example:.

Then continue with Installing the Gentoo base system. In order to download source code quickly it is recommended to select a fast mirror. Portage will look in the make. It is possible to surf to the Gentoo mirror list and search for a mirror or mirrors that is close to the system's physical location as those are most frequently the fastest ones.

However, we provide a nice tool called mirrorselect which provides users with a nice interface to select the mirrors needed. Just navigate to the mirrors of choice and press Spacebar to select one or more mirrors. Next to these, Portage will check if the binary package is built using the same USE flags as expected on the client.

If a package is built with a different USE flag combination, Portage will either ignore the binary package and use source-based build or fail, depending on the options passed to the emerge command upon invocation see Installing binary packages.

There are a few options that can be passed on to the emerge command that inform Portage about using binary packages:. Otherwise, the client will not know where the binary packages are stored which results in Portage being unable to retrieve them. This allows administrators to use several binary package servers simultaneously. The URI must always point to the directory in which the Packages file resides.

Passing the --rebuilt-binaries option to emerge will reinstall every binary that has been rebuilt since the package was installed. This is useful in case rebuilding tools like revdep-rebuild are run on the binary package server. A related option is --rebuilt-binaries-timestamp.

It causes emerge not to consider binary packages for a re-install if those binary packages have been built before the given time stamp. This is useful to avoid re-installing all packages, if the binary package server had to be rebuild from scratch but --rebuilt-binaries is used otherwise. Next to the getbinpkg feature, Portage also listens to the binpkg-logs feature.

This one controls if log files for successful binary package installations should be kept. Similar to excluding binary packages for a certain set of packages or categories, clients can be configured to exclude binary package installations for a certain set of packages or categories.

Exporting and distributing the binary packages will lead to useless storage consumption if the binary package list is not actively maintained. It allows for maintaining Portage-related variable files, such as downloaded source code files, but also binary packages.

The following command will remove all binary packages that have no corresponding ebuild in the installed ebuild repositories:. However, this tool is a bit less configurable. To clean up unused binary packages in the sense of used by the server on which the binary packages are stored :.

Inside the packages directory exists a manifest file called Packages. This file acts as a cache for the metadata of all binary packages in the packages directory. The file is updated whenever Portage adds a binary package to the directory.



0コメント

  • 1000 / 1000