How to turn on automatic shutdown/reset in Windows XP

Ref : http://www.wretch.cc/blog/chenmoukimo/16823383


echo off
taskkill /T /FI "PID gt 0" /IM *
ipconfig /release *con*
tsshutdn 0 /delay:0 

How to set up desktop remote on WinXP for MAC using

Ref: http://www.online-tech-tips.com/windows-xp/how-to-setup-remote-desktop-on-windows-xp/


Today is computer tip day! If you have never used Remote Desktop, it is a really great way to connect to another PC (office, home, etc) remotely and get work done that you otherwise could not get done. I routinely use remote desktop to connect to servers at our office, connect to user’s computers to provide tech support, and to connect to my personal computer at home to access files.
In order to use Remote Desktop, there are a couple of things you need to understand. First off, remote desktop only works with Windows XP and Windows 2003. What I mean by this is that you can only connect INTO a Window XP or 2003 machine. You can use a Windows 98, ME, or 2000 to connect INTO a Windows XP or 2003 machine, but you cannot connect INTO a 98, ME or 2000 machine remotely. If you want to be able to connect to a Windows 2000 or earlier machine, you’ll have to buy commerical software.
Secondly, you need to make sure that you are logged in as a computer administrator on the machine in order to set it up for remote access. If you brought a computer from a store or got it straight from the manufacturer, the first user name you create is always an Administrator account.
An easy way to check whether or not you are an Administraor is to go to Start, Control Panel and then click on User Accounts. You’ll see your user name and it should have “Administrators” or “Computer Administrator” written next to it.
Thirdly, the administrator account on your machine must have a password. If you do not have to type in a password in order to access Windows when you start up your computer, then you do not have a password set up and Remote Desktop will not work. Remote desktop does not allow you to connect to a computer with a user name that does not have a password.
When you go to User Accounts, you will see an option to create a password for the account. Go ahead and do that.
Next, if the computer you are connecting to is running Windows XP SP2 (which it most likely will be), then you need to open the firewall to allow remote desktop connections. To do this, go to StartControl Panel, Windows Firewall and click on theExceptions tab.
Make sure that the Remote Desktop checkbox is checked. Don’t worry about how my screen looks, it’s part of a corporate network. You should have a lot less entries and one of them should be Remote Desktop. Check it and then click OK.
The last thing that needs to be done in order for Remote Desktop to work correctly is to tell Windows that we want to allow users to connect. So far we’ve just fulfilled the requirements, but now we have to actually allow remote desktop connections to this computer.
Go to StartControl Panel, and click on System. Click on the Remote tab and make sure that the “Allows users to connect remotely to this computer” is checked.
And that’s it! Your computer is now setup to connect to! First try connecting to the computer while on the same network…as in if you are at home, try connecting to the computer from another computer on your home network. In order to connect, go to the other computer and click on Start, All programs, Accessories, Communications, andRemote Desktop Connection.
In the dialog box, you can type in the IP address or the name of the computer. The best way to connect is to type in the IP address of the computer. In order to get the IP address of the computer you want to connect to, go to the computer and click on Start, Run and type in CMD.
In the black command window, type in the word “ipconfig” without the quotes as shown below and press Enter.
You’ll see your IP address listed along with some other info, but you don’t need to worry about that. Write down that IP address (192.x.x.x or something similar) and type that number exactly into the remote desktop text box on the other computer (the computer you are connecting from).
Click Connect and you should get a login screen pop up, which means you have successfully connected to the other computer. You can now enter the Computer Administrator user name and password.
If you get an error saying that computer cannot accept new connections, etc. that means something was not configured correctly. Remember you need to give the administrator account a password, open the port in the firewall, and check the allow remote connections checkbox in the System properties. All of these three things you need to do on the computer you want to connect TO.
Once you are able to connect from within the same network, now you can try to connect from the outside. So if you want to connect to your home computer from the office, you can do that, but you’ll have to do a few extra things.
First, you have to get your public IP Address (not the 192.168.x.x number) and you can do this by going to the computer you want to connect in to and navigating to the web site http://www.whatismyip.com/ and this will give you your public ip address. This is the address that can be used from anywhere in the world to connect to your specific location and is unique.
The second thing you have to do is open the port in your router (unless you’re connecting your cable modem directly into your computer) and forward that port to the computer you want to connect to. Here’s how you would do this on a Netgear router (as I have that) and is pretty much the same for other routers. Most manufacturer’s web sites have an article on how to configure their particular router for remote desktop since it’s very common.
You’ll need to log into your router by typing it’s IP address into the IE address bar. You can figure out the IP address of your router by going to any computer on your network (that you want to connect into) and opening the command prompt like we did above and typing ipconfig again. In addition to the IP Address field, you’ll also see Default Gateway, this is your router.
Type that address into your IE address bar as follows and press Enter:
You’ll most likely be prompted for a user name and password. Usually, you can find this in the documetation or on the under side of the router itself. For my Netgear router, the username as “admin” (lowercase) and the password was “password”.
Once you’re in, you should see an option called “Port Fowarding/Port Triggering” or something very similiar. I knew Netopia calls these “Pinholes” and on Linksys it might be called a “Service”.
Once you’re on the Port page, choose Port Triggering (if you see Remote Desktop in the list of services, you can choose that instead, but it may not be there). Now we’ll add the service for Remote Desktop. Click Add Service.
The next part may look hard, but it’s not really too bad once you understand what everything does. The service name can be anything, so type in “RemoteDesktop“. For the Service User, you can choose Any or Single Address. We want to choose single address because we want to connect into just one computer. Type in the IP address of your computer into the space provided. Again, that is what we already got earlier from the ipconfig command.
For the service type, choose TCP protocol. Now for “Triggering Port, Starting Port, and Ending Port” put in 3389. Port 3389 is the port Windows uses to connect using remote desktop.
Click Apply and you’re done! You should now be able to use your public IP address (type this into the “Computer” textbox in the Remote Desktop software) to connect through your router to your computer!
Please let me know if something is wrong or if it did not work for you! Thanks!

tw.archive.ubuntu.com 掛站處理方法


最近tw.archive.ubuntu.com有時會連不上,因此apt-get常常無法抓完套件!

解決之法就是改用其他替代網站!
cd /etc/apt
sudo cp sources.list sources.lis.bak
sudo kate sources.lis
將tw.archive.ubuntu.com全部取代為mirror.nttu.edu.tw
存檔後繼續如下指令
sudo apt-get update

就這樣囉!

How to format fat32 on FreeBSD

# dd if=/dev/zero of=/dev/da0 bs=2m(this zeros the whole drive. if you're worried about wearing it out, just append count=1)
# fdisk -i /dev/da0change the partition type to 12, & accept the rest of the defaults that it hands you. you will get the "fdisk: Class not found." error. you can safely ignore it
# newfs_msdos -F32 /dev/da0s1

[轉載]【FreeBSD】Dmidecode-查詢硬體資訊


【FreeBSD】Dmidecode-查詢硬體資訊


前言

[dmidecode] 為一套可輕鬆顯示您目前主機的各項硬體資訊套件,它查詢在您主機 BIOS 當中 SMBIOS/DMI 資訊查達到查詢各項硬體資訊的目的,例如您可查詢 CPU 類型、Cache、Memory Module、Slots、I/O Ports...等。 (請尊重 weithenn 的辛勞!!)
Dmidecode 支援作業系統類型如下:
  • FreeBSD i386, x86-64 (請尊重 weithenn 的辛勞!!)
  • NetBSD i386, x86-64
  • OpenBSD i386
  • BeOS i386
  • Cygwin i386 (請尊重 weithenn 的辛勞!!)
  • Linux i386, x86-64, ia64
  • Solaris x86


實作環境

  • FreeBSD 5.4-RELEASE
  • dmidecode-2.9 (請尊重 weithenn 的辛勞!!)

安裝及設定

步驟1.安裝 dmidecode 套件

切換至 Ports Tree 路徑安裝 dmidecode 套件 (請尊重 weithenn 的辛勞!!)
#cd /usr/ports/sysutils/dmidecode //切換到安裝路徑
#make install clean //安裝套件並清除安裝中不必要的檔案

步驟2.開始使用 dmidecode

