December 08, 2019, 07:02:45 pm

News:

Have you visited the Allwinner Chipset wiki? - http://linux-sunxi.org/


Linaro 13.04 developer for A20

Started by patwood, July 30, 2013, 10:54:34 am

Previous topic - Next topic

ratin

Quote from: patwood on August 04, 2013, 04:00:06 pm
It's a very basic linaro install, directly from their root distribution, plus the openssh server for network logins.  Since there are several network managers available, some integrating into Gnome or other GUIs better than others, and some command-line based, this distro doesn't pick one for you.  I'm guessing the guys who put it together assumed you'd decide for yourself which one you wanted to install.

This describes what's in the distro: https://wiki.linaro.org/Platform/DevPlatform/Specs/DeveloperImage.


Hi Patwood,
I have done a similar SD card image base on 13.04 and  HW pack from your  http://dl.cubieforums.com/patwood/cubieboard2_hwpack.tar.gz.  . I am using Win32 Disk Imager to dump the image from SD card to a file, but my question is : is there a way to eliminate the empty disk space during writing the image to a file? Currently if I use a 2 GB SD card, the image is also 2 GB. I was wondering how do you make it to be the exact size of your rootfs.

Thanks
   

patwood

Quote from: ratin on August 14, 2013, 08:07:03 pm
Hi Patwood,
I have done a similar SD card image base on 13.04 and  HW pack from your  http://dl.cubieforums.com/patwood/cubieboard2_hwpack.tar.gz.  . I am using Win32 Disk Imager to dump the image from SD card to a file, but my question is : is there a way to eliminate the empty disk space during writing the image to a file? Currently if I use a 2 GB SD card, the image is also 2 GB. I was wondering how do you make it to be the exact size of your rootfs.

Thanks
   


To get optimal compression on the .img you're generating, do this just before you shut down the Cubie and make your image:

cd /
dd if=/dev/zero of=zero bs=1M             # note: may take a while
rm zero
sync                   # note: also may take a while


This will put zeros in all the free space on the file system.  Removing a file does not write zeros to the underlying file system storage; it simply puts the freed blocks on a linked list somewhere for future use. This is common to most file systems that are not designed to securely erase data, as it's fast.  Even a fresh file system, newly created with mkfs, will not have zeroed data blocks, so over time, a disk or SD card will end up with data in the free space, making it compress poorly.

ratin

Quote from: patwood on August 14, 2013, 11:06:27 pm
Quote from: ratin on August 14, 2013, 08:07:03 pm
Hi Patwood,
I have done a similar SD card image base on 13.04 and  HW pack from your  http://dl.cubieforums.com/patwood/cubieboard2_hwpack.tar.gz.  . I am using Win32 Disk Imager to dump the image from SD card to a file, but my question is : is there a way to eliminate the empty disk space during writing the image to a file? Currently if I use a 2 GB SD card, the image is also 2 GB. I was wondering how do you make it to be the exact size of your rootfs.

Thanks
   


To get optimal compression on the .img you're generating, do this just before you shut down the Cubie and make your image:

cd /
dd if=/dev/zero of=zero bs=1M             # note: may take a while
rm zero
sync                   # note: also may take a while


This will put zeros in all the free space on the file system.  Removing a file does not write zeros to the underlying file system storage; it simply puts the freed blocks on a linked list somewhere for future use. This is common to most file systems that are not designed to securely erase data, as it's fast.  Even a fresh file system, newly created with mkfs, will not have zeroed data blocks, so over time, a disk or SD card will end up with data in the free space, making it compress poorly.


Hi Patwood, I know about this trick, but I was wondering how to shrink the image size before compressing. I guess with w32 disk imager, there is no option to omit zeros. But if using dd to create the image file, it might be possible..

patwood

September 02, 2013, 09:27:36 pm #18 Last Edit: September 02, 2013, 11:42:22 pm by patwood
Quote from: ratin on September 01, 2013, 06:21:28 pmHi Patwood, I know about this trick, but I was wondering how to shrink the image size before compressing. I guess with w32 disk imager, there is no option to omit zeros. But if using dd to create the image file, it might be possible..

Ah, you want to resize the root fs to make it smaller so it only takes up the room needed for the files already on it.  You'll need a linux system for that, unless you can figure a way to allow a virtual linux system on windows to write to raw SD card devices.  Fortunately, the Cubie is a linux system, so all you need is a USB card reader and a second uSD card (you can't resize a mounted file system smaller, so you'll have to mount your distro on the USB reader):

1. Run fsck -f on the file system partition in /dev/sdaX (note: cannot be mounted).
2. Run resize2fs on the file system partition with the smaller requested size.
3. Run fdisk to delete/create a new smaller partition.

