| Other GNU/Linux on the Universal tips This is useful for instance when you cannot use the Universal temporarily and want to update, or install software, etc. I've used it when my Universal was in service, to update the software. All of the steps below, refer to actions you will take on a Debian GNU/Linux PC, not on the Universal.
- Install QEMU
- Get an armel kernel, initrd, and root filesystem from the QEMU armel page, originally found here.
$ wget -c http://sumoudou.org/uni/vmlinuz-2.6.24-1-versatile
$ wget -c http://sumoudou.org/uni/initrd.img-2.6.24-1-versatile
$ wget -c http://sumoudou.org/uni/debian_lenny_armel_small.qcow.gz
|
- Gunzip the root filesystem.
|
$ gunzip debian_lenny_armel_small.qcow.gz
|
- Create a QEMU img file to contain the Universal root filesystem for PC manipulation.
|
$ qemu-img create uni.img 6GB
| The 6GB refers to the image size, make it big enough, so that the whole Universal root filesystem fits inside it.
- Create the emulator armel.sh launch file.
|
$ echo 'qemu-system-arm -M versatilepb -hdb uni.img -kernel vmlinuz-2.6.24-1-versatile -initrd initrd.img-2.6.24-1-versatile -hda debian_lenny_armel_small.qcow -append "root=/dev/sda1" -m 256 -localtime' > armel.sh
|
- Make the emulator launch file executable.
- Run the emulator for the first time to create a filesystem on the img file.
When the emulator boots, you can login as user with password user or as root with password root. Login as root.
- Elementary networking now works, you can access the web, however ping doesn't work.
Install dbus. Otherwise you will get the Can not write log, openpty() failed (/dev/pts not mounted?) error later on in chroot, when installing with apt-get or aptitude.
# aptitude update
# aptitude install dbus
|
- Create one partition to span the whole img file mounted as /dev/sdb
- Create an ext2 filesystem on the partition.
- Shutdown the QEMU emulated system.
- Back in the PC Debian GNU/Linux system, you need to figure out how to mount the img file so that you can write to it.
You will get output similar to the following text:
You must set cylinders.
You can do this from the extra functions menu.Disk uni.img: 0 MB, 0 bytes
133 heads, 62 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
uni.img1 62 8386181 4193060 83 Linux
| To figure out the offset, necessary to specify in the mount command to mount the img file multiply the start sector, in the above case 62, with the number of bytes in a sector, in the above case 512. Therefore in this example, the loop offset would be 31744.
- Utilizing the offset number, figured out in the above step, mount the uni.img file on the PC.
|
# mount -o loop,offset=31744 uni.img /mnt
|
- Now the image file is mounted as /mnt/
Copy the Universal root filesystem you wish to work on to /mnt/
- When finished copying, copy /etc/resolv.conf file in the mounted /mnt/ system to /etc/resolv.conf.uni
|
# cp -P /mnt/etc/resolv.conf /mnt/etc/resolv.conf.uni
|
- Unmount the mounted img file.
- Start the QEMU emulator again.
Login as root.
- In the armel emulated system create a Universal chroot launch file.
# echo "mount /dev/sdb1 /mnt" > /usr/local/bin/uni
# echo "mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf.uni" >> /usr/local/bin/uni
# echo "cp /etc/resolv.conf /mnt/etc/" >> /usr/local/bin/uni
# echo "mount -o bind /dev /mnt/dev" >> /usr/local/bin/uni
# echo "mount -o bind /dev/pts /mnt/dev/pts" >> /usr/local/bin/uni
# echo "mount -o bind /proc /mnt/proc" >> /usr/local/bin/uni
# echo "mount -o bind /dev/shm /mnt/dev/shm" >> /usr/local/bin/uni
# echo "mount -t tmpfs none /mnt/tmp" >> /usr/local/bin/uni
# echo "mount -t tmpfs none /mnt/var/run" >> /usr/local/bin/uni
# echo "mount -t tmpfs none /mnt/var/lock" >> /usr/local/bin/uni
# echo "mount -t tmpfs none /mnt/var/tmp" >> /usr/local/bin/uni
# echo "chroot /mnt/" >> /usr/local/bin/uni
# echo "rm /mnt/etc/resolv.conf" >> /usr/local/bin/uni
# echo "mv /mnt/etc/resolv.conf.uni /mnt/etc/resolv.conf" >> /usr/local/bin/uni
# echo "umount /mnt/var/tmp" >> /usr/local/bin/uni
# echo "umount /mnt/var/lock" >> /usr/local/bin/uni
# echo "umount /mnt/var/run" >> /usr/local/bin/uni
# echo "umount /mnt/tmp" >> /usr/local/bin/uni
# echo "umount /mnt/dev/shm" >> /usr/local/bin/uni
# echo "umount /mnt/proc" >> /usr/local/bin/uni
# echo "umount /mnt/dev/pts" >> /usr/local/bin/uni
# echo "umount /mnt/dev" >> /usr/local/bin/uni
# echo "umount /mnt" >> /usr/local/bin/uni
|
- Make the chroot launch file executable.
|
# chmod 755 /usr/local/bin/uni
|
- Now you can launch the Universal chroot, which will put you in the Universal environment.
Here you can install software, run aptitude update and aptitude full-upgrade, etc. Elementary networking will work, allowing you to access the internet. ping will not work, as it needs root privileges on the host system side, but apt-get and aptitude will work.
- When finished, exit the chroot.
This will have unmounted the Universal image file and brought you back to the QEMU armel emulated environment.
- Exit the QEMU armel emulated environment.
After the QEMU armel emulated environment is halted you can close the QEMU window.
- Now you can mount the uni.img file in the same way as described above and copy the root filesystem off of it to the SD card you use in the Universal.
|