Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: HOWTO: Setup Laptop Hardware Profiles(docked-undocked)/HOWTO: Modify init scripts

  1. #11
    Join Date
    Jul 2007
    Beans
    3

    Re: HOWTO: Setup Laptop Hardware Profiles(docked-undocked)/HOWTO: Modify init scripts

    Quote Originally Posted by andrewsawyer View Post
    Hi All,

    I have been trying to get this to work with 6.10 however I'm having problems. I hope someone might be able to help me.

    I can see that I needed to make some changes, using xorg.conf instead of XF86Config, so my /etc/init.d/xsetup file is as follows:

    Code:
    #!/bin/sh
    
    case "$1" in
        start|restart|force-reload)
    	echo -n "Configuring the X server: "
    	echo cp /etc/X11/xorg.conf.$RUNLEVEL /etc/X11/xorg.conf
    	cp /etc/X11/xorg.conf.$RUNLEVEL /etc/X11/xorg.conf
    	echo "Done"
    	;;
        lcd)
    	echo -n "Configuring X for Single Monitor: "
    	cp /etc/X11/xorg.conf.3 /etc/X11/xorg.conf
    	echo "Done"
    	;;
        crt)
    	echo -n "Configuring X for Xinerama: "
    	cp /etc/X11/xorg.conf.2 /etc/X11/xorg.conf
    	echo "Done"
    	;;
        stop)
    	echo To stop X, kill the gdm process manually
    	ps -ef | grep gdm
    	echo "Done"
    	;;
        *)
    	echo "Usage: /etc/init.d/xsetup {start|lcd|crt|stop|restart|force-reload}"
    	exit 1
    	;;
    esac
    
    exit 0
    unfortunately, which ever boot option I choose, I get Xinerama - it doesn't copy the xorg.conf file.

    Does anyone have any suggestions on a fix for this?

    Cheers,

    Andy
    Andy, I made some modifications metioned below .... And it works on Ubuntu Fiesty !!

    Try the following, and remember to backup all the files you are editing..

    I modfied my /etc/event.d/rc-default file [the modified part is in bold]

    # rc - runlevel compatibility
    #
    # This task guesses what the "default runlevel" should be and starts the
    # appropriate script.

    start on stopped rcS

    script
    runlevel --reboot || true

    if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
    telinit S
    elif grep -qE -w -- "[0-9]" /proc/cmdline; then
    RL="$(grep -Eo -w -- "[0-9]" /proc/cmdline)"
    if [ -n "$RL" ]; then
    telinit $RL
    else
    telinit 2
    fi

    elif [ -r /etc/inittab ]; then
    RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
    if [ -n "$RL" ]; then
    telinit $RL
    else
    telinit 2
    fi
    else
    telinit 2
    fi
    end script

    The following is my /boot/grub/menu.lst file to pass the the runlevel 3 parameter.

    title Ubuntu - Laptop Mode [2.6.20-16-generic]
    root (hd0,5)
    kernel /vmlinuz-2.6.20-16-generic root=UUID=4a2ed98c-a04c-47eb-b978-4b3e4ae1ea59 ro quiet splash 3
    initrd /initrd.img-2.6.20-16-generic
    quiet
    savedefault

  2. #12
    Join Date
    May 2005
    Location
    Sydney, Australia
    Beans
    360
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: HOWTO: Setup Laptop Hardware Profiles(docked-undocked)/HOWTO: Modify init scripts

    Thank you!

    I'll give it a try!

    Andy

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •