Introduction
This article will guide you through the process of installing Xorg on a Gentoo system with a binary kernel, allowing you to turn your laptop's screen on during startup using the Gentoo CLI. The problem of the screen not turning on during startup can occur due to various reasons, and this article aims to provide a detailed and comprehensive solution.
Prerequisites
Before proceeding with the installation, ensure that you have a Gentoo system with a binary kernel installed. You should also have a basic understanding of the Gentoo CLI and the Xorg system.
Installing Xorg
To install Xorg, you need to emerge the Xorg meta-package. The following command will install Xorg and all its dependencies:
# emerge -av x11-base/xorg-server
Once the installation is complete, you need to configure the Xorg server. To do this, create a new file named xorg.conf in the /etc/X11/ directory and add the following configuration:
Section "Device"
Identifier "Videocard0"
Driver "intel"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection
The above configuration sets up the Xorg server to use the Intel driver and sets the screen resolution to 1024x768. You can modify the configuration to suit your needs.
Starting Xorg at Startup
To start Xorg at startup, you need to create a new script in the /etc/init.d/ directory. The following script will start Xorg when the system boots:
#!/sbin/runscript
depend() {
need net
}
start() {
ebegin "Starting Xorg server"
/usr/bin/X :0 &
eend $?
}
stop() {
ebegin "Stopping Xorg server"
killall X
eend $?
}
Once the script is created, you need to add it to the default runlevel. To do this, run the following command:
# rc-update add xorg default
Turning the Screen On During Startup
To turn the screen on during startup, you need to modify the /etc/inittab file. Add the following line to the file:
x:2345:respawn:/usr/bin/X :0 -nolisten tcp
The above line starts the Xorg server when the system enters runlevels 2, 3, 4, or 5. The -nolisten tcp option disables TCP listening, which is not required for a local Xorg server.
Changing TTY
To change the TTY during startup, you need to modify the /etc/conf.d/local.start file. Add the following line to the file:
openvt --console 1 --login
The above line opens a new virtual terminal and starts a login prompt. The --console 1 option sets the console number to 1, which is the first virtual terminal.
- Installed Xorg and all its dependencies using the emerge command.
-
Configured the Xorg server by creating a new
xorg.conffile. -
Created a new script in the
/etc/init.d/directory to start Xorg at startup. -
Modified the
/etc/inittabfile to turn the screen on during startup. -
Modified the
/etc/conf.d/local.startfile to change the TTY during startup.