Gdium Technical Howtos
For howtos about pmon and st7 firmware, please refer to the corresponding pages.
If you want to open your Gdium, you might want to check out the take apart tutorial. If you're doing any serious kernel hacking and debugging, you'll likely want a serial port; there's a tutorial on this here.
Gkey
Backup
Using Linux
- Plug your Gkey into your main machine USB port (which has to support the ext2 fs)
- Unmount all its partitions (since it will most likely automount)
- Identify which port it is connected to (most likely /dev/sda or /dev/sdb). As root you can use:
pdisk -l
- Unless you have a very slow machine we recommand to use gzip it to save space. Type the following command to make a copy of the Gkey:
dd if=/dev/sdb bs=4k | gzip -9 > /home/yourlogin/imagename.img.gz
- Of course if you have a lot disk space you can prefer the uncompressed image, then type the following command to make a full copy of the Gkey:
dd if=/dev/sdb of=/home/yourlogin/imagename.img bs=4k
In practice we found that reflashing a gkey from a compressed image is actually slightly faster than using the uncompressed image (on a reasonably powerful machine).
- Done !
Using Mac
- Plug your Gkey into your main machine USB port
- Unmount all its partitions (since it will most likely automount)
- Identify which port it is connected to (most likely /dev/disk2 or /dev/disk3).You can use Disk Utility
- Type the follow command (assuming your Gkey is connected to /dev/disk3) to make a full copy of the Gkey:
dd if=/dev/disk3 of=/Users/yourlogin/imagename.img bs=4k
- You can eventually zip or gzip it to save space while storing it:
dd if=/dev/disk3 bs=4k | gzip > /Users/yourlogin/imagename.img.gz
- Done !
Using Windows
You will need the DD tool from http://www.chrysocome.net/dd.
Use it first to find the mount point for the key:
dd -list
then you will be able to use dd in the same way as above.
(to be continued…)
note: there seem to be a problem preventing the use of dd on windows Vista.
Restore
Using Linux
- Plug your Gkey into your main machine USB key (which has to support the ext2 fs)
- Identify how the gkey has been identified
fdisk -l
Usually the answer will be /dev/sdb
- In case the Gkey partitions are mounted automatically - you'll have to unmount them.
Assuming they appear as /dev/sdb1, /dev/sdb2 and /dev/sdb3 (/dev/sdb4 is a swap partition and will not mount) you would use:
sudo unmount /dev/sdb[1-3]
or
su -c "unmount /dev/sdb[1-3]"
(if your linux does not support sudo)
- You can reflash the Gkey (assuming /dev/sdb) using the compressed image as follows:
gzip -dc <imagefile.img.gz> | sudo dd bs=2M of=/dev/sdb
- even fancier, you can use PV to monitor the progress of the operation (need to install pv first, of course):
pv <imagefile.img.gz> | gzip -dc - | sudo dd bs=2M of=/dev/sdb
* Using an uncompressed image to reflash the Gkey is even simpler (assuming it is connected as /dev/sdb):
sudo dd bs=2048k if=<imagefile.img> of=/dev/sdb
- Normally for a 16GB the operation status will be:
15296+0 records in 15296+0 records out 16039018496 bytes (16 GB) copied, 1084,94 s, 14,8 MB/s
- Done!
Using Mac
- Plug your Gkey into your main machine USB port
- Unmount all its partitions (since it will most likely automount)
- Identify which port it is connected to (most likely /dev/disk2 or /dev/disk3).You can use Disk Utility
- Using the previously saved img file to reflash the Gkey (assuming it is connected as /dev/disk3):
sudo dd bs=2048k if=<imagefile.img> of=/dev/disk3
- Normally for a 16GB the operation status will be:
15296+0 records in 15296+0 records out 16039018496 bytes (16 GB) copied, 1084,94 s, 14,8 MB/s
- Done!
- If the img is compressed:
gzip -dc imagefile.img.gz | sudo dd of=/dev/disk3 bs=2M
Using Windows
Re-initializing the Gkey
This process resets the Gkey:
- Open a terminal windows on your Gdium and run
su -c "/usr/sbin/drakhwtest_install_boot.sh 3"
- Reboot your machine
Please note that the user from the previous installation will be kept during the process so that you will have to pick another user name during the following configuration. Of course once the system is ready again, you can remove the old user.
If you want to keep the same user name you can:
Rename your current user before running the reinitialization script (you will be able to remove the renamed user later on)Does not work well, it is not possible to launch a terminal once the user has been renamedAfter running the reinitialization script, plug the Gkey into another computer and delete the home folder of the previous userProbably does not work because the records in /etc/passwd and /etc/shadow will still be there.
After some more testing, this procedure worked for me:
- start a terminal
- rename the current user
- rename the current user home folder (it is not done by the previous step)
mv /home/old_user /home/renamed_user_name
- in the terminal run
su -c "/usr/sbin/drakhwtest_install_boot.sh 3"
- reboot
- go through the initialization phase
- delete the renamed user
- deleting the renamed user should also delete its default group that we did not edit in the previous steps so, create it again and assign it as the primary group (using the same group id as the one that was just deleted), alternatively, it should be possible to edit it as well while editing the previous user
Build your own Gkey using linux
1- Define partition table
- For the hacker gkey:
sdx1 ⇒ VFAT 2Go (Label=homegdium)
sdx2 ⇒ / 9Go (Label=mips)
sdx3 ⇒ /home 3Go (Label=home)
sdx4 ⇒ Swap Rest (Label=swap)
- For a classic 16Go GKey:
sdx1 ⇒ VFAT 6Go (Label=homegdium)
sdx2 ⇒ / 6Go (Label=mips)
sdx3 ⇒ /home 1 to 2Go (Label=home)
sdx4 ⇒ Swap Rest (Label=swap)
If you want to drop the mbr :
dd if=/dev/zero of=/dev/sdx bs=512 count=1
a – Create partitions using fdisk command
fdisk /dev/sdx
if you have existing partition, just delete it using the command « d » and the partition number in fdisk.
Eg:
command: d
partition number: 4
⇒ this will delete your swap partition
To create a new partition, use the command « n »
« P » for primary partition
Select the partition number (1 ⇒ VFAT, 2 ⇒ /, 3 ⇒ /home, 4 ⇒ swap)
Provide the size you want for this partition (eg: 1000Mo)
In case of swap file and vfat, take care to adjust the partition type:
command t
type: 82 for swap
type: c for fat32
b - Create partitions using the sfdisk command
sfdisk -uM /dev/sdx
for each partition needed :
/dev/sdx1: ,6000,c /dev/sdx2: ,6000,83 /dev/sdx3: ,1000,83 /dev/sdx4: ,1001,84
using this, you create from the last used bloc, X Mo of space, using this file system type.
,6000,c ⇒ create a space of 6 Go using FAT32
WARNING: you must respect this logic: 1 ⇒ VFAT, 2 ⇒ /, 3 ⇒ /home, 4 ⇒ swap
2- format all partition
sdx1 ⇒ FAT
sdx2 ⇒ EXT3
sdx3 ⇒ EXT3
sdx4 ⇒ Swap
using mkfs tool :
To format the FAT partiton :
mkdosfs -F32 -n homegdium /dev/sdx1
To format a normal partition like sdx2 and sdx3 :
mkfs.ext3 -L mips /dev/sdx2 tune2fs -i0 /dev/sdx2
mkfs.ext3 -L home /dev/sdx3 tune2fs -i0 /dev/sdx3
To format the swap:
mkswap -L swap -p 16384 /dev/sdx4
To rename a partition, you can use :
for LINUX partition => e2label /dev/sdxx label for FAT partition => dosfslabel /dev/sdxx label
WARNING: the name is really important as it's used in the /etc/fstab to mount everything in your G-Linux using the label.
3- Mount all partition on your filesystem
mount /dev/sdx1 /mountpoint1
mount /dev/sdx2 /mountpoint2
mount /dev/sdx3 /mountpoint3
4- Push datas on GKey
a- Using Tarball from the .iso file
sdx1 ⇒ tar zxf /DIR/vfatfs.tar.gz -C /mountpoint1
sdx2 ⇒ tar zxf /DIR/rootfs.tar.gz -C /mountpoint2
sdx3 ⇒ tar zxf /DIR/homefs.tar.gz -C /mountpoint3
b- using another Gkey
Mount the original Gkey on your system.
mount /dev/sdy1 /mountpoint1a mount /dev/sdy2 /mountpoint2a mount /dev/sdy3 /mountpoint3a
Then copy all datas :
cp -af /mountpoint1a/* /mountpoint1 cp -af /mountpoint2a/* /mountpoint2 cp -af /mountpoint4a/* /mountpoint3
Add your RPMS
The best way to do it seems to use the chroot.
From a terminal :
chroot /mountpoint2 mount /proc
And now, you are working on the gkey system …
- add a rpm:
urpmi rpm_name.rpm
- remove a rpm:
urpme rpm_name.rpm
Repositary of G-Linux
Main http://glinux.gdium.com/2008.1/mips/media/main/release {
key-ids: 228db08e
}
Main\ Updates http://glinux.gdium.com/2008.1/mips/media/main/updates {
key-ids: 228db08e
update
}
Contrib http://glinux.gdium.com/2008.1/mips/media/contrib/release {
key-ids: 228db08e
}
Contrib\ Updates http://glinux.gdium.com/2008.1/mips/media/contrib/updates {
key-ids: 228db08e
update
}
Education http://glinux.gdium.com/2008.1/mips/media/edu/release {
key-ids: 228db08e
}
Education\ Updates http://glinux.gdium.com/2008.1/mips/media/edu/updates {
key-ids: 228db08e
update
}
Education\ debug http://glinux.gdium.com/2008.1/mips/media/debug_edu/release {
key-ids: 228db08e
}
Non-free http://glinux.gdium.com/2008.1/mips/media/non-free/release {
key-ids: 228db08e
}
Restricted http://glinux.gdium.com/2008.1/mips/media/restricted/release {
ignore
}
Gdium http://glinux.gdium.com/gdium/2008.1/mips/media/gdium/release {
key-ids: 228db08e
}
Gdium\ Updates http://glinux.gdium.com/gdium/2008.1/mips/media/gdium/updates {
key-ids: 228db08e
update
}
Gdium\ debug http://glinux.gdium.com/gdium/2008.1/mips/media/debug_gdium/release {
key-ids: 228db08e
}
Gdium\ Updates\ debug http://glinux.gdium.com/gdium/2008.1/mips/media/debug_gdium/updates {
key-ids: 228db08e
}
Restricted2 http://glinux.gdium.com/gdium/2008.1/mips/media/restricted/release {
ignore
}
Main2 http://gdium.oem.mandriva.com/2008.1/mips/media/main/release {
key-ids: 228db08e
}
Main\ Updates2 http://gdium.oem.mandriva.com/2008.1/mips/media/main/updates {
key-ids: 228db08e
update
}
Contrib2 http://gdium.oem.mandriva.com/2008.1/mips/media/contrib/release {
key-ids: 228db08e
}
Contrib\ Updates2 http://gdium.oem.mandriva.com/2008.1/mips/media/contrib/updates {
key-ids: 228db08e
update
}
Education2 http://gdium.oem.mandriva.com/2008.1/mips/media/edu/release {
key-ids: 228db08e
}
Education\ Updates2 http://gdium.oem.mandriva.com/2008.1/mips/media/edu/updates {
key-ids: 228db08e
update
}
Education\ debug2 http://gdium.oem.mandriva.com/2008.1/mips/media/debug_edu/release {
key-ids: 228db08e
}
Non-free2 http://gdium.oem.mandriva.com/2008.1/mips/media/non-free/release {
key-ids: 228db08e
}
Gdium2 http://gdium.oem.mandriva.com/gdium/2008.1/mips/media/gdium/release {
key-ids: 228db08e
}
Gdium\ Updates2 http://gdium.oem.mandriva.com/gdium/2008.1/mips/media/gdium/updates {
key-ids: 228db08e
update
}
Gdium\ debug2 http://gdium.oem.mandriva.com/gdium/2008.1/mips/media/debug_gdium/release {
key-ids: 228db08e
}
Gdium\ Updates\ debug2 http://gdium.oem.mandriva.com/gdium/2008.1/mips/media/debug_gdium/updates {
key-ids: 228db08e
}
OS
Reading internal temperature
- Launch a terminal window
- Type:
cat /sys/class/hwmon/hwmon0/device/temp1_input
Setting fan temperature threshold
How to change the values of thresholds operate fan
- Launch a terminal window
- Become root
- Edit /etc/sensors.conf with your favorite editor:
vi /etc/sensors.conf
- Modify “set temp_over” value to the temperature (in °C) to start the fan and “set temp_hyst” to power off
- Restart the fan controlling daemon:
/etc/init.d/lm_sensors restart
- Done!
The standard values are: “set temp_over” 60° and for “set temp_hyst” 55°
View the battery voltage values
How to see the values of standard level battery
- Launch a terminal window
- For see the minimum voltage
cat /sys/class/power_supply/gdium-battery/voltage_min
- For see the actual voltage
cat /sys/class/power_supply/gdium-battery/voltage_now
- For see the maximum voltage
cat /sys/class/power_supply/gdium-battery/voltage_max
- For see all battery informations
cat /sys/class/power_supply/gdium-battery/uevent
View ST7 values
cat /sys/kernel/debug/gdium-laptop
You will get something like this:
Version : 0x13 Status : 0x3c Ctrl : 0xfb Sign : 0xae Bat Lo : 0x02 Bat Hi : 0xd1 Battery : 8193000 uV
Get the Glinux version
cat /etc/product.id
How to get the serial port from Gdium
- firstly, you'd have your gdium dissemble
- you need solder 4 components to the mainboard
- U5 TL16C550CPT QFP48
- OSC1 Oscillator 3.6864MHz 30ppm 3.3V 7x5x1.7mm,SMT
- U6 SP3232ECY or MAX3232CUE TSSOP16
- J1 PINHEADER 1×3 2.54mm DIP
definition of J1 are as following: PIN1:Tx PIN2:GND PIN3:Rx
- you also need to change your pmon, for the UART was disabled in pmon defaultly.