DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 26th October 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Post HOWTO: xorg/x11 without hald/dbus and with CTRL-ALT-BACKSPACE working

There were many questions regarding the oldschool xorg/x11 setup without hald/dbus and with old usefull terminate method by ctrl-alt-backspace, here is a short howto how to achieve this.

1. Install FreeBSD along with x11/xorg or add it by package.
root # pkg_add -r xorg
1.1. Enable and start moused(8) daemon if you already do not have it running.
root # echo moused_enable=\"YES\" >> /etc/rc.conf
root # /etc/rc.d/moused start
2. Generate new config.
root # X -configure
3. Move config to its proper place.
root # mv /root/xorg.conf.new /usr/local/etc/X11/xorg.conf
4. Add needed options to config in sections ServerFlags and InputDevice.
root # vi /usr/local/etc/X11/xorg.conf

Code:
Section "ServerFlags"
  (...)
  Option "DontZap"         "off"
  Option "AllowEmptyInput" "off"
  Option "AutoAddDevices"  "off"
EndSection

Section "InputDevice"
  (...)
  Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection


The following options are needed to have working x11 without hald/dbus:
Code:
Section "ServerFlags"
  (...)
  Option "AllowEmptyInput" "off"
  Option "AutoAddDevices"  "off"
EndSection


... and following for "three kings" or CTRL-ALT-BACKSPACE terminate keyboard shrtcut:
Code:
Section "ServerFlags"
  (...)
  Option "DontZap" "off"
EndSection

Section "InputDevice"
  (...)
  Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
5. Basic client configuration.
user % cat > ${HOME}/.xinitrc << EOF
xterm &
twm
EOF
6. Start x11/xorg.
user % xinit -- -dpi 75 -nolisten tcp
Example full xorg.conf config:
Code:
Section "ServerFlags"
  Option "DontZap"         "off"
  Option "AllowEmptyInput" "off"
  Option "AutoAddDevices"  "off"
EndSection

Section "InputDevice"
  Identifier "Keyboard0"
  Driver     "kbd"
  Option     "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Section "ServerLayout"
  Identifier  "xorg0"
  Screen 0    "screen0"   0 0
  InputDevice "mouse0"    "CorePointer"
  InputDevice "keyboard0" "CoreKeyboard"
EndSection

Section "Module"
  Load "dbe"
  Load "dri"
  Load "extmod"
  Load "glx"
EndSection

Section "InputDevice"
  Identifier "mouse0"
  Driver     "mouse"
  Option     "Protocol"     "auto"
  Option     "Device"       "/dev/sysmouse"
  Option     "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
  Identifier "monitor0"
  Option     "DPMS"
EndSection

Section "Device"
  Identifier "gfx0"
  Driver     "intel"
  Option     "DPMS"
EndSection

Section "Screen"
  Identifier "screen0"
  Device     "gfx0"
  Monitor    "monitor0"
  SubSection "Display"
    Modes "1440x900"
  EndSubSection
EndSection

Section "Files"
  ModulePath "/usr/local/lib/xorg/modules"
  FontPath   "/usr/local/lib/X11/fonts/misc/"
  FontPath   "/usr/local/lib/X11/fonts/TTF/"
  FontPath   "/usr/local/lib/X11/fonts/OTF"
  FontPath   "/usr/local/lib/X11/fonts/Type1/"
  FontPath   "/usr/local/lib/X11/fonts/100dpi/"
  FontPath   "/usr/local/lib/X11/fonts/75dpi/"
EndSection

For comparision, for OpenBSD its like that:

1. Install OpenBSD along with xenocara/x11.

2. Basic client configuration.
user % cat > ${HOME}/.xinitrc << EOF
xterm &
twm
EOF
3. Start x11/xorg.
user % xinit -- -dpi 75 -nolisten tcp


ADDED 2009/11/16
----------------

If you would like to disable CAPS LOCK key, then you should make the folllowing change in the xorg.conf file:

Code:
Section "InputDevice"
  Identifier "Keyboard0"
  Driver     "kbd"
- Option     "XkbOptions" "terminate:ctrl_alt_bksp"
+ Option     "XkbOptions" "terminate:ctrl_alt_bksp,ctrl:nocaps"                                                                    
EndSection
If you would like to also set other then default keyboard layout, then add this to xorg.conf file:

Code:
Section "InputDevice"
  Identifier "Keyboard0"
  Driver     "kbd"
  Option     "XkbOptions" "terminate:ctrl_alt_bksp"
+ Option     "XkbLayout" "pl"
EndSection
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #2   (View Single Post)  
Old 26th October 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 269
Thanked 23 Times in 23 Posts
Default

A few additions/comments, if you don't mind


I usually only have AutoAddDevices. AFAIK, AllowEmptyInput is not necessary. man xorg.conf:
Quote:
Option "AllowEmptyInput" "boolean"
If enabled, don't add the standard keyboard and mouse drivers,
if there are no input devices in the config file. Enabled by
default if AutoAddDevices and AutoEnableDevices is enabled, oth-
erwise disabled.
If AllowEmptyInput is on, devices using the
kbd, mouse or vmmouse driver are ignored.

Users may also have to enable/start the mouse daemon if they haven't already done so during/after the setup:
Quote:
Originally Posted by /etc/rc.conf
[...]
moused_enable="YES"
[...]
# /etc/rc.d/moused start


Finally, you may add -nolisten tcp to xinit if you don't need remote access to X.
You may also add an alias to your shell's rc file to save some typing:
Code:
alias xinit xinit -- -dpi 75 -nolisten tcp
__________________
May the source be with you!
Reply With Quote
  #3   (View Single Post)  
Old 26th October 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
Originally Posted by Beastie View Post
A few additions/comments, if you don't mind
I dont mind, I am open to discussion

Quote:
Originally Posted by Beastie View Post
I usually only have AutoAddDevices. AFAIK, AllowEmptyInput is not necessary.
I have just unscrewed my laptop (with FreeBSD) to make it little cleaner and to replace thermal grease, I will verify that after cleaning.

Quote:
Originally Posted by Beastie View Post
Users may also have to enable/start the mouse daemon if they haven't already done so during/after the setup:

# /etc/rc.d/moused start
My fault, I assumed that everybody has moused enabled.

Quote:
Originally Posted by Beastie View Post
, you may add -nolisten tcp to xinit if you don't need remote access to X.
You may also add an alias to your shell's rc file to save some typing:
Code:
alias xinit xinit -- -dpi 75 -nolisten tcp
Along with -br for black backgound (or -wr for white backgound) and -tst (disables testing extensions).

Thanks for adding your input mate.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #4   (View Single Post)  
Old 27th October 2009
Oko's Avatar
Oko Oko is offline
Fsck Surgeon
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 764
Thanked 36 Times in 32 Posts
Default

HAL will not be needed nor used by Xorg from the next release. All code relying on HAL is currently being removed from XOrg. Check the irc channel and developers mailing lists. I recently talked to one of core developers who came from the major XOrg conference.

Finally, little sanity among X developers

Last edited by Oko; 27th October 2009 at 03:52 AM.
Reply With Quote
  #5   (View Single Post)  
Old 27th October 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

That's good news, annoyed by the assumption of such a pointless feature.. HAL.. how silly.
Reply With Quote
  #6   (View Single Post)  
Old 27th October 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

@Oko

That is what I call a good news
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #7   (View Single Post)  
Old 27th October 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 269
Thanked 23 Times in 23 Posts
Default

That was expected. They took the decision, finally!

Anyway, I never used it. On all machines I've ever tried it, I had problems with optical drives. Automounting never worked and used to lock the drives and then the entire machine so bad, I had to power it down completely to recover (i.e. no power cycling possible). Options that were transfered from xorg.conf to HAL never worked anymore. As for polling every freaking piece of H/W every 2 seconds, argh!
Native drivers are like a billion times better and use way less reserved memory and processing power.

Let's hope DeviceKit (or any other replacement) will be just a *little bit* better. I'm not expecting too much, though.
__________________
May the source be with you!
Reply With Quote
  #8   (View Single Post)  
Old 27th October 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is online now
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,066
Thanked 198 Times in 156 Posts
Default

Good news indeed.

But what will they do now? Revert to the "classic" Xorg behaviour? Or some HAL-like replacement?
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #9   (View Single Post)  
Old 27th October 2009
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

@Carpetsmoker

s/HAL/DeviceKIT

According to several comparisions between hal and devicekit, hal is described as big monolithic shit that probes hardware every 2 seconds while devicekit is simple and modular blessing that heals all hal problems, we will have to wait to verify that, but IMHO we will be changing from one shit to another ... I just hope that I am wrong.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 27th October 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 269
Thanked 23 Times in 23 Posts
Default

That's what they always say every time they reimplement something for the hundredth time or ditch it for another "just-as-bad" (or at least "not-any-better") replacement.

*All* I hope for is that they continue to offer a choice between XYZ and nothing, and I'll only use native drivers as I've always done.
I personally never understood the use of such an additional layer.
__________________
May the source be with you!
Reply With Quote
Old 27th October 2009
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

Some form of Hardware Abstraction is usually a good idea when writing something like an X Server, just wait until HAL9000 starts speaking to your toaster oven :-P.

X developers sooner or later always sees the light of sanity... or meet an ALSA style straight jacket.


I've no beefs with PolicyKit or PackageKit, but no opinions on HAL, other then we've survived for years without it in X.Org, most of them perfectly fine. The changeover didn't screw me in the least, whatever's happened to anyone else.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 27th March 2010
bashrules bashrules is offline
Port Guard
 
Join Date: Mar 2010
Location: Here
Posts: 16
Thanked 0 Times in 0 Posts
Default

I'm in the process of setting up NetBSD's pkgsrc on top of Slackware 13. I want to have an "old school" system without dbus/hal etc.

