xda-developers.com
forum.xda-developers.com
device database
wiki.xda-developers.com Wiki HomePage
FAQ | Xanadux

RecentChanges | FindPage | | LikePages | BackLinks

Universal_Installing_Linux

Installing Linux on the HTC-Universal

NOTE: This HOWTO is obsolete. We have made it easier to install linux on universal now. You dont need a linux filesystem anymore, just get the cab file and install it. Our new host site is http://linuxtogo.org/~htcpxa

  • Method 1 (Long Version)
  • Method 1 (Quick Version)
  • Install Mini HOW-TO
  • How to install a new Opie-Universal on an already formatted SD-Card

Method 1 (Long Version)

With credits to http://www.handhelds.org/moin/moin.cgi/Universal

  • Download files from Ramdisk folder to C:\Linux\Ramdisk

    default.txt
    gnuharet.exe
    rd
    zImage

  • Download a snapshot to C:\Linux\SD-MMC

    startup.txt
    haret{DATE}.exe
    zImage
    Opie, GPE or bootstrap image

  • Make sure that files have the correct .extension after download

    startup.txt
    haret{DATE].exe
    Opie, GPE or bootstrap image
    rd (NO EXTENSION)
    zImage (NO EXTENSION)

  • Copy files from the C:\Linux\Ramdisk folder to \My Documents\Linux on your device
  • Plug the power cable into the device, Put the SD card into the device (All data will be erased)
  • Make sure the Phone is on and connected
  • Go to \My Documents\Linux and hit gnuharet.exe Click Run
    The screen will get some funny colors and seem freezed, don't freak out :-) its normal
  • Login

    Login with : root
    Password : rootme

    Please Note

    You write / by holding down FN while pressing the O button
    You write + by holding down SHIFT while pressing the = button

  • Write and then hit enter

    fdisk /dev/mmc/blk0/disc

  • Clear your old partition table

    Type : o

  • Create two partitions [one vfat (31MB) and one ext2 (rest) ] like this:

    Type : n

  • Set the primary partition (1-4)

    Type : p

  • set the Partition number (1-4)

    Type : 1

  • Set the First cylinder (1-xxxx, default 1):
    Hit enter (This will set the default value to : 1 )
  • Set the Last cylinder or +size or +sizeM or +sizeK (1-xxxx, default xxxx):

    Type : +31M ( If the size dossent match, look here )

  • Create the next partition

    Type : n

  • Set the (Second)primary partition

    Type : p

  • Set the Partition number (1-4)

    Type : 2

  • Set the First cylinder (xx-xxxx, default xx):
    Hit enter to select the default value
  • Set the Last cylinder or +size or +sizeM or +sizeK (xx-xxxx, default xxxx):
    Hit enter to select the default value

    Define the Fat partion for WinCe to use

  • Command (m for help)

    Type : t

  • Partition number (1-4)

    Type : 1

  • Hex code (type L to list codes)

    Type : 6 (For Fat 16)

  • Command (m for help)

    Type : w

    Hit enter and you will be returned to the shell

  • Make filesystem for wince

    Type : mkdosfs /dev/mmc/blk0/part1

  • Make filesystem for Linux

    Type : mke2fs /dev/mmc/blk0/part2

  • Wait until the command prompt returns
  • Reboot Universal by issuing the 'reboot' command
    Type : reboot
  • When WinCe starts loading, remove the SD, and put it in your desktop, check that your desired size in MB correspond with what you set it to in fdisk ( If the size dossent match, look here )
  • Copy all files from C:\Linux\SD-MMC to the SD-card
  • Put the SD back in Universal
  • Boot Linux again (From /Universal/Documents/Linux/gnuharet.exe)
  • Prepare second mount point:

    Type : mkdir /mnt1

  • Mount the partitions
  • 1st partition mount

    Type : mount -t vfat /dev/mmc/blk0/part1 /mnt

  • 2nd partition mount

    Type : mount -t ext2 /dev/mmc/blk0/part2 /mnt1

    YOU MIGHT GET AN ERROR ?EXT2-fs warning...blablabla nevermind this

  • Decompress the files onto the ext2 partition

    Type : tar jxvpf /mnt/"Opie, GPE or bootstrap image" -C /mnt1/ (Check and verify the file name on SD, changes in file name may occure)

  • Issue the 'reboot' command again. This is important, to be sure that all the files are written properly to the SDCard.

Type : reboot

  • In WinCe, navigate to haret{DATE}.exe on your SD card and execute it
  • Hit : Run

Enjoy!


Method 1 (Quick Version)

  1. And here is the quick model :
  2. Plug the power cable into the device, Put the SD card into the device (All data will be erased)
  3. Go to \My Documents\Linux and hit gnuharet.exe

    Click Run

  4. Login

    Login with : root
    Password : rootme fdisk /dev/mmc/blk0/disc Type : o Type : n Type : p Type : 1

  5. Hit enter (This will set the default value to : 1 )

    Type : +31M ( If the size dossent match, look here ) Type : n Type : p Type : 2

  6. Hit enter to select the default value
  7. Hit enter to select the default value

    Type : t Type : 1 Type : 6 (For Fat 16) Type : w Type : mkdosfs /dev/mmc/blk0/part1 Type : mke2fs /dev/mmc/blk0/part2 Type : reboot

  8. Copy all files from C:\Linux\SD-MMC to the SD-card ( If the size dossent match, look here )
  9. Boot Linux again

    Type : mkdir /mnt1 Type : mount -t vfat /dev/mmc/blk0/part1 /mnt Type : mount -t ext2 /dev/mmc/blk0/part2 /mnt1 Type : tar jxvpf /mnt/"Opie, GPE or bootstrap image" -C /mnt1/ (Check and verify the file name on SD, changes in file name may occure) Type : reboot

  10. In WinCe, navigate to gnuharet.exe on your SD card and execute it
  11. Hit : Run

EEEEEEEEEEEEnjoy!


How to install a new Opie-Universal on an already formatted SD-Card

  1. Boot Linux with the ram disk
  2. Type : mkdir /mnt1
  3. Type : mount -t vfat /dev/mmc/blk0/part1 /mnt
  4. Type : mount -t ext2 /dev/mmc/blk0/part2 /mnt1
  5. Type : cd /mnt1
  6. Type : rm -rf *

    Error messages may occur, never mind them :

    rm: unable to stat `var/lock/browse.dat' : input/output error
    rm: unable to remove : `var/lock' : directory not empty
    rm: unable to stat `var/run/nmbd.pid' : input/output error
    rm: unable to remove : `var/run' : directory not empty
    rm: unable to remove : `var' : directory not empty

  7. Type : tar jxvpf /mnt/"Opie, GPE or bootstrap image" -C /mnt1/
  8. Type : reboot

Install Mini HOW-TO

You can try the bleeding edge kernel with a modified opie image from blueangel build if you follow all these steps:

  1. Accept that it may damage your device, and we don't take any responsibility.
  2. Make Backup!
  3. Download haret (gnuharet.exe) , kernel (zImage), haret config (default.txt) and the opie image (opie-universal-R0.tar.bz2) from http://www.linuxtogo.org/~htcpxa/
  4. Get SD card with size <= 1GB and partition it to have a ext2(ext3) filesystem.
  5. Format and mount it and extract the opie image into it.
  6. Copy the downloaded kernel, haret and it's config to the device internal storage.(for example, My Documents)
  7. Edit startup.root according to your configuration
    a) Edit the Kernel Name "zi" to match the name you gave to your downloaded kernel.
    b) Use the proper partition number at the 'root=' parameter. (/dev/mmc/blk0/part2 points to the second partition of your SD card. You will need to change this to /dev/mmc/blk0/part1 if you created a single partition.)
    c) Save the file as default.txt and place it on the device aside the haret executable.
  8. IMPORTANT! Enable GSM radio.
  9. Close all running programs and do a soft reset.
  10. Start haret and press the "Run" button.
  11. Logon as root with password rootme.

Partitioning & formatting the SDCard directly on the Universal (not PC)


Download the RAR or ZIP from either of these links, decompress the files and copy them to some location on your Universal (usually \My Documents\Linux)
When this is done, browse to this folder on your device and run HaRET.

In case it doesnt load up and it freezes at mmc_rescan (sometimes throws Kernel panic saying its unable to mount it) you might want to reformat your SD card to FAT16 (If using WinXP, choose FAT as its file system).

This will install, decompress and mount a ramdisk image as your root.
When the device finishes booting, login to the Universal with username root, password rootme.

The instructions for partitioning your SDCard & getting Linux onto it are as follows:
a) fdisk /dev/mmc/blk0/disc
a1) Clear your old partition table by typing o at the prompt.
b) We'll create 2 partitions here ('n' command), say, 1st - 31Mb, FAT16, 2nd - remaining space, ext2.
b1) First partition: Type n at the prompt, for a New partition, and hit Enter
b2) Choose p for Primary partition, and 1 for the partition number
b3) Choose 1 for the Start Block
b4) Choose 4 for the End Block (this is 31Mb)
c) Change the type of 1st partition to FAT16 ('t' command, type=6)
d) Create the second partition
d1) Type n at the prompt, hit Enter
d2) Choose p for Primary partition, and 2 for the partition number
d3) Choose the default Start Block
d4) Choose the default End Block - this will use all available space
e) Save the partition table ('w' command) You will be returned to the shell
f) Make filesystem for wince: mkdosfs /dev/mmc/blk0/part1
g) Make filesystem for Linux: mke2fs /dev/mmc/blk0/part2
h) Reboot Universal by issuing the 'reboot' command

At this point you will want to copy the OPIE "image" (.tar.bz2 file) to the Storage Card via Windows (or Windows Mobile)

i) In wince, copy files you need to 1st partition (Storage Card)
j) Boot Linux again
k) Prepare second mount point: mkdir /mnt1
l) Mount the partitions
l1) 1st partition: mount -t vfat /dev/mmc/blk0/part1 /mnt
l2) 2nd partition: mount -t ext2 /dev/mmc/blk0/part2 /mnt1
m) Decompress the files onto the ext2 partition:
m1) tar jxvpf /mnt/universal_rootfs_060312.tar.bz2 -C /mnt1/
n) Issue the 'reboot' command again. This is important, to be sure that all the files are written properly to the SDCard.

o) Grab the kernel from here, unZip the zImage file and copy it into your Linux folder on your device
p) Edit up your startup script (default.txt):

set KERNEL zImage
set CMDLINE "root=/dev/mmc/blk0/part2 console=tty0 mem=63M fbcon=rotate:1"
boot2

q) Enjoy!

Note: You can now copy haret, the kernel and your default.txt to the 31Mb Storage Card/FAT partition and launch it from that location. You may also wish to copy rd, should you need complete access to the ext2 partition (to decompress a new Opie .tar.bz2 for example!) 31Mb will comfortably contain the latest Opie image, should you wish to upgrade.


Back to the Universal main page


Last edited on November 20, 2008 2:07 pm.


Edit | PageHistory | Diff | PageInfo
Login
User Name: Password:
Remember Me?