安裝完成後即可開始使用,詳細參數可參考 [FreeBSD Man Pages - dmidecode]
  • -t (--type) Type_Number or Keyword: 參數加上硬體資訊號碼或關鍵字進行查詢 (ex. 4 = CPU、39 = Power Supply、bios、memory ...etc)
  • -s (--string) Keyword: 參數加上關鍵字進行查詢 (ex. bios-vendor、baseboard-serial-number ...etc)
  • 顯示最詳細及完整的 BIOS 硬體資訊 (請尊重 weithenn 的辛勞!!)
#dmidecode
  • 搭配 Type Number 查詢指定的硬體資訊 (請尊重 weithenn 的辛勞!!)
#dmidecode -t 4 //查詢 CPU 資訊
#dmidecode -t 39 //查詢 Power Supply 資訊
#dmidecode -t 4,39 //查詢 CPU 及 Power Supply 資訊
  • 搭配關鍵字查詢指定的硬體資訊 (請尊重 weithenn 的辛勞!!)
#dmidecode -t //顯示所有可用關鍵字
#dmidecode -t processor //查詢 CPU 資訊
#dmidecode -t memory //查詢 Memory 資訊
#dmidecode -t processor memory //查詢 CPU 及 Memory 資訊
  • 搭配關鍵字查詢指定的硬體資訊 (請尊重 weithenn 的辛勞!!)
#dmidecode -s //顯示所有可用關鍵字
#dmidecode -s bios-vendor //查詢 BIOS 製造商
#dmidecode -s baseboard-serial-number //查詢主機版序號 (Serial Number)

補充1:硬體資訊號碼及關鍵字

詳細參數可參考 [FreeBSD Man Pages - dmidecode]
硬體資訊號碼如下:
  • 0: BIOS
  • 1: System (請尊重 weithenn 的辛勞!!)
  • 2: Base Board
  • 3: Chassis
  • 4: Processor
  • 5: Memory Controller
  • 6: Memory Module
  • 7: Cache
  • 8: Port Connector (請尊重 weithenn 的辛勞!!)
  • 9: System Slots
  • 10: On Board Devices
  • 11: OEM Strings
  • 12: System Configuration Options
  • 13: BIOS Language
  • 14: Group Associations
  • 15: System Event Log
  • 16: Physical Memory Array
  • 17: Memory Device
  • 18: 32-bit Memory Error
  • 19: Memory Array Mapped Address
  • 20: Memory Device Mapped Address
  • 21: Built-in Pointing Device
  • 22: Portable Battery (請尊重 weithenn 的辛勞!!)
  • 23: System Reset
  • 24: Hardware Security
  • 25: System Power Controls
  • 26: Voltage Probe
  • 27: Cooling Device
  • 28: Temperature Probe
  • 29: Electrical Current Probe
  • 30: Out-of-band Remote Access
  • 31: Boot Integrity Services
  • 32: System Boot
  • 33: 64-bit Memory Error
  • 34: Management Device (請尊重 weithenn 的辛勞!!)
  • 35: Management Device Component
  • 36: Management Device Threshold Data
  • 37: Memory Channel
  • 38: IPMI Device
  • 39: Power Supply
硬體資訊關鍵字如下: (顯示關鍵字輸出硬體資訊等於對應的 Type Number)
  • bios: 0, 13
  • system: 1, 12, 15, 23, 32
  • baseboard: 2, 10 (請尊重 weithenn 的辛勞!!)
  • chassis: 3
  • processor: 4
  • memory: 5, 6, 16, 17
  • cache: 7 (請尊重 weithenn 的辛勞!!)
  • connector: 8
  • slot: 9

補充2:硬體 序號/版本/製造商 關鍵字

詳細參數可參考 [FreeBSD Man Pages - dmidecode]
  • BIOS
    • bios-vendor: 查詢 BIOS 製造商
    • bios-version: 查詢 BIOS 版本 (請尊重 weithenn 的辛勞!!)
    • bios-release-date: 查詢 BIOS Release 日期
  • System
    • system-manufacturer: 查詢系統製造商
    • system-product-name: 查詢系統產品名稱
    • system-version: 查詢系統版本
    • system-serial-number: 查詢系統序號 (Serial Number)
    • system-uuid: 查詢系統 UUID
  • MontherBoard (請尊重 weithenn 的辛勞!!)
    • baseboard-manufacturer: 查詢主機板製造商
    • baseboard-product-name: 查詢主機板產品名稱
    • baseboard-version: 查詢主機板版本 (請尊重 weithenn 的辛勞!!)
    • baseboard-serial-number: 查詢主機板序號 (Serial Number)
    • baseboard-asset-tag: 查詢主機板資產標籤
  • Chassis (請尊重 weithenn 的辛勞!!)
    • chassis-manufacturer: 查詢基座製造商
    • chassis-type: 查詢基座類型
    • chassis-version: 查詢基座版本 (請尊重 weithenn 的辛勞!!)
    • chassis-serial-number: 查詢基座序號 (Serial Number)
    • chassis-asset-tag: 查詢基座資產標籤
  • CPU (請尊重 weithenn 的辛勞!!)
    • processor-family: 查詢 CPU 種類/系列
    • processor-manufacturer: 查詢 CPU 製造商
    • processor-version: 查詢 CPU 版本/速度
    • processor-frequency: 查詢 CPU 處理時脈 (請尊重 weithenn 的辛勞!!)

參考

[dmidecode]
[FreeBSD Man Pages - dmidecode]
[dmidecode FreeBSD]
[Dmidecode - Linux Wiki]

Make a NanoBSD for GPT scheme on Freebsd9.0 RC1 + UEFI on VirtualBox

1. get freebsd 9.0 rc1, then install all srouce code

2. Install dmidecode ports on FreeBSD 9.0 RC1
    Path : /usr/local/sbin/dmidecode
  • # cd /usr/ports/sysutils/dmicode/
  • # make install clean
  • # ./usr/loacl/sbin/dmidecode | grep Name
    • Product Name : VirtualBox
3. Modify /usr/src/sys/amd64/amd64/machdep.c to add the string as follows
  • strncmp(sysenv, "VirtualBox", 10)  == 0 || 
4. Compile your kernel
  • # cd /sys/amd64/conf
  • # cp GENERIC NASBSD9
  • # ee NASBSD9
    • or put the file of NASBSD9 to /home/backup, and set soft link
      • #cd /usr/src/sys/amd64/conf
      • #ln -s /home/backup/NASBSD9
  • To compile your kernel
    • # cd /sys/amd64/conf
    • # config NASBSD9
    • # cd ../compile/NASBSD9
    • # make depend
    • # make
    • # make install
    • # reboot
    • # uname -a
5. Installing GRUB2
  1. Create an EFI system partition
    • On Ubuntu 11.10
      • $ apt-get install gdisk ufsutils
      • $ gdisk /dev/sdx 
      • EF00 
      • using 'gdisk' to partition an GPT format disk with an EFI system partition.
      • $ mkfs.vfat -F32 /dev/sdx1
    • On FreeBSD 8/9
      • # gpart create -s GPT /dev/adax








// ref to solve efi booting
// need to add product name from smibios, ex:VirtualBox
http://forums.freebsd.org/showthread.php?t=12198


//must to format FAT32 on flash disk in order to access EFI system for montherboard boot up.
mkfs.vfat -F32 /dev/sdc1

gpart create GPT /dev/ada0




build grub1.99 rc1


./configure LEX=/usr/local/bin/flex --with-platform=efi --target=x86_64
  • LEX=/usr/local/bin/flex
    • I installed the latest port (flex-2.5.35_4) from /usr/ports/textproc/flex
  • cd /usr/ports/lang/gcc44 
    • make install


----------------------------------------------------

// 宣告一塊虛擬memory disk -> md0
#mdconfig -a -t vnode -f _.disk.image

// 將_.disk.image 掛載在/mnt
#mount /dev/md0a /mnt

// 卸載 md0
#mdconfig -d -u 0

---------------------------------------------------

// Make a cpio+gz image
$find . | cpio -ocvB | gzip > /usr/src/tools/tools/nanobsd/nanobsd.cpio.gz

解壓縮
$gzip -dc folder1.cpio.gz | cpio -idv

------------------------------------------------------------------------

mkdir /tmp/ramdisk; chmod 777 /tmp/ramdisk
mount -t tmpfs -o size=256M tmpfs /tmp/ramdisk/

Read more: http://www.linuxscrew.com/2010/03/24/fastest-way-to-create-ramdisk-in-ubuntulinux/#ixzz1ciIwVOz3

mount ufs on ubuntu


為了這個問題困擾了一段時間,終於嘗試成功了,筆記一下怎麼在 Ubuntu 上掛載 FreeBSD 格式的硬碟。
先確定 FreeBSD 分割區的代號:

irvin@irvin-desktop:~$ dmesg | grep 'bsd'
[    5.736592]  sdc1: 

分別掛載每個分割區:

irvin@irvin-desktop:~$ sudo mount -r -t ufs -o ufstype=ufs2 /dev/sdc5 /mnt
irvin@irvin-desktop:~$ ls /mnt
bin    compat     entropy  lib         media          patch   root  tmp
boot   COPYRIGHT  etc      libexec     mnt            proc    sbin  usr
cdrom  dev        home     lost+found  openssl.patch  rescue  sys   var
irvin@irvin-desktop:~$ 

很簡單的就成功了!

How to use mdconfig cmd on FreeBSD

// 宣告一塊虛擬memory disk -> md0
#mdconfig -a -t vnode -f _.disk.image

// 將_.disk.image 掛載在/mnt
#mount /dev/md0a /mnt

// 卸載 md0
#mdconfig -d -u 0

How to format with HFS+ file system



HFS+ partitions are used by macs.
If you want to format a hard drive with the HFS+ files ystem, you have first to install gparted:
Search for gparted in the Synaptic or type the following in your terminal:
sudo apt-get install gparted
Then install the “hfsprogs” package. Search in Synaptic or:
sudo apt-get install hfsprogs
Now you can use gparted in System->Administration->GParted
If you are not sure what to do now, then google “ubuntu gparted” or ask someone for help.

Quadruple system Windows 7, OSX Snow Leopard, Ubuntu Lucid and FreeBSD 8 on GPT with BURG (supports UEFI/Apple EFI/PCBIOS)

ref: http://code.google.com/p/burg/wiki/QuadBoot

 QuadBoot  
Quadruple system Windows 7, OSX Snow Leopard, Ubuntu Lucid and FreeBSD 8 on GPT with BURG (supports UEFI/Apple EFI/PCBIOS)
Updated Mar 22, 2010 by bean12...@gmail.com

Introduction

This guide shows how to install the four OS on GPT and boots with BURG. In preparation, you needs to have:
  • GParted Live CD
  • Windows 7 64-bit Installation DVD
  • Snow Leopard Retail DVD
  • iDeneb or other OSX86 Installation DVD
  • Ubuntu Lucid beta 64-bit DVD or netboot CD
  • FreeBSD 8 amd64 Installation DVD or USB memstick
The following installation process requires to remove all partitions and create new disk layout, make sure to backup important data first !

UEFI

