<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>http://www.leon.nu/</id>
  <title>leon.nu Syndication</title>
  <updated>2011-06-03T21:00:00Z</updated>
  <link rel="alternate" href="http://www.leon.nu/"/>
  <link rel="self" href="http://www.leon.nu/atom.xml"/>
  <author>
    <name>Leon Romanovsky</name>
    <uri>http://www.leon.nu</uri>
  </author>
  <entry>
    <id>tag:www.leon.nu,2011-06-04:/2011/06/04/autofs-and-sshfs/</id>
    <title type="html">autofs and sshfs</title>
    <published>2011-06-03T21:00:00Z</published>
    <updated>2011-06-05T18:09:41Z</updated>
    <link rel="alternate" href="http://www.leon.nu/2011/06/04/autofs-and-sshfs/"/>
    <content type="html">&lt;p&gt;I'm working with remote servers and copy files via scp commands, almost every day. From time to time, there is need to  mount them via &lt;a href="http://en.wikipedia.org/wiki/SSHFS"&gt;sshfs&lt;/a&gt; filesystem, but it can be frustrating to repeat the same operations every time.&lt;/p&gt;

&lt;p&gt;As everything in the linux world, the mount process can be fully automatic. It is really simple: use &lt;a href="http://www.autofs.org/"&gt;autofs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I don't want to clone the guides, the internet is full of them, just want to add my insights: &lt;br/&gt; 1.  automatic mount process is done under root privileges, so you will need to create SSH public key for the root and not for the user. &lt;br/&gt; 2. automapping configuration doesn't support dots as a path.&lt;/p&gt;
</content>
    <summary type="html">simple about simple</summary>
  </entry>
  <entry>
    <id>tag:www.leon.nu,2011-05-07:/2011/05/07/memcpy-and-memmove/</id>
    <title type="html">memcpy and memmove</title>
    <published>2011-05-06T21:00:00Z</published>
    <updated>2011-05-10T09:17:18Z</updated>
    <link rel="alternate" href="http://www.leon.nu/2011/05/07/memcpy-and-memmove/"/>
    <content type="html">&lt;p&gt;&lt;a href="http://article.gmane.org/gmane.comp.lib.glibc.alpha/15278"&gt;The patch&lt;/a&gt; from the Intel guys has exposed &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=638477"&gt;the bugs&lt;/a&gt; in code where developers ignored the requirement that the source and destination arrays passed to memcpy() cannot overlap.&lt;/p&gt;

&lt;p&gt;It seems like a good time to remind you the difference between memcpy() and memmove(), don't fail like &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=638477"&gt;Adobe&lt;/a&gt; did.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The  memcpy()  function  copies  n bytes from memory area src to memory area dest.  &lt;em&gt;The memory areas should not overlap&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The  memmove()  function  copies n bytes from memory area src to memory area dest.  &lt;em&gt;The memory areas may overlap&lt;/em&gt;: copying takes place as though the bytes in src are first copied into a temporary  array that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</content>
    <summary type="html">don't forget the basics</summary>
  </entry>
  <entry>
    <id>tag:www.leon.nu,2011-04-18:/2011/04/18/job-control-turned-off/</id>
    <title type="html">can't access tty</title>
    <published>2011-04-17T21:00:00Z</published>
    <updated>2011-05-07T10:20:41Z</updated>
    <link rel="alternate" href="http://www.leon.nu/2011/04/18/job-control-turned-off/"/>
    <content type="html">&lt;p&gt;Follow up on my earlier &lt;a href="http://www.leon.nu/2011/04/16/android-on-toshiba/"&gt;post&lt;/a&gt;, about the error during recovery and update processes.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/bin/sh: can't access tty: job control turned off
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The source of this error is incorrect init file from the recovery partition.&lt;/p&gt;

