LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxQuestions.org Member Success Stories (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/)
-   -   Tinycore swapping between vesa and nvidia at boot (https://www.linuxquestions.org/questions/linuxquestions-org-member-success-stories-23/tinycore-swapping-between-vesa-and-nvidia-at-boot-4175478485/)

aus9 09-25-2013 07:47 AM

Tinycore swapping between vesa and nvidia at boot
 
Hi

This is how to successfully choose different graphic setups, mainly for a vesa and nvidia setup for an USB stick. Intel setup is for a different computer so not shown.

BOOTLOADER config - grub-legacy
Quote:

default 0
timeout 3
color cyan/blue white/blue

title NV
kernel /boot/vmlinuz tce=LABEL=usbp1 home=LABEL=usbp1 opt=LABEL=usbp1 waitusb=8:LABEL=usbp1 snd=/opt/nv.sh lst=nv.lst tz=UTC-8
initrd /boot/477.gz

title INTEL
kernel /boot/vmlinuz tce=LABEL=usbp1 home=LABEL=usbp1 opt=LABEL=usbp1 waitusb=8:LABEL=usbp1 snd=/opt/intel.sh lst=intel.lst tz=UTC-8 video.allow_duplicates=1
initrd /boot/477.gz

title VESA
kernel /boot/vmlinuz tce=LABEL=usbp1 home=LABEL=usbp1 opt=LABEL=usbp1 waitusb=8:LABEL=usbp1 snd=/opt/vesa.sh lst=vesa.lst tz=UTC-8
initrd /boot/477.gz
I have more boot options than above.
The partitions need to have LABELs setup. Not covered in this thread. I have full persistence for home/ opt/ tce/
so I have no backups in my .profile

bootlocal.sh contents
Quote:

#!/bin/sh
# put other system startup commands here

RUNME=""
for i in `showbootcodes`
do
case $i in
snd*) RUNME=${i#*=} ;;
esac
done
[ -n "$RUNME" ] && $RUNME
Above is the "secret" to use different bootlocals for each graphics type.


nv.sh contents
Quote:

#!/bin/sh
# put other system startup commands here
/bin/cp /opt/xorg.conf.glx /etc/X11/xorg.conf
/bin/cp -f /opt/shadow /etc/
/usr/local/sbin/alsactl -f /opt/asound.state restore
/usr/local/etc/init.d/dbus start
/usr/local/sbin/basic-firewall noprompt
/bin/mkdir -p /usr/local/etc/cups/ppd
/bin/cp -f /opt/ppd-epson/* /usr/local/etc/cups/ppd/
/bin/cp -f /opt/printers.conf /usr/local/etc/cups/
/usr/local/sbin/iptables -A INPUT -p udp -m udp --dport 5353 -j ACCEPT
As you can guess, as I have no backups in mydata.gz I rely on script to copy from a persistent folder to the file system
If you leave one of the xorg.confs in a traditional backup you may
bork your next boot of something different.

vesa.sh contents
Quote:

#!/bin/sh
# put other system startup commands here
/bin/cp -f /opt/xorg.conf.vesa /etc/X11/xorg.conf
Now the TCZ lists
nv.lst contents
Quote:

Xprogs.tcz
mc.tcz
LXDE2.tcz
vlc.tcz
xarchiver.tcz
mtpaint-3.21.tcz
iptables.tcz
alsa.tcz
mylocale.tcz
lxterminal.tcz
leafpad.tcz
Xorg-7.6.tcz
nv.tcz
fsarchiver.tcz
xfburn.tcz
nano.tcz
Not all of these--you are going to want....they are my preferences

vesa.lst contents
Quote:

Xvesa.tcz
Xlibs.tcz
Xprogs.tcz
flwm_topside.tcz
wbar.tcz
I won't show the contents of the vesa xorg.conf as thats standard
to the distro

nvidia xorg contents
Quote:

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 310.32 (buildmeister@swio-display-x86-rhel47-09) Mon Jan 14 15:46:49 PST 2013

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/local/lib/X11/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/75dpi/"
EndSection

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

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier "Monitor0"
Option "DPMS"
EndSection

Section "Device"
Identifier "Card0"
Driver "nvidia"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection
works for me for version 4.7.7

5.x is not yet ready for this to work for different reasons, not shown here.

good luck


All times are GMT -5. The time now is 03:32 PM.