My test environment: HP ProBook 4510s
  • Enter BIOS and turn on UEFI boot mode.
  • Insert Windows 7 64-bit Install DVD. To ensure booting in UEFI mode, press F9 to open boot device selection page, choose "Boot From UEFI File", then browse to \EFI\BOOT\BOOTX64.EFI on DVD.
  • In the disk partition dialog, remove all partitions, then create a new partition using all available space. It should create two extra partition, EFI system partition and Microsoft reserved partition. If you don't see EFI system partition, then it's not using GPT. If this happens, you can try removing all partition, reboot using UEFI mode and try again.
  • Remove that one large partition, and create small partitions for each OS, I use the following partition layout:
    1. EFI system partition (created previously)
    2. Microsoft reserved (created previously)
    3. Windows 7 (at least 20G)
    4. OSX Snow Leopard (at least 10G)
    5. Linux swap
    6. Linux ext4
    7. FreeBSD swap
    8. FreeBSD ufs
    9. Extra OSX partition for leopard
    10. Other data partitions ...
  • After creating partition layout, you can reboot, no need to install windows right now (more on this later).
  • Enter BIOS and turn off UEFI boot mode.
  • Insert GParted Live CD, format the linux ext4 and swap partition. In theory this step could be done by ubuntu installer, but I have encountered some issue and it even mess up the MBR.
  • Reboot and insert the ubuntu lucid install disc. In partition page, don't change partition layout and use the ext4 formatted previously as root device.
  • GRUB2 fails to install properly, but it's still a good idea to choose the install GRUB step as it would download the package automatically.
  • Reboot ubuntu disc into rescue mode, open a shell on linux partition /dev/sda6, and use these commands to install grub2:
  • grub-install --force /dev/sda
    update-grub
  • Reboot and you should be able to enter ubuntu properly. Install burg according to this page InstallUbuntu, then use dd to backup mbr to an usb flash drive.
  • Insert iDeneb DVD, install leopard to the extra OSX partition.
  • Insert ubuntu disc and enter rescue mode, use dd to restore the mbr you have previously saved.
  • After reboot, you enter burg rescue shell, why ? It appears that OSX installer has removed EFI system partition, format microsoft reserved partition as EFI system partition, and create a /EFI/Apple directory in it, what a mess ! (If you install windows previously, it'd be screwed up by this and not repairable, therefore you have to install again.) You can enter this in rescue shell:
  • set prefix=(hd0,5)/boot/burg
    insmod normal
    normal
This would bring you to the normal burg menu, press 'c' to enter a console windows, and enter these commands:
gptsync hd0
reboot
  • Enter BIOS and turn on UEFI boot mode.
  • Insert Windows 7 64-bit Install DVD and boot with UEFI mode. In the partition editor, remove EFI system partition and windows 7 partition, create a new partition in the empty space and the EFI+MS reserved combo reappears. Continue with the installation.
  • After windows is done, boot GParted Live CD, use dd to restore mbr saved previously.
  • Reboot and you should see burg menu, enter ubuntu.
  • It's recommended remove /etc/burg.d/30_os-prober as the boot item generated by os-prober is not much useful, we need to construct menu items manually by create a new script /etc/burg.d/40_custom:
  • #!/bin/sh
    exec tail -n +3 $0# This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    menuentry "Boot Snow Leopard" --class macosx {
      set root=(hd0,4)
      multiboot /boot}
    menuentry "Boot Leopard" --class macosx {
      set root=(hd0,9)
      multiboot /boot}
    menuentry "Boot FreeBSD" --class freebsd {
      set root=(hd0,8)
      kfreebsd /boot/loader}
    menuentry "Reboot to EFI mode" {
      gptsync hd0
      reboot}
then use update-burg to update the configuration file. Mount the EFI partition and create burg directory:
sudo mount /dev/sda1 /mnt
sudo mkdir /mnt/EFI/burg
Download the latest burg-efi64 and burg-themes package from: http://code.google.com/p/burg/downloads/list, extract to /mnt/EFI/burg directory, and rename /mnt/EFI/burg/burg_uefi.cfg as /mnt/EFI/burg/burg.cfg.
  • Reboot, and you should see a new menu "Reboot to EFI mode", use this and it should reboot into EFI mode, which means start windows.
  • If windows doesn't boot properly, use install disk to repair it.
  • Reboot and enter F9 to open boot device selection page, choose "Boot From UEFI File", then browse to \EFI\burg\burg64.efi.
  • Now the EFI version of BURG should start, it would have three menu: "Boot Windows 7", "Boot Ubuntu" and "Reboot to PC mode". Use "Boot Ubuntu" to boot ubuntu in EFI mode.
  • In ubuntu, install efibootmgr:
  • sudo apt-get install efibootmgr
Then use this to add a new EFI boot item for burg:
sudo efibootmgr -v -c -L "BURG" -l "\\EFI\\burg\\burg64.efi"
burg would be the default boot loader for EFI now, you don't need to use "Boot From UEFI File" to choose it.
  • You can use "Reboot to PC mode" and "Reboot to EFI mode" to switch between EFI and PC version of BURG. This feature is implemented using a trick I found out about UEFI firmware. It's very strict with regarding to GPT structure. I set some incompatible field in MBR so that it would be treated as invalid GPT and boot into PC mode. After reconstruct a valid GPT, it would boot into UEFI mode again. This allows you to switch modes without entering BIOS. However, this behavior may not apply to other UEFI implementation. If it doesn't work for you, you have to use BIOS to switch mode.
  • Insert FreeBSD 8 Install DVD or USB memstick, first open a fixit shell, format and mount ufs partition:
  • newfs -O2 -U /dev/da4p8
    mount /dev/sda8 /mnt