&lt;p&gt;Just to remind you that the partition table of &lt;a href="http://www.leon.nu/2011/04/16/android-on-toshiba/"&gt;Toshiba AC100-118&lt;/a&gt; has 13 partitions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Partition 2   - BCT  - boot config table&lt;/li&gt;
&lt;li&gt;Partition 3   - PT  - partition table&lt;/li&gt;
&lt;li&gt;Partition 4   - EBT - bootloader&lt;/li&gt;
&lt;li&gt;Partition 5   - SOS - recovery partition&lt;/li&gt;
&lt;li&gt;Partition 6   - LNX - linux system&lt;/li&gt;
&lt;li&gt;Partition 7   - MBR - master boot record&lt;/li&gt;
&lt;li&gt;Partition 8   - APP - applications (/system)&lt;/li&gt;
&lt;li&gt;Partition 9   - CAC - cache (/cache)&lt;/li&gt;
&lt;li&gt;Partition 10  - MSC - miscellaneous (/misc)&lt;/li&gt;
&lt;li&gt;Partition 11 - EM1 - partition table&lt;/li&gt;
&lt;li&gt;Partition 12 - UDA - user data (/data)&lt;/li&gt;
&lt;li&gt;Partition 13 - EM2 - partition table&lt;/li&gt;
&lt;li&gt;Partition 14 - UDB - user storage (/storage)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;In very few words, I'll try to explain how to fix it. I assume you already know what is &lt;a href="http://www.leon.nu/2011/04/17/linux4tegra-removed/"&gt;nvflash utility&lt;/a&gt; and how to work with it.&lt;/p&gt;

&lt;h2&gt;Backup&lt;/h2&gt;

&lt;p&gt;First of all we start from the backup. We are going to change the recovery partition, so it is the one we are going to save, but I strongly recommend to save &lt;strong&gt;ALL&lt;/strong&gt; partitions.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=. ./nvflash --bl ../prebuilt/fastboot.stock.bin --go
LD_LIBRARY_PATH=. ./nvflash -r --getpartitiontable partitiontable.txt
LD_LIBRARY_PATH=. ./nvflash -r --read 5 part-5.img
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Copy the Image&lt;/h2&gt;

&lt;p&gt;Copy part-5.img file you downloaded to any folder far away from your backup, and work only there.&lt;/p&gt;

&lt;h2&gt;Unpacking&lt;/h2&gt;

&lt;p&gt;The unpack_bootimg tool was written by &lt;a href="http://kotelett.no/ac100/"&gt;Phh&lt;/a&gt;. The compiled version can be found on &lt;a href="http://www.leon.nu/development/image_tools.tar.gz"&gt;my site&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;./unpack_bootimg part-5.img
mkdir ramdisk
zcat initrd.img | ( cd ramdisk; cpio -i )
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Editing&lt;/h2&gt;

&lt;p&gt;Make changes in the init file, located under ramdisk folder. Change the following line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;for dev in mmcblk1p1 mmcblk1p2 mmcblk1p3 sda1 sda2 sda3:do
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to be&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;for dev in mmcblk0p1 mmcblk0p2 mmcblk0p3 sda1 sda2 sda3:do
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Re-Packing the images&lt;/h2&gt;

&lt;p&gt;The make_bootimg tool was written by &lt;a href="http://kotelett.no/ac100/"&gt;Phh&lt;/a&gt;, and mkbootfs was taken from the &lt;a href="http://android.git.kernel.org/"&gt;Android SDK source&lt;/a&gt;. The compiled versions can be found on &lt;a href="http://static.leon.nu/ac100/tools/image_tools.tar.gz"&gt;my site&lt;/a&gt;. The command line of the make_bootimg tool must be according to &lt;a href="https://gitorious.org/ac100/pages/CommandLine"&gt;the model&lt;/a&gt; you are using.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd ..
mkbootfs ./ramdisk | gzip &amp;gt; ramdisk-new.img
./make_bootimg part-5.img zImage ramdisk-new.img -c 'mem=448M@0M nvmem=64M@448M 
vmalloc=320M video=tegrafb console=tty0 usbcore.old_scheme_first=1 quiet splash
tegraboot=sdmmc tegrapart=recovery:300:a00:800,boot:d00:1000:800,mbr:1d00:200:800'
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Restore the partition&lt;/h2&gt;

