Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Wybór pomiędzy XBMC i KDE
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW
View previous topic :: View next topic  
Author Message
Zitan
n00b
n00b


Joined: 16 Jun 2007
Posts: 71
Location: Człuchów

PostPosted: Mon Feb 04, 2013 9:50 am    Post subject: Wybór pomiędzy XBMC i KDE Reply with quote

Mam HTPC na bazie Gentoo, hardware zamontowany jest w obudowie z pilotem, który wykrywany jest przez system jako klawiatura dzięki czemu bez zbędnej konfiguracji można na upartego "chodzić" przy jego użyciu po biosie. Jak skonfigurować system tak abym mógł wspomnianym pilotem wybierać pomiędzy XBMC, a KDE bez konieczności wpisywania hasła?. Czy trzeba zrobić to z poziomu Grub2 lub xdm, a może jeszcze całkiem inaczej?. Poproszę o wskazówki.
_________________
Gentoo
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Mon Feb 04, 2013 1:22 pm    Post subject: Reply with quote

Mogl bys np. dwa wpisy w bootloaderze miec, jeden o nazwie KDE drogi XMBC, oba ustawialy by w parametrach kernela cos. Nastepnie jakis skrypt, moze zmodyfikowany skrypt startowy (nie wiem jak startujesz kde czy xmbc) ktory by sprawdzil, np:

Code:
if grep -q start_xmbc /proc/cmdline; then
   # startowanie xmbc
elif grep -q start_kde /proc/cmdline; then
   # startowanie kde
fi
Back to top
View user's profile Send private message
Zitan
n00b
n00b


Joined: 16 Jun 2007
Posts: 71
Location: Człuchów

PostPosted: Sun Feb 10, 2013 11:15 pm    Post subject: Reply with quote

Na początek to co zrobiłem do tej pory:

1. Usunąłem xdm

Code:

 /etc/init.d/xdm stop
 * Stopping kdm ...


Code:

 rc-update del xdm
 * service xdm removed from runlevel default



2. Zrobiłem dwie wersje kernela
Code:

mv /boot/kernel-3.6.11-gentoo /boot/kernel-3.6.11-gentoo-xbmc
cp /boot/kernel-3.6.11-gentoo-xbmc /boot/kernel-3.6.11-gentoo-kde


Code:

ls /boot/ | grep kernel
kernel-3.6.11-gentoo-kde
kernel-3.6.11-gentoo-xbmc


3. Zmodyfikowałem GRUB-a
Code:

cat /etc/default/grub
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.2 2012/06/28 22:36:53 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=1
GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5

GRUB_CMDLINE_LINUX_DEFAULT="splash=silent,fadein,theme:powered_by_gentoo video=uvesafb:1280x720-32,mtrr:3,ywrap rootfstype=ext4 quiet nomodeset acpi_osi=Linux saved"

#GRUB_CMDLINE_LINUX=""
#Added
#GRUB_FORCE_HIDDEN_MENU="true"
#export GRUB_FORCE_HIDDEN_MENU
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE=1280x720

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub2/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_OS_PROBER=true
GRUB_DISABLE_RECOVERY=true

GRUB_COLOR_NORMAL="light-blue/black"
GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
GRUB_INIT_TUNE="480 440 1"


Code:

grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/kernel-3.6.11-gentoo-xbmc
Found linux image: /boot/kernel-3.6.11-gentoo-kde
done


4. Bazując na tym linku https://wiki.archlinux.org/index.php/Xinitrc i tym co napisałeś wykonałem taki skrypt ~/.xinitrc:
Code:


#!/bin/bash

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

if grep -q xmbc /proc/cmdline; then
   exec xbmc-standalone
   elif grep -q kde /proc/cmdline; then
   exec startkde
fi

oraz
Code:

   chmod +x .xinitrc


Powstały dwa problemy, chciałbym żeby GRUB wybierał domyślnie KDE, problem polega na tym że w menu GRUB-a są następujące pozycje Gentoo GNU/Linux oraz Advanced options for Gentoo GNU/Linux. W Opcji Advanced... kryją się moje dwa nowe wpisy na temat kernel-ów. Jak wyciągnąć je na wierzch menu GRUB-a, skoro skasowanie hash-a w linii "GRUB_DISABLE_RECOVERY=true" pliku grub.cfg nie zmienia sposobu działania menu, dla ścisłości zawsze na końcu wykonuje polecenie grub2-mkconfig -o /boot/grub2/grub.cfg. Drugi problem jest dla mnie dziwny i całkowicie niezrozumiały. Jeśli uruchomię system na kernel-3.6.11-gentoo-kde i po zalogowaniu na konto xbmc wydam polecenie startx uruchomi się KDE. Jeśli natomiast uruchomię kernel-3.6.11-gentoo-xbmc, nie jestem w stanie uruchomić xbmc. W trakcie rozwiązywania problemu zamieniłem miejscami linie w skrypcie startowym .xinitrc. Czyli kernel-3.6.11-gentoo-xbmc miał uruchomić KDE i na odwrót. Okazało się że kernel dla KDE bez problemu uruchamia XBMC, a kernel XBMC nie jest wstanie uruchomić KDE jak to miało miejsce przed chwilką z XBMC. Krótko mówiąc dlaczego jedno jądro działa poprawnie, a drugie nie i jak to zmienić?
_________________
Gentoo
Back to top
View user's profile Send private message
SlashBeast
Retired Dev
Retired Dev


Joined: 23 May 2006
Posts: 2922

PostPosted: Sun Feb 10, 2013 11:51 pm    Post subject: Reply with quote

w ogole nie widze potrzeby posiadania dwoch kerneli, miotasz sie z tym grubem2 jak zyd po pustym sklepie. Po prostu dodaj skryptem badz recznie ten sam kernel dwa razy z dodatkowymi opcjami i tyle powinno wytsarczyc. Osobiscie uzywam extlinuksa jako bootloader, zdecydowanie nie lubie gruba2.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Polskie forum (Polish) Polish OTW All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum