<em><a href="Non-Sumou.html">Other GNU/Linux on the Universal tips</a></em></p>

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.</p>

All of the steps below, refer to actions you will take on a Debian GNU/Linux PC, not on the Universal.

<ul> <li>Install QEMU <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># aptitude install qemu</b></td></tr></table></li> <li>Get an armel <a href="http://sumou.com/uni/vmlinuz-2.6.24-1-versatile">kernel</a>, <a href="http://sumou.com/uni/initrd.img-2.6.24-1-versatile">initrd</a>, and <a href="http://sumou.com/uni/debian_lenny_armel_small.qcow.gz">root filesystem</a> from the <a href="http://sumou.com/uni/vebu/qemu-armel.html">QEMU armel page</a>, originally found <a href="http://newpeople.debian.org/~aurel32/qemu/armel/">here</a>. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ wget -c <a href="http://sumou.com/uni/vmlinuz-2.6.24-1-versatile">http://sumou.com/uni/vmlinuz-2.6.24-1-versatile</a><br /> $ wget -c <a href="http://sumou.com/uni/initrd.img-2.6.24-1-versatile">http://sumou.com/uni/initrd.img-2.6.24-1-versatile</a><br /> $ wget -c <a href="http://sumou.com/uni/debian_lenny_armel_small.qcow.gz">http://sumou.com/uni/debian_lenny_armel_small.qcow.gz</a></b></td></tr></table></li> <li>Gunzip the root filesystem. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ gunzip debian_lenny_armel_small.qcow.gz</b></td></tr></table></li> <li>Create a QEMU img file to contain the Universal root filesystem for PC manipulation. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ qemu-img create uni.img 6GB</b></td></tr></table> The 6GB refers to the image size, make it big enough, so that the whole Universal root filesystem fits inside it.</li> <li>Create the emulator <a href="http://sumou.com/uni/armel.sh">armel.sh</a> launch file. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ 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 &quot;root=/dev/sda1&quot; -m 256 -localtime' &gt; armel.sh</b></td></tr></table></li> <li>Make the emulator launch file executable. <blockquote> <p class="quoted"><table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ chmod 755 armel.sh</b></td></tr></table> </blockquote></li>

<li>Run the emulator for the first time to create a filesystem on the img file. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ ./armel.sh</b></td></tr></table> When the emulator boots, you can login as <strong>user</strong> with password <strong>user</strong> or as <strong>root</strong> with password <strong>root</strong>. Login as root.</li> <li>Elementary networking now works, you can access the web, however ping doesn't work.</li> <li>Install dbus. Otherwise you will get the <strong>Can not write log, openpty() failed (/dev/pts not mounted?)</strong> error later on in chroot, when installing with apt-get or aptitude. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># aptitude update<br /> # aptitude install dbus</b></td></tr></table></li> <li>Create one partition to span the whole img file mounted as /dev/sdb <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># cfdisk /dev/sdb</b></td></tr></table></li> <li>Create an ext2 filesystem on the partition. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># mkfs.ext2 /dev/sdb1</b></td></tr></table></li> <li>Shutdown the QEMU emulated system. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># halt</b></td></tr></table></li> <li>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. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># fdisk -ul uni.img</b></td></tr></table> You will get output similar to the following text: You must set cylinders. You can do this from the extra functions menu.</li> </ul> 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 <blockquote> <p class="quoted">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 <strong>62</strong>, with the number of bytes in a sector, in the above case <strong>512</strong>. Therefore in this example, the loop offset would be <strong>31744</strong>. </blockquote>

<ul> <li>Utilizing the offset number, figured out in the above step, mount the uni.img file on the PC. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># mount -o loop,offset=31744 uni.img /mnt</b></td></tr></table></li> <li>Now the image file is mounted as /mnt/<br /> Copy the Universal root filesystem you wish to work on to /mnt/</li> <li>When finished copying, copy /etc/resolv.conf file in the mounted /mnt/ system to /etc/resolv.conf.uni <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># cp -P /mnt/etc/resolv.conf /mnt/etc/resolv.conf.uni</b></td></tr></table></li> <li>Unmount the mounted img file. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># umount /mnt</b></td></tr></table></li> <li>Start the QEMU emulator again. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>$ ./armel.sh</b></td></tr></table> Login as root.</li> <li>In the armel emulated system create a Universal chroot launch file. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># echo &quot;mount /dev/sdb1 /mnt&quot; &gt; /usr/local/bin/uni<br /> # echo &quot;mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf.uni&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;cp /etc/resolv.conf /mnt/etc/&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -o bind /dev /mnt/dev&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -o bind /dev/pts /mnt/dev/pts&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -o bind /proc /mnt/proc&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -o bind /dev/shm /mnt/dev/shm&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -t tmpfs none /mnt/tmp&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -t tmpfs none /mnt/var/run&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -t tmpfs none /mnt/var/lock&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mount -t tmpfs none /mnt/var/tmp&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;chroot /mnt/&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;rm /mnt/etc/resolv.conf&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;mv /mnt/etc/resolv.conf.uni /mnt/etc/resolv.conf&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/var/tmp&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/var/lock&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/var/run&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/tmp&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/dev/shm&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/proc&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/dev/pts&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt/dev&quot; &gt;&gt; /usr/local/bin/uni<br /> # echo &quot;umount /mnt&quot; &gt;&gt; /usr/local/bin/uni</b></td></tr></table></li> <li>Make the chroot launch file executable. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># chmod 755 /usr/local/bin/uni</b></td></tr></table></li> <li>Now you can launch the Universal chroot, which will put you in the Universal environment. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># uni</b></td></tr></table> Here you can install software, run **aptitude update</strong> 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.</li> <li>When finished, exit the chroot. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># exit</b></td></tr></table> This will have unmounted the Universal image file and brought you back to the QEMU armel emulated environment.</li> <li>Exit the QEMU armel emulated environment. <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># halt</b></td></tr></table> After the QEMU armel emulated environment is halted you can close the QEMU window.</li> <li>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.</li> </ul> <!— Page published by Emacs Muse ends here —> </div> <i>To send me feedback about this page, use the below email.</i><br /> <b>&copy; sumoudou.org 2010</b><br /> <img style="border:0" alt="sumoudou.org" src="email.gif" width="129" height="10" /><br /> <a href="http://www.gnu.org/" style="text-decoration: none;"><img style="border:0" alt="GNU" src="powered-by-gnu.png" />]] <a href="http://www.gnu.org/software/emacs/emacs.html" style="text-decoration: none;"><img style="border:0" alt="GNU Emacs" src="made-with-emacs.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hcoop-proud-member.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hosted-by-hcoop.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="made-with-muse.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="powered-by-muse.png" />]] <br /> <a href="http://www.fsf.org/resources/formats/playogg" style="text-decoration: none;"><img style="border:0" alt="Ogg" src="play-ogg.png" />]] <a href="http://www.catb.org/hacker-emblem/" style="text-decoration: none;"><img style="border:0" alt="Glider" src="glider.png" />]] <a href="http://ubuntu.com/" style="text-decoration: none;"><img style="border:0" alt="Ubuntu" src="ubuntu.png" />]] <a href="http://validator.w3.org/check?uri=referer" style="text-decoration: none;"><img style="border:0" alt="Valid XHTML 1.0 Strict!" src="valid-xhtml10-blue.png" />]] <a href="http://jigsaw.w3.org/css-validator/check/referer" style="text-decoration: none;"><img style="border:0" alt="Valid CSS!" src="valid-css-blue.png" />]] <br />Last updated January 10, 2010 </div> <br />. </body> </html>

.