A lot of programs from pkgsrc have dbus as a non-optional dependency. I can't avoid not to install some of these. Firefox comes to my mind. Any idea how to install such programs without installing dbus/hal as well?

I'm using pkgsrc-2009Q4.

Bash
Reply With Quote
Old 27th March 2010
adamk adamk is offline
Spam Deminer
 
Join Date: May 2008
Posts: 250
Thanked 5 Times in 8 Posts
Default

Quote:
Originally Posted by bashrules View Post
I'm in the process of setting up NetBSD's pkgsrc on top of Slackware 13. I want to have an "old school" system without dbus/hal etc.

A lot of programs from pkgsrc have dbus as a non-optional dependency. I can't avoid not to install some of these. Firefox comes to my mind. Any idea how to install such programs without installing dbus/hal as well?

I'm using pkgsrc-2009Q4.

Bash
Rewrite the code to remove the dependency? :-)

Adam
Reply With Quote
Old 27th March 2010
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,052
Thanked 118 Times in 93 Posts
Default

Quote:
Originally Posted by bashrules View Post
I'm in the process of setting up NetBSD's pkgsrc on top of Slackware 13.
Slackware is still Linux, what You expected, that You could get away without hald or dbus these times with Linux?

If You find a way to get along without them, then let us know.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
Old 27th March 2010
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 554
Thanked 14 Times in 13 Posts
Default

@ bashrules: Is there a reason to want to roll your own firefox for Linux? (There might be, just asking.)

Re firefox itself, the Linux binary distributed by mozilla doesn't seem to require libhal or libdbus:

Code:
> ldd /usr/local/firefox-3.6.2/firefox-bin
        linux-gate.so.1 =>  (0xffffe000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb803a000)
        libxul.so => not found
        libmozjs.so => not found
        libxpcom.so => not found
        libplds4.so => not found
        libplc4.so => not found
        libnspr4.so => not found
        libdl.so.2 => /lib/libdl.so.2 (0xb8035000)
        libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0xb7ccf000)
        libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0xb7cb6000)
        libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0xb7c33000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0xb7c1c000)
        libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0xb7c13000)
        libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0xb7bd7000)
        libcairo.so.2 => /usr/lib/libcairo.so.2 (0xb7b77000)
        libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7b3d000)
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb7b39000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7a6c000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb7985000)
        libasound.so.2 => /usr/lib/libasound.so.2 (0xb78c4000)
        libm.so.6 => /lib/libm.so.6 (0xb789e000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb77b8000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb77ac000)
        libc.so.6 => /lib/libc.so.6 (0xb7660000)
        /lib/ld-linux.so.2 (0xb8064000)
        libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0xb765d000)
        libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb765a000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb7655000)
        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb762b000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb761d000)
        libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7615000)
        libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0xb7612000)
        libXi.so.6 => /usr/lib/libXi.so.6 (0xb760a000)
        libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb7604000)
        libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0xb75fa000)
        libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0xb75d3000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7563000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb754f000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7514000)
        libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0xb74de000)
        libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb74dc000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb74c5000)
        librt.so.1 => /lib/librt.so.1 (0xb74bc000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb749c000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb7498000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7493000)
Reply With Quote
Old 27th March 2010
bashrules bashrules is offline
Port Guard
 
Join Date: Mar 2010
Location: Here
Posts: 16
Thanked 0 Times in 0 Posts
Default

I'm back.

I just figured out that you only get a dbus dependency if you play too much with pkgsrc's configuration file I Usually, there is none

In the last couple of hours, I compiled a lot of pkgsrc programs. It works like a charm on Slackware I tried this already a few years ago, but gave up because too many pkgsrc programs didn't compile.

Welcome to BSD on Linux.
Reply With Quote
Old 27th March 2010
bashrules bashrules is offline
Port Guard
 
Join Date: Mar 2010
Location: Here
Posts: 16
Thanked 0 Times in 0 Posts
Default

Some other important programs from the pkgsrc do include dbus, though.

.include "../../sysutils/dbus/buildlink3.mk"
.include "../../sysutils/dbus-glib/buildlink3.mk"

That are audacious and xfce4. Let's see how many other programs I'll encounter lateron. Oh well. I'm about to accept my fate.

Bash
Reply With Quote
Reply

Tags
backspace, dbus, hal, hald, x11, xorg, xorg.conf

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hald(1) and nautilus(1) does not automount media vermaden FreeBSD Ports and Packages 3 2nd November 2009 06:17 PM
HOWTO: Working Intel Graphics Card Setup vermaden FreeBSD Installation and Upgrading 2 3rd July 2009 07:59 PM
dbus-daemon lumiwa FreeBSD General 2 2nd October 2008 12:05 AM
Ctrl-D and Ctrl-C sometimes dose not work mfaridi FreeBSD General 9 6th July 2008 07:04 AM
Backspace Annoyance schrodinger FreeBSD General 2 3rd June 2008 12:11 PM


All times are GMT. The time now is 01:00 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick