2010年11月21日 星期日

QUI

What are the things that are important ?

2010年4月30日 星期五

Quirky Resources

Pet
http://murga-linux.com/puppy/viewtopic.php?t=50364
Repository
http://distro.ibiblio.org/pub/linux/distributions/quirky/

Blog
quirky Blog

Puppy to Bee

Here is the information on how to turn puppy into a bee.
Beginning Step
a. Get the latest ISO files
b. Since I am using syslinux to be the bootloader, the sfs, vmlinuz and initrd will be extracted from the ISO files to put on the USB Flash disk.
c.http://thinkbeenet.blogspot.com/2010/04/puppy-boot-process.html

Puppy LInux Useful Download site

The original quirky site is painfully slow, so download from here
http://ftp.nluug.nl/pub/sunsite/distributions/quirky/

2010年4月25日 星期日

Still a lot to do

1. improper shutdown
http://indonesia.soup.io/post/47612557/Autorecover-After-Improper-Shutdown-in-Puppy-Linux
2. mysql improper shutdown handling
3. samba setup
4. memory stress test
5. input method , hand written integration
6. Compile kernel to allow ttyS4
7. mysql backup

more boot articles

http://www.puppylinux.com/technical/module-loading.htm
http://www.puppylinux.com/tech.htm

puppy boot process

I'm not quite sure what you're asking. Here is a brief summary of which files Puppy runs when it boots. I apologize if it's a little unclear. I haven't had a full night's sleep in several days and it's finally starting to catch up with me.



In a full-install of Puppy, the overall process goes something like this:

The BIOS launches the boot manager.
The boot manager launches the kernel.
The kernel launches /sbin/init.
/sbin/init launches /etc/rc.d/rc.sysinit.
/etc/rc.d/rc.sysinit runs several other rc.* scripts. It also runs every executable file in /etc/init.d and passes them the "start" parameter. When it finishes, it runs /etc/rc.d/rc.local.

After this, the system is booted. At this point in most distros you would be presented with a login prompt.

In Puppy, you are instead automatically logged in.

As you are logged in the /etc/profile script runs. It will include any files that match /etc/profile.d/*.sh. It also includes /etc/profile.local. Then, if X is not already running it will start X with xwin. (Unless you boot with the pfix=nox option, in which case it won't start X for you.)

When X starts, ~/.xinitrc runs, which in turn launches any executable file in ~/Startup/. When .xinitrc finishes, it launches the windowmanager.

If you shut down (or reboot) the computer from the menu, the wmpoweroff (or wmreboot) script will write a string into a file, and then kill X. This passes control back to the xwin script, which never actually finished running after X was launched (it was sitting there suspended, waiting for X to complete). It reads the file written by wmpoweroff to determine whether to poweroff the machine, reboot the machine, restart X, or just dump you out to the commandline. If poweroff or reboot, it runs the respective command.

When poweroff or reboot is run, the /etc/shutdown script is run. This script will also run any executable files in /etc/init.d/, but it will give them the "stop" option rather than "start".



In the other methods of running Puppy, the bootloader still starts the kernel, but it also tells the kernel to look in the initrd.gz file first rather than the harddrives. So the kernel will run the /sbin/init script that is inside initrd.gz rather than the binary init program that is on the harddrive. The init script mounts all the partitions and filesystem-images that Puppy needs, and puts them into the UnionFS tree. Then it does a "switch_root" into the new filesystem, which had been mounted at /pup_new in the initrd.gz's filesystem. This causes / to now refer to the things inside /pup_new/ rather than the original /.

After that, it launches the /sbin/init program in this new filesystem tree and everything continues along the same lines as a full install's boot.

PUPPY Start process

http://www-128.ibm.com/developerworks/linux/library/l-linuxboot/?ca=dgr-lnxw06LinuxBoot

1. /sbin/init. as configured through /etc/inittab

2 /etc/fstab 的用途

/etc/fstab 是設定分割區與 mount 目錄關係的檔案,開機時會依這個檔案的內容 mount 檔案系統,mount 檔案系統的命令為:

linux# mount -av

會依 /etc/fstab 的內容 mount 進除了 root 以外的所有檔案系統。


init 是在核心 mount 進 root 後,第一個執行的程式 (第一個 process),init 所負責的工作包括:

  • 執 行 /etc/rc.d/rc?.d/ 裡的 scripts
  • 將系統由開機狀態 (boot-up state) 切換至多使用者狀態 (multiuser state)
  • 負責載入 tty (本地端) 的 login shell
  • 負 責開機與關機的程序 (procedure)。
3 /etc/rc.d/rc.sysinit


(1) Puppy doesn't use run levels

(2) X starts with the command 'exec xwin' near the bottom of /etc/profile, it can be removed or commented out.




Useful tools for locating things:
    grep
    which
    readlink


Code:
# grep -nR startx /etc
/etc/ati/authatieventsd.sh:32: # vary depending upon whether X was started via xdm/kdm, gdm or startx, so
/etc/ati/authatieventsd.sh:54: # Finally, check for startx
# which startx
/usr/X11R7/bin/startx
# readlink /usr/X11R7/bin/startx
xwin
# grep -nR xwin /etc
/etc/cups/mime.convs:67:#image/x-xwindowdump application/vnd.cups-postscript66 imagetops
/etc/cups/mime.convs:99:#image/x-xwindowdump application/vnd.cups-raster 100 imagetoraster
/etc/cups/mime.types:111:#image/x-xwindowdump xwd string(4,<00000007>)
/etc/rc.d/rc.country:126: #xwin also set these...
/etc/rc.d/rc.country:130: #...this needs work. messes up font set required by dialog program. see also /usr/X11R7/bin/xwin.
/etc/rc.d/rc.sysinit:388:#note, if wanted to detect serial mouse here, k2.6.25.16 has module 'sermouse' that must be loaded (currently in xwin).
/etc/rc.d/rc.update:98: cp -af $NEWFILESMNTPT/usr/X11R7/bin/xwin /usr/X11R7/bin/
/etc/profile:196: exec xwin
/etc/mime.types:409:image/x-xwindowdump xwd
#

Grep searched through all the files in /etc to find the ones that contained the string 'startx' and returned the filenames, line numbers, and the lines themselves. Looking at them, they didn't seem to run it. So, I used the "which" command to see where the startx command was located. Then the "readlink" command told me that startx was actually a symlink to the xwin script (if it had been a real file, "readlink" wouldn't have returned anything). So then I did another grep to find the files that mention "xwin". Looking through the lines returned, only /etc/profile looks like it runs xwin, on line 196.

I already knew which file it was. But this is roughly the process I would use to find out if I didn't know. I often want to know which script is modifying a configuration file or doing some task. I usually look in /etc first, and if I don't see it there, I try /usr/sbin. When looking in the /usr tree, it can be a good idea to give grep the "-I" flag (that's an uppercase i, not an L) so that it doesn't look at binary files.

Mastering Unix Shell Scripting Notes

1. While studying
with this book we will cover most shell scripting techniques about seven times, each
time from a different angle, solving a different problem. I have found this learning
technique to work extremely well for retention of the material to memory.

2.Unix Special Characters
\ ( ; # $ ? & * ( ) [ ] ` ‘ “ +

2010年4月11日 星期日

Linux works

1. printing mechanism
2. java usb api testing
3. netsetup xwindows start up fix
4. sudden shutdown