All times are UTC-06:00




Post new topic  Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Mon Nov 21, 2011 11:40 pm 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
I would like to run Gentoo on my new Efika MX.

I've followed the HowTo at http://dev.gentoo.org/~darkside/arm/efi ... nstall.xml which advocates creating two partitions on the internal disk: 1st being Windows Format and the 2nd ext4 (I prefer to use ext3 and presume using ext3 is not a deal breaker).

But then in this forum in the last few days, Stephen Klimaszewski(steev) offered his /boot and /lib files in this topic:
http://www.powerdeveloper.org/forums/vi ... php?t=2104

Then, there is the Gentoo install wiki at http://en.gentoo-wiki.com/wiki/Efika which seems outdated and takes a variety of approaches.

Should I have a SWAP partition? I understand that having a /boot partition is not necessary, I can just have two partitions, with the booting image under the root partition under /boot. But then, the Howto says that the first partition must be formatted with Windows VFAT32 in order for U-Boot to read it. So, I'm getting confused.

I do not have the board that provide serial console access and I think if I had some guidance on a proven install/modification from the factory default I'd be in a position of booting up to Gentoo and then trying to compile my own kernels. Using the Ubuntu on an SD card, I've gone through the stage of creating two partitions on the internal disk and unzipping an in image and portage on the root partition. I've even successfully compiled a kernel. So I'm probably close.


Top
   
 Post subject:
PostPosted: Tue Nov 22, 2011 2:19 am 
Offline
Genesi

Joined: Tue Feb 07, 2006 4:49 pm
Posts: 145
Location: San Antonio, TX
Hi,

The wiki page is definitely outdated (actually it's for the PPC Efika, not the ARM based EfikaMX). Gentoo has its own wiki (after the pre-requisite period of bikeshedding ;) ), perhaps I should look into updating this info and putting it on there.

To answer the questions, number of partitions doesn't particularly matter. In the latest releases, we don't create a swap partition because we use ramzswap and use a file on the filesystem for it. It always helps to have swap though. File system format doesn't matter *too* much, although, I believe that /boot needs to be on vfat, ext2 or ext3 (not sure if our uboot supports ext4, Matt can correct me if I am wrong).

Root can be whatever as long as the kernel has the support built in.

Realistically, it sounds like you are close, I'm more curious as to what you are stuck at. What I tend to do is run off an SD card and get that working first, although the opposite works just as well.

My Gentoo smartbook looks like this...

/boot - ext2 partition
/ - ext4 partition
swap - /dev/sdb5 (usb hard drive)
/var/tmp/portage - /dev/sdb6
/var/overlays - /dev/sdb7
/usr/portage - /dev/sdb8
/usr/lib/debug - /dev/sdb9 (I build everything splitdebug)
/buildbot - /dev/sdb10 - (misc things to be built manually like internal things, and drivers and such)

I don't use ramzswap on there (yet) mostly because I forgot about it until now. I am only working on it in my free time and I'm working on getting Gnome 3 running on there (almost have gnome-shell working!)

But for a "quick howto" this is what I do...

Boot from sdcard (the installer image, using N to enter recovery console)

Set up networking on the sd card and connect to the network.

<partitioning as I mentioned above>

Mount partitions

download stage3 tarball, and extract it
download portage tarball and extract it

build the kernel -
make mx51_efikamx_defconfig;
make menuconfig
< here I remove things that I will never have, and add in things like file system support, since I don't use an initramfs >

install things like wpa_supplicant, system logger, dhcp client, sudo, update any new packages etc.

edit
/etc/fstab (partitioning)
/etc/inittab (we use /dev/ttymxc0 not /dev/ttyS0)
/etc/securetty (so I can log in from serial console if needed)

<set root password!>
<create normal user>
<set user password!>

Cross fingers, and reboot. If it fails, take note of any error messages, and search the internet for them. Odds are, someone has already run into the issue and it's a quick fix.


Now the reason I keep /usr/portage on it's own partition is that there are tons of tiny files in there, and so I prefer to have it on an external usb hard drive. Same with /var/tmp/portage; Also if you attempt to build something like firefox, or libreoffice, which are huge, and you run out of memory somehow, it's possible that it will hose the file system. I have had that happen to me once or twice.

By all means, if you have any specific questions, let me know, I love Gentoo, and am always willing to help someone out :)