&lt;p&gt;Use [StartSector], [NumSectors] from the partitiontable.txt you saved at the backup stage.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;LD_LIBRARY_PATH=. ./nvflash --bl fastboot.bin --go
LD_LIBRARY_PATH=. ./nvflash -r --rawdevicewrite [StartSector] [NumSectors] part-[PartitionId].img
LD_LIBRARY_PATH=. ./nvflash -r --rawdevicewrite [StartSector] [NumSectors] part-2.img
&lt;/code&gt;&lt;/pre&gt;
</content>
    <summary type="html">the power of open source</summary>
  </entry>
  <entry>
    <id>tag:www.leon.nu,2011-04-17:/2011/04/17/linux4tegra-removed/</id>
    <title type="html">Linux 4 Tegra (L4T) Removed</title>
    <published>2011-04-16T21:00:00Z</published>
    <updated>2011-04-17T09:02:34Z</updated>
    <link rel="alternate" href="http://www.leon.nu/2011/04/17/linux4tegra-removed/"/>
    <content type="html">&lt;p&gt;&lt;code&gt;Mar 25 2011 at 6:12 PM
We have removed the L4T downloads from the site due to some bugs and while we prepare for a forthcoming release. Please continue to report if you are having issues (or successes).&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.nvidia.com"&gt;Nvidia&lt;/a&gt; removed from their web site the Linux 4 Tegra (L4T). This package enebled to the developers to program Linux on &lt;a href="http://developer.nvidia.com/tegra/devkit-250tango"&gt;Nvidia Tegra 250&lt;/a&gt; based platforms.&lt;/p&gt;
</content>
    <summary type="html">good to be nvidia</summary>
  </entry>
  <entry>
    <id>tag:www.leon.nu,2011-04-16:/2011/04/16/android-on-toshiba/</id>
    <title type="html">Toshiba AC100 &amp; Android 2.1 (Eclair)</title>
    <published>2011-04-15T21:00:00Z</published>
    <updated>2011-04-18T08:39:36Z</updated>
    <link rel="alternate" href="http://www.leon.nu/2011/04/16/android-on-toshiba/"/>
    <content type="html">&lt;p&gt;&lt;img src="http://www.leon.nu/images/toshiba-ac100.jpg" alt="Toshiba AC100 netbook" /&gt;&lt;/p&gt;

&lt;p&gt;Yesterday, I received the Toshiba AC100 netbook. The &lt;a href="http://uk.computers.toshiba-europe.com/innovation/jsp/SUPPORTSECTION/discontinuedProductPage.do?service=UK&amp;amp;com.broadvision.session.new=Yes&amp;amp;PRODUCT_ID=1091301"&gt;specification&lt;/a&gt; and reviews look promising too, but the reailty was less shiny.&lt;/p&gt;

&lt;p&gt;First of all, my computer arrived with more than one keyboard layout. In my case default layout was not english, and it took me time to realize how it can be changed. If you new to the Android based netbook, know the magic combination is  &lt;strong&gt;CTRL + BACKSPACE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After I succesfully changed the keyboard layout, the second problem arised. The connection to my WiFi access point was dropped after a couple of seconds. If you suffer from continious disconnects, try to change channel on your router to be &lt;strong&gt;channel 1&lt;/strong&gt;. It helped me.&lt;/p&gt;

&lt;p&gt;And third, the most important and less funny, Right after factory reset or operating system update you can can receive the error:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/bin/sh: can't access tty: job control turned off
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This error is caused by incorrect init file and the line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;for dev in mmcblk1p1 mmcblk1p2 mmcblk1p3 sda1 sda2 sda3:do
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;must be changed to&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;for dev in mmcblk0p1 mmcblk0p2 mmcblk0p3 sda1 sda2 sda3:do
&lt;/code&gt;&lt;/pre&gt;
</content>
    <summary type="html">journey to the hell</summary>
  </entry>
</feed>