Make sure you leave enough room on the file system to allow booting (a couple dozen MB should be fine for startup log files and such).  Also, make sure people know they have to resize the root fs before doing anything else.

abouzarnouri

Hi,
I have installed this image on my C2 board. I just wonder why always after using "sudo" I receive this message: "unable to resolve host localhost.localdomain". Moreover I am not asked to enter password after using sudo! Why this happens and how I can resolve this issue?
Many thanks.

sanyigz

Quote from: abouzarnouri on October 14, 2013, 05:23:52 am
Hi,
I have installed this image on my C2 board. I just wonder why always after using "sudo" I receive this message: "unable to resolve host localhost.localdomain". Moreover I am not asked to enter password after using sudo! Why this happens and how I can resolve this issue?
Many thanks.


Yeah i had the same problem. But there are various other weird things happened when i was using this distro :(

patwood

Quote from: abouzarnouri on October 14, 2013, 05:23:52 am
Hi,
I have installed this image on my C2 board. I just wonder why always after using "sudo" I receive this message: "unable to resolve host localhost.localdomain". Moreover I am not asked to enter password after using sudo! Why this happens and how I can resolve this issue?
Many thanks.


I don't know what's causing your "unable to resolve host localhost.localdomain" message; however, to change the sudo behavior, edit /etc/groups and move linaro from the admin group to the sudo group.  See the file /etc/sudoers for how these two groups are handled by sudo.

abouzarnouri

Quote from: patwood on October 14, 2013, 10:43:04 am
Quote from: abouzarnouri on October 14, 2013, 05:23:52 am
Hi,
I have installed this image on my C2 board. I just wonder why always after using "sudo" I receive this message: "unable to resolve host localhost.localdomain". Moreover I am not asked to enter password after using sudo! Why this happens and how I can resolve this issue?
Many thanks.


I don't know what's causing your "unable to resolve host localhost.localdomain" message; however, to change the sudo behavior, edit /etc/groups and move linaro from the admin group to the sudo group.  See the file /etc/sudoers for how these two groups are handled by sudo.


Thanks patwood. I added the following lines to /etc/hosts and that message was gone.
127.0.0.1    localhost.localdomain localhost
127.0.1.1    my-machine


patwood

Quote from: abouzarnouri on October 15, 2013, 04:56:19 am
Thanks patwood. I added the following lines to /etc/hosts and that message was gone.
127.0.0.1    localhost.localdomain localhost
127.0.1.1    my-machine



Thanks for that.  I'll be sure to put that in the next upload.

abouzarnouri

Quote from: patwood on October 15, 2013, 10:19:26 am
Quote from: abouzarnouri on October 15, 2013, 04:56:19 am
Thanks patwood. I added the following lines to /etc/hosts and that message was gone.
127.0.0.1    localhost.localdomain localhost
127.0.1.1    my-machine



Thanks for that.  I'll be sure to put that in the next upload.


If you are going to continue your job on this Linaro dist., I suggest you to add kmod in the kernel configuration step. Since it's needed by many packages like python-dev. Due to this reason I switched back to Cubian. There I have access to kmod and I don't need to reconfigure the kernel myself.

patwood

Quote from: abouzarnouri on October 16, 2013, 07:17:42 am
Quote from: patwood on October 15, 2013, 10:19:26 am
Quote from: abouzarnouri on October 15, 2013, 04:56:19 am
Thanks patwood. I added the following lines to /etc/hosts and that message was gone.
127.0.0.1    localhost.localdomain localhost
127.0.1.1    my-machine



Thanks for that.  I'll be sure to put that in the next upload.


If you are going to continue your job on this Linaro dist., I suggest you to add kmod in the kernel configuration step. Since it's needed by many packages like python-dev. Due to this reason I switched back to Cubian. There I have access to kmod and I don't need to reconfigure the kernel myself.


Actually, I'm probably going to deprecate this distro soon, since 13.10 is now available.

Turns out kmod is installed (modprobe, insmod, etc.), but the apt-get system is borked due to a problem with the acpid install.  Backing it out and reinstalling now allows me to install packages like python-dev.

Thanks for pointing this out, as I doubt I would have noticed it myself.

So I'll probably upload one final version of this distro later today with this fix and the most recent kernel.

Note: the Ubuntu 13.10 (Saucy Salamander) build doesn't have this problem.

patwood

I have updated this distro with the /etc/hostname, /etc/hosts change (host name is now linaro-quantal-developer) and fixed the problem with apt-get.  I also added the uInitrd and uEnv-ro.txt files to allow mounting the SD card read-only as described in the 13.10 distro here: http://www.cubieforums.com/index.php/topic,891.0.html.

The download size is 135544932 and the md5 checksum is 8bce01d96d6d874031c32d7645df97d7.