_________________
Steev Klimaszewski, Genesi USA Inc.
Senior Software Engineer


Top
   
 Post subject:
PostPosted: Tue Nov 22, 2011 10:57 am 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
Thank you, Steev.

I'm following your recommendations. I am unable to find
Code:
(chroot) efikamx-armhf linux # pwd
/usr/src/linux
(chroot) efikamx-armhf linux # find . -name "*efika*"
./sound/soc/fsl/efika-audio-fabric.c
./include/config/mach/mx51/efikamx.h
./include/config/mx51/efika
./arch/powerpc/platforms/52xx/efika.c
./arch/arm/mach-mx5/board-mx51_efikasb.c
./arch/arm/mach-mx5/mx51_efika.c
./arch/arm/mach-mx5/efika.h
./arch/arm/mach-mx5/board-mx51_efikamx.o
./arch/arm/mach-mx5/board-mx51_efikamx.c
./arch/arm/mach-mx5/mx51_efika.o
./arch/arm/mach-mx5/.board-mx51_efikamx.o.cmd
./arch/arm/mach-mx5/.mx51_efika.o.cmd
(chroot) efikamx-armhf linux #
Here's the November 8th stage3 tarball I used: stage3-armv7a_hardfp-20111108.tar.bz2 and I downloaded the latest portage of same date. I also updated my portage with "emerge --sync" just in case you were referencing something hot off the griddle, so I should be completely up todate. Unfortunately, I'm not finding the the configuration file "mx51_efikamx_defconfig" you referenced. Is "mx51_efikamx_defconfig" something you created or am I missing something I should have installed, such as an overlay?
I


Top
   
 Post subject:
PostPosted: Tue Nov 22, 2011 11:05 am 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
I had not
Code:
emerge gentoo-sources
and I am now doing so, that probably is why the configuration file is not showing up. I'll updated after the emerge completes.


Top
   
 Post subject:
PostPosted: Tue Nov 22, 2011 1:13 pm 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
Quote:
I had not
Code:
emerge gentoo-sources
and I am now doing so, that probably is why the configuration file is not showing up. I'll updated after the emerge completes.
Emerging gentoo-sources and vanilla-sources did not bring it in:
Code:
(chroot) efikamx-armhf src # pwd
/usr/src
(chroot) efikamx-armhf src # ls -la
total 16
drwxr-xr-x 4 root root 4096 Nov 22 19:00 .
drwxr-xr-x 12 root root 4096 Nov 14 21:17 ..
-rw-r--r-- 1 root root 0 Nov 8 16:52 .keep
lrwxrwxrwx 1 root root 18 Nov 14 21:49 linux -> linux-3.0.6-gentoo
drwxr-xr-x 23 root root 4096 Nov 22 19:06 linux-3.0.6
drwxr-xr-x 24 root root 4096 Nov 22 17:23 linux-3.0.6-gentoo
(chroot) efikamx-armhf src # find linux-3.0.6 -name "*efika*"
linux-3.0.6/sound/soc/fsl/efika-audio-fabric.c
linux-3.0.6/arch/powerpc/platforms/52xx/efika.c
linux-3.0.6/arch/arm/mach-mx5/board-mx51_efikasb.c
linux-3.0.6/arch/arm/mach-mx5/mx51_efika.c
linux-3.0.6/arch/arm/mach-mx5/efika.h
linux-3.0.6/arch/arm/mach-mx5/board-mx51_efikamx.c
(chroot) efikamx-armhf src # find linux-3.0.6-gentoo -name "*efika*"
linux-3.0.6-gentoo/sound/soc/fsl/efika-audio-fabric.c
linux-3.0.6-gentoo/include/config/mach/mx51/efikamx.h
linux-3.0.6-gentoo/include/config/mx51/efika
linux-3.0.6-gentoo/arch/powerpc/platforms/52xx/efika.c
linux-3.0.6-gentoo/arch/arm/mach-mx5/board-mx51_efikasb.c
linux-3.0.6-gentoo/arch/arm/mach-mx5/mx51_efika.c
linux-3.0.6-gentoo/arch/arm/mach-mx5/efika.h
linux-3.0.6-gentoo/arch/arm/mach-mx5/board-mx51_efikamx.o
linux-3.0.6-gentoo/arch/arm/mach-mx5/board-mx51_efikamx.c
linux-3.0.6-gentoo/arch/arm/mach-mx5/mx51_efika.o
linux-3.0.6-gentoo/arch/arm/mach-mx5/.board-mx51_efikamx.o.cmd
linux-3.0.6-gentoo/arch/arm/mach-mx5/.mx51_efika.o.cmd
(chroot) efikamx-armhf src #