Exit fixit shell. In Options, change install root from / to /mnt. Choose "Configure" and "Distribution" to install. Make sure you don't touch the "Fdisk" and "Disklabel" as they'd mess up the MBR. After it, reopen a fixit shell, cd to /mnt/boot, and rename GENERIC directory to kernel. You also need to create /mnt/etc/fstab as follows:
/dev/ad4p7  none  swap  ew  0  0
/dev/ad4p8  /     ufs   rw  1  1
  • Reboot into PC mode, and you should be able to use the "Boot FreeBSD" menu to enter FreeBSD.
  • Use "Boot Leopard" to enter OSX Leopard, insert the snow leopard retail disc and use OSInstall.mpkg to install snow leopard, add kext and related fixes to make it bootable. Finally, copy Chameleon loader boot to the root directory and it can be chainloaded by BURG.

Apple EFI

My test environment: Mac Mini 3.1 (early 2009 version)
  • Install OSX install disc and create the partition layout. OSX is very picky for GPT structure and refuses to install to GPT created by GParted. Please note that the EFI system partition is hidden from the disk utility, so you starts with microsoft reserved partition. After partition, install OSX normally.
  • After OSX boots, use dd to backup mbr. Then install rEFIt loader.
  • Create /EFI/burg directory in OSX. Download the latest burg-efi64 and burg-themes package fromhttp://code.google.com/p/burg/downloads/list, extract to /EFI/burg directory, and rename /mnt/EFI/burg/burg_apple.cfg as /mnt/EFI/burg/burg.cfg. Now you can start the EFI version of BURG in rEFIt menu.
  • Insert GParted Live CD, format ms reserved and windows 7 partition as ntfs, and format the linux partition as ext4.
  • Insert Ubuntu disc and install. As previously, GRUB2 fails to install, and this time it even mess up MBR. Restore the backup mbr, then reboot ubuntu disc and enter rescue mode, use the following commands to install grub2 manually:
  • grub-install --force /dev/sda
    update-grub
  • Reboot and use rEFIt to enter PC mode, you should be able to boot into ubuntu. Install burg according to this page InstallUbuntu.
  • As before, remove /etc/burg.d/30_os-prober and create our own script /etc/burg.d/40_custom:
  • #!/bin/sh
    exec tail -n +3 $0# This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    menuentry "Boot Windows" --class windows {
      set root=(hd0,2)
      chainloader +1
    }
    menuentry "Boot FreeBSD" --class freebsd {
      set root=(hd0,8)
      kfreebsd /boot/loader}
then use update-burg to update the configuration file.
  • Reboot into BURG (PC or EFI), use gptsync to create hybrid MBR:
  • gptsync hd0 2+ 3 4
    reboot
The advantage of BURG's gptsync is that you can choose which partition to mapped into MBR slots. For example, if you have a data partition at (hd0,10), you can use this to make it visible to Windows:
gptsync hd0 2+ 3 10
  • Insert Windows install disc and install. Windows 7 EFI don't support apple's implementation, you can only install using PC mode. Don't change any partition structure, just install to the partition allocated to it.
  • Windows would overwrite MBR, use rescue mode from ubuntu disc to reinstall burg:
  • burg-install --force /dev/sda
    update-burg
  • Now it's time to install FreeBSD, although it's a little tricky as the generic kernel hangs on apple hardware. You need to follow instruction here http://wiki.freebsd.org/AppleMacbook , revert r189055 and rebuild a new kernel from another FreeBSD machine. After that, copy new kernel, mfsroot.gz and devices.hints from boot directory of FreeBSD 8 install disc to /fbsd_install/ directory in ubuntu partition.
  • Reboot into PC version of BURG, enter the following commands from console to launch the FreeBSD installer:
  • set root=(hd0,6)
    kfreebsd /fbsd_install/kernel
    kfreebsd_module /fbsd_install/mfsroot.gz type=mfs_root
    kfreebsd_loadenv /fbsd_install/devices.hintset FreeBSD.vfs.root.mountfrom=ufs:/dev/md0
    boot
After that, install FreeBSD using similar method described in UEFI section.

PCBIOS

Install in PCBIOS machine is a combination of the above methods, here are highlights:
  • Install iDeneb OSX first, use it to create the partition layout.
  • Install Ubuntu next, install burg
  • Use gptsync to create hybrid MBR, then install Windows 7.
  • Fix burg boot loader.
  • Install FreeBSD.

虹光大成就-密教灌頂(一)