SUSE Studio General Howtos

Jump to: navigation, search

Suse studio logo.png    Portal 开始    FAQ 常问问题 FAQ    Tour 速览    Howto 入门帮助教程     API API 接口    反馈,Bug 和已知问题 Bug    支持信息页面 SUSE Studio 交流频道    下载应用以及其他东西 下载    Display index of "Category: SUSE Studio" 目录索引    How to edit this documentation 如何编辑此文档


综合 Howto 文档注意事项

如何解压下载完毕的应用

  • SUSE Studio currently only provides appliances for download in the (compressed) gzipped tarball format (.tar.gz).
  • Linux users can unpack this archive with the "tar xf <FILENAME>" command, or in graphic mode applications like "Ark", or "File Roller" to perform the extraction.
  • Windows users can use 3rd party utilities like WinZip, WinRAR, and 7-Zip (freeware).

如何首次登录

  • 使用默认的用户名和密码登录
    • 用户名: root 或者 tux
    • 密码: linux
  • 您可以通过修改配置文件 'susestudio.com/appliance/edit/NNNN#tab-configuration' 来修改默认的用户名和密码

如何在首次登录时安装合适的驱动

  • Write a script that uses lspci and grep commands in order to see which hardware you have, and then use zypper in order to add a repo and install the needed rpms. Once you have this script, upload it to the overlay section and add this script to the firstboot section. (see How to run firstboot scripts ).

如何运行本地脚本

  • If you want your script to run on every boot, you have two options. One is using the "Scripts" option on the "Configuration" Tab; two is writing your own service.
  • By using the "Scripts" option, your script will be run before any service. If that is want you want, check the "Run script whenever the appliance boots" option and write your script.
  • If what you want is to run your script after the other services, create your own service. In order to do that, copy /etc/init.d/skeleton file and adapt it to your needs. Set the required_start to $ALL so it runs after all the other services. Then, upload this file to the overlay section and add an "insserv script_name" line on the "firstboot section" (See How to run firstboot scripts ).

如何运行首次启动脚步

  • Like "How to run local scripts ", firstboot scripts can be run before any services or after. For the first option, use the "Scripts" option on the "Configuration" tab. You'll see there is an if section that looks for a /etc/init.d/suse_studio_firstboot file. Put your commands there.
  • For the second option, do like in "How to run local scripts" and make your own service. Add a "insserv script_name -r" line at the end of this service so it removes itself after firstboot.

首次运行如何配置图形显示

  • If you want to configure graphics on your firstboot, write a firstboot script (see " How to run firstboot scripts ") that launches sax2. That will configure your graphics hardware.

如何将用户添加至 sudoer 表

  • Add the sudo rpm and upload a custom /etc/sudoers like this one on the overlay section:
Defaults always_set_home
Defaults env_reset

Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION 
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE 
LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE"
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE  
LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE XMODIFIERS GTK_IM_MODULE 
QT_IM_MODULE QT_IM_SWITCHER"
Defaults targetpw   # ask for the password of the target user i.e. root
ALL ALL=(ALL) ALL   # WARNING! Only use this together with 'Defaults targetpw'!
root    ALL=(ALL) ALL
tux    ALL=(ALL) NOPASSWD:ALL

如何定制 Yast2-firstboot

  • If you want to have your own yast2-firstboot, upload a file with any content as /var/lib/YaST2/reconfig_system and edit the /etc/yast2-firstboot.xml file as your convenience. Make sure the yast2-firstboot package is installed.
  • If you just want to run one module, you can do that by adding the line "yast2 modulename" at the firstboot ( see How to run firstboot scripts ).

如何安装 Crontab

  • Upload your custom crontab files onto /etc/cron.daily, /etc/cron.hourly, /etc/cron.weekly, /etc/cron/monthly. Check that you have the crontab rpm installed.

如何安装定制防火墙

  • You have two options. Either use the SuSEfirewall2 or the iptools.
    • For the first option, edit the /etc/sysconfig/SuSEfirewall2 and the /etc/sysconfig/SuSEfirewall2.d files.
    • If you prefer the second one, remove the SUSEfirewall2 package, install the iptools one and add a custom iptools script on boot (see How to run local scripts).

如何添加_AutoYast_以使某些配置在启动的时候自动运行

  • Copy an autoyast profile at /var/lib/autoinstall/autoconf/autoconf.xml
  • Create a /etc/install.inf file with "AutoYaST:" in it.
  • Create an empty file at /var/lib/YaST2/runme_at_boot

如何添加服务

  • Run "insserv servicename" on firstboot (see How to run firstboot scripts).