Top
   
 Post subject:
PostPosted: Tue Nov 22, 2011 1:33 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi John,

You can find our kernel source and the defconfig file you're looking for on our git repo:

https://github.com/genesi/linux-legacy


Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Wed Nov 23, 2011 9:26 pm 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
I pulled the image from the GIT repository and built a uImage. Unfortunately, Lilo is not a part of the Gentoo image and when I tried to emerge it, it failed. I logged a bug with Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=391755

Thinking I could use Debian's lilo, I tried to install it and was blocked:
Code:
root@efikamx-armhf:~# apt-get install lilo
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lilo is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'lilo' has no installation candidate
root@efikamx-armhf:~#
Would grub work? This is not going to be easy:
Code:
(chroot) efikamx-armhf linux # emerge sys-boot/grub

* IMPORTANT: 1 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.

Calculating dependencies... done!
[ebuild N *] sys-boot/os-prober-1.47
[ebuild N ] dev-libs/lzo-2.04 USE="-examples -static-libs"
[ebuild N ] sys-devel/autoconf-wrapper-10-r1
[ebuild N ] sys-devel/automake-wrapper-5
[ebuild N ] sys-devel/m4-1.4.15 USE="-examples"
[ebuild N ] dev-python/pycrypto-2.3 USE="gmp -doc"
[ebuild N ] dev-python/setuptools-0.6.21
[ebuild N ] dev-perl/Locale-gettext-1.50.0
[ebuild N ] sys-devel/autoconf-2.68 USE="-emacs"
[ebuild N ] sys-apps/help2man-1.38.2 USE="nls"
[ebuild N ] dev-python/paramiko-1.7.7.1 USE="-doc -examples"
[ebuild N ] sys-devel/bison-2.4.3 USE="nls -static"
[ebuild N ] sys-devel/automake-1.11.1
[ebuild N ] dev-vcs/bzr-2.4.1 USE="sftp -bash-completion -curl -doc -emacs -test"
[ebuild N ] virtual/yacc-0
[ebuild N ] sys-devel/libtool-2.4-r1 USE="-test -vanilla"
[ebuild N ] sys-devel/flex-2.5.35_p10 USE="nls -static -test"
[ebuild N ] dev-scheme/guile-1.8.8-r1 USE="deprecated nls regex threads -debug -debug-freelist -debug-malloc -discouraged -emacs -networking"
[ebuild N ] sys-devel/autogen-5.11.5
[ebuild N ] dev-util/gtk-doc-am-1.18
[ebuild N ] dev-libs/glib-2.28.8 USE="static-libs -debug -doc -fam (-introspection) (-selinux) -test -xattr"
[ebuild N ] dev-util/pkgconfig-0.26 USE="(-hardened)"
[ebuild N ] dev-libs/libburn-1.0.0 USE="-debug -track-src-odirect"
[ebuild N ] dev-libs/libisofs-1.0.0 USE="acl zlib -debug -verbose-debug -xattr"
[ebuild N ] dev-libs/libisoburn-1.0.0 USE="acl readline zlib -debug -external-filters -external-filters-setuid -xattr"
[ebuild N *] sys-boot/grub-9999 USE="nls -custom-cflags -debug -device-mapper -efiemu -sdl -static -truetype" GRUB_PLATFORMS="-coreboot -efi-32 -efi-64 -emu -ieee1275 -multiboot -pc -qemu -qemu-mips -yeeloong"

The following keyword changes are necessary to proceed:
#required by sys-boot/grub-9999, required by sys-boot/grub (argument)
>=sys-boot/os-prober-1.47 **
#required by sys-boot/grub (argument)
>=sys-boot/grub-9999 **

NOTE: This --autounmask behavior can be disabled by setting
EMERGE_DEFAULT_OPTS="--autounmask=n" in make.conf.

Use --autounmask-write to write changes to config files (honoring CONFIG_PROTECT).

* IMPORTANT: 1 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.

(chroot) efikamx-armhf linux #
[/b]


Top
   
 Post subject:
PostPosted: Wed Nov 23, 2011 10:06 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

Neither Grub nor Lilo will work since the Efika uses UBoot.


Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Wed Nov 23, 2011 11:59 pm 
Offline
Genesi

Joined: Tue Feb 07, 2006 4:49 pm
Posts: 145
Location: San Antonio, TX
I guess I left that portion out.

For booting, we use uboot, which you don't need to compile or install yourself. All you need to do is install u-boot-tools and then in the /boot partition you should have your uImage (kernel) and then a file called boot.script with the following contents:
Code:
setenv ramdisk uInitrd;
setenv kernel uImage;
setenv bootargs console=tty1 root=/dev/sda2 rootwait rootfstype=ext4 rw quiet;
${loadcmd} ${ramdiskaddr} ${ramdisk};
if imi ${ramdiskaddr}; then; else
setenv bootargs ${bootargs} noinitrd;
setenv ramdiskaddr "";
fi;
${loadcmd} ${kerneladdr} ${kernel}
if imi ${kerneladdr}; then
bootm ${kerneladdr} ${ramdiskaddr}
fi;
Once that file is in place (you could even just copy it from the already installed system, or off the installer sdcard although the installer's boot.script is a bit more involved as it can be used to update uboot (not advised!), you can generate the boot.scr that uboot looks for by running the following command
Code:
mkimage -A arm -T script -C none -d /boot/boot.script /boot/boot.scr

_________________
Steev Klimaszewski, Genesi USA Inc.
Senior Software Engineer


Top
   
 Post subject:
PostPosted: Thu Nov 24, 2011 9:49 am 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
Yippeee! I did it.

Now, to document the entire process and make the files available so this becomes a 1 hour install (not including compile or unzip times).

Thank you, Stephen and Johan!


Top
   
PostPosted: Thu Nov 24, 2011 9:55 pm 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
So, I
Code:
emerge --sync
to update my install; then:
Code:
emerge --update --newuse --deep world
to bring me up todate. One of the items to update was gcc and during the compiliation of that I maxed out the number of inodes to my /dev/mnt/sda2. Basically I can not add any more files which is effectively running out of disk space even though I have 30% supposedly available.

Here's my partition information that I chose base upon the Gentoo Efika install How to:
Code:
localhost ~ # fdisk -l

Disk /dev/sda: 8012 MB, 8012390400 bytes
255 heads, 63 sectors/track, 974 cylinders, total 15649200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00083a07

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 67583 32768 83 Linux
/dev/sda2 67584 15649199 7790808 83 Linux
localhost ~ #
I have traditionally monitoring my disk usage with "df" and kept an eye on the percentage of blocks used. So here I am with:
Code:
localhost ~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 7668336 4558044 2720752 63% /
/dev/root 7668336 4558044 2720752 63% /
devtmpfs 232948 100 232848 1% /dev
rc-svcdir 1024 40 984 4% /lib/rc/init.d
shm 233020 0 233020 0% /dev/shm
localhost ~ #
and thinking I've got enough room to update me system before I embark on rerouting portions of the disk to other spaces (USB disk or external hard drive). But, then my attempt to compile is broken by an error message "No space left on device." I have now learned that "inodes" play an important part in the design of what file system you create. I've never had this problem before, but it sure has bitten me now:
Code:
localhost ~ # df -hi
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 477K 477K 0 100% /
/dev/root 477K 477K 0 100% /
devtmpfs 57K 561 57K 1% /dev
rc-svcdir 57K 46 57K 1% /lib/rc/init.d
shm 57K 1 57K 1% /dev/shm
localhost ~ #
As you can see, I have used up all my inodes, so I cannot create any more files despite the fact that I have 30% space available.

Ouch. I looks like I'll have to start over and re-image the partition with a file system and use more inodes. I've never run into this type of problem before, so anyone else venturing into the area is warned -- learn about what inodes are and consider a strategy that will not leave you in a predicament such as I am in: a disk only 70% utilized in blocks, but 100% utilized in inodes.

I guess, I could add another USB drive, copy everything over, then reboot to an SD Card, install a new file system with more inodes and then copy my tree back over to the newly formatted (and more accomdating) /dev/sda2.


Top
   
 Post subject:
PostPosted: Thu Nov 24, 2011 10:57 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi,

The way I usually work with Gentoo on small systems is that the portage tree goes on an external harddrive, preferably formatted with XFS or another filesystem which supports dynamic inode allocation.

You could do the same and just move the portage tree to another drive, and put a symlink in place. That should free up some inodes...

Johan.

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
 Post subject:
PostPosted: Fri Nov 25, 2011 7:21 am 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
Yup, I wanted to get some basics going before I started moving directories off of the internal memory.

Just for the record, I had erroneously unpacked portage to root rather (in addition to /usr) so I had a duplicate portage at /portage. This contributed to the consumption of the available inodes. I did not want someone reading this thread to think that an early start of a fresh install resulted in a shortage of inodes -- the problem I encountered was a result of my carelessness a week ago when I was preparing the disks, I forgot to remove the /portage node. My inode count after removing portage is back to normal:
Code:
localhost / # df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 487680 310155 177525 64% /
/dev/root 487680 310155 177525 64% /
devtmpfs 58237 596 57641 2% /dev
rc-svcdir 58255 46 58209 1% /lib/rc/init.d
shm 58255 1 58254 1% /dev/shm
/dev/sdb1 1957888 11 1957877 1% /mnt/king2
localhost / # df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 7668336 3664008 3614788 51% /
/dev/root 7668336 3664008 3614788 51% /
devtmpfs 232948 116 232832 1% /dev
rc-svcdir 1024 40 984 4% /lib/rc/init.d
shm 233020 0 233020 0% /dev/shm
/dev/sdb1 30830548 176196 29088252 1% /mnt/king2
localhost / #
I also want to take the opportunity to warn that installing the GIT of the Genesi kernel consumes a good amount of space. I'm going to keep mine for study.
Code:
localhost / # du -s /usr/src/*
0 /usr/src/linux
512032 /usr/src/linux-3.0.6
552100 /usr/src/linux-3.0.6-gentoo
1036176 /usr/src/linux-legacy
localhost / #
The directory linux-legacy is the GIT pull, as you can see it is double in size to the gentoo, linux-3.0.6-gentoo, and plain vanilla, linux-3.0.6.


Top
   
 Post subject:
PostPosted: Fri Nov 25, 2011 8:06 am 
Offline

Joined: Tue Nov 08, 2011 9:27 pm
Posts: 24
Location: Redwood Shores, CA & Napa, CA
I moved /usr/portage off to a USB memory Stick (16GB). After the move, here are the numbers:
Code:
localhost ~ # df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
rootfs 487680 161103 326577 34% /
/dev/root 487680 161103 326577 34% /
devtmpfs 58237 596 57641 2% /dev
rc-svcdir 58255 46 58209 1% /lib/rc/init.d
shm 58255 1 58254 1% /dev/shm
/dev/sdb1 1957888 149064 1808824 8% /mnt/king2
localhost ~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 7668336 2751340 4527456 38% /
/dev/root 7668336 2751340 4527456 38% /
devtmpfs 232948 116 232832 1% /dev
rc-svcdir 1024 40 984 4% /lib/rc/init.d
shm 233020 0 233020 0% /dev/shm
/dev/sdb1 30830548 1088836 28175612 4% /mnt/king2
localhost ~ #
The conclusion: Portage consume about 30% of the inode space on the Efika's 8 GB internal memory. 310,155 Used inodes before the move, 161,103 after the move. That's a difference of 149052 which represents 30.56% of the available inodes.

(And I erroneously had a 2nd Portage tree when I started to update my install, so I was starting off with 60% of my available memory being consumed by Portage.)


Top
   
 Post subject:
PostPosted: Fri Nov 25, 2011 2:43 pm 
Offline
Genesi

Joined: Mon Jan 30, 2006 2:28 am
Posts: 409
Location: Finland
Hi.

Keep in mind that 'git pull' pulls in a lot of data representing the changes made to all the files over the entire lifetime of the project. What you should do in your case is just remove the hidden .git directory in the linux-legacy directory which contains this data. Of course, from that point on, it's no longer a git repository.


Johan

_________________
Johan Dams, Genesi USA Inc.
Director, Software Engineering

Yep, I have a blog... PurpleAlienPlanet


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 15 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
PowerDeveloper.org: Copyright © 2004-2012, Genesi USA, Inc. The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
All other names and trademarks used are property of their respective owners. Privacy Policy
Powered by phpBB® Forum Software © phpBB Group