Minimal X (Icewm) howto 文档

  • This howtos are specific to the minimal X template. They are basically focus on making kiosk like applications. There are different ways to achieve that and different ways to control the window sizes. As the Minimal X has the Icewm window manager, most of them are related to this window manager.

无窗口管理器的情况下运行诸如 KIOSK 之类的应用程序

  • On some cases you may want to not have any window manager. This cases include when your application can get fullscreen and it is a single window application. You do that by editing the /etc/inittab file and the .bashrc file on the user home dir.

/etc/inittab

# The default runlevel is defined here
id:3:initdefault:

# First script to be executed, if not booting in emergency (-b) mode
si::bootwait:/etc/init.d/boot

# /etc/init.d/rc takes care of runlevel handling
#
# runlevel 0  is  System halt   (Do not use this for initdefault!)
# runlevel 1  is  Single user mode
# runlevel 2  is  Local multiuser without remote network (e.g. NFS)
# runlevel 3  is  Full multiuser with network
# runlevel 4  is  Not used
# runlevel 5  is  Full multiuser with network and xdm
# runlevel 6  is  System reboot (Do not use this for initdefault!)
#
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
#l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6 

# what to do in single-user mode
ls:S:wait:/etc/init.d/rc S
~~:S:respawn:/sbin/sulogin

# what to do when CTRL-ALT-DEL is pressed
ca::ctrlaltdel:/sbin/shutdown -r -t 4 now

# special keyboard request (Alt-UpArrow)
# look into the kbd-0.90 docs for this
kb::kbrequest:/bin/echo "Keyboard Request -- edit /etc/inittab to let this work." 

# what to do when power fails/returns
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
#pn::powerfail:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop

# for ARGO UPS
sh:12345:powerfail:/sbin/shutdown -h now THE POWER IS FAILING

# getty-programs for the normal runlevels
# «id»:«runlevels»:«action»:«process»
# The "id" field  MUST be the same as the last
# characters of the device (after "tty").
1:2345:respawn:/sbin/mingetty --autologin tux --delay 1 tty1
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
#
#S0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt102
#cons:1235:respawn:/sbin/smart_agetty -L 38400 console

#
#  Note: Do not use tty7 in runlevel 3, this virtual line
#  is occupied by the programm xdm.
#

#  This is for the package xdmsc, after installing and
#  and configuration you should remove the comment character
#  from the following line:
#7:3:respawn:+/etc/init.d/rx tty7


# modem getty.
# mo:235:respawn:/usr/sbin/mgetty -s 38400 modem

# fax getty (hylafax)
# mo:35:respawn:/usr/lib/fax/faxgetty /dev/modem

# vbox (voice box) getty
# I6:35:respawn:/usr/sbin/vboxgetty -d /dev/ttyI6
# I7:35:respawn:/usr/sbin/vboxgetty -d /dev/ttyI7

# end of /etc/inittab

/home/tux/.bashrc:

while true
do
WINDOWMANAGER=/home/tux/bin/start.sh startx
done	

有窗口管理器的情况下运行诸如 KIOSK 之类的应用程序

  • On some cases you may want a window manager. Then, all you have to do is to select the runlevel 5 on the Configuration section and add an autostart program on user tux. That will overwrite the .xinitrc file on user tux.
  • If you want that autostart program to happen on all users, copy the generated /home/tux/.xinitrc to the /etc/skeleton/.xinitrc file.

如何以全屏模式加载应用程序

  • Some applications may not be started in fullscreen. One way to control such a thing is to use the icewm-ctrl utility on the .xinitrc (see How to implement a KIOSK like application with window manager ). In order to do so, the icewm-ctrl utility needs the window id.
  • Here is an example on how to achieve that with the gbrainy application :
gbrainy &
while [ `wmctrl -l | grep gbrainy | wc -l` != '1'  ]; do echo "waiting for  gbrainy" » /tmp/start.sh.log ;done
wmctrl -r gbrainy -b toggle,fullscreen
echo "done" »» /tmp/start.sh.log	

如何定制 icewm 任务栏和窗口

  • Icewm can be very customized. One of the customizations include the taskbar. Also you can customize each window size and design. You can customize this for the tux user by adding the needed files into the .icewm dir. If you want this to happen for all users, copy this dir to the /etc/skeleton/ dir.
  • The easiest way to create these files is to use the icewm control panel application. To do that, add the icewmcp rpm into your appliance. Then build it and run it. Open an xterm and run icewmcp and customize your icewm. After that, copy the .icewm into the overlay section.

<< 回到 开始 | 综合 | KDE | Gnome | VMware | VirtualBox | 磁盘镜像(USB 驱动) | LiveCD/DVD (.iso)