I have had this error a couple of times, and each time it took a while to figure out the problem.

Symptom

Guile, gnutls or some other package fails to find libunistring during the configure stage of emerge.

Sollution

Compile libunistring locally (belt and suspenders version):

FEATURES="-ditcc -distcc-pump" MAKEOPTS="-j1" emerge -j1 libunistring

The first thing to do if you have manifest errors, is to find out why! Do not blindly recreate your manifests.

After several syncs emerge kept complaining about missing digests for a huge amount of ebuilds on the system. I guess this shuold solve itself at some future sync, but in the meantime I couldn't merge anything because of the mising digest, so I digged around and crafted this command to rebuild all digests/manifests in the portage tree.

find /usr/portage -type d -exec sh -c 'find "{}" -maxdepth 1 -type f -name '*.ebuild'| sort | head -n 1| xargs -r -I --  sudo ebuild -- manifest' ";"

The command finds the first .ebuild file in every subdirectory of /usr/portage and runs sudo ebuld minifest on it.

...And why you shouldn't.

manifest files contain digest and file size of every source tarball that Gentoo uses to build your system. If every manifest is regenerated locally, maliciously changed source tarballs (and we just don not know for sure if there are any, do we) on you computer will get a valid manifest file, making it possible to install it.

I did not compile in netfilter in the cross compiled kernel I made in the previous post, so I had to recompile. Here is how to compile and install the kernel natively on the NAS.

Install mkimage.

The package u-boot-tools is needed to get the mkimage command to make an U-Boot kernel image.

emerge u-boot-tools

Compile the kernel.

Go to the sources and reconfigure them using menuconfig.

cd /usr/src/linux
make menuconfig

Compile kernel.

make zImage ox820-pogoplug-pro.dtb

Compile and install modules.

make modules
make modules_install

Create the kernel image.

cat arch/arm/boot/zImage arch/arm/boot/dts/ox820-pogoplug-pro.dtb > arch/arm/boot/zImage.fdt
scripts/mkuboot.sh -A arm -O linux -C none -T kernel -a 0x60008000 -e 0x60008000 -n 'Linux-3.11.1+' -d arch/arm/boot/zImage.fdt arch/arm/boot/uImage

Write the image to the disk.

Edit the disk_create script to change the target drive in the variable disk to /dev/sda.

Integrate the new kernel into WarheadsSE's tool.

cd /usr/src/disk_create
cp /usr/src/linux/arch/arm/boot/uImage uImages/gentoo

Write the image.

./disk_create

Done.

Happy hacking.

I was given a Medion MD86517 NAS without a drive for free. I wanted to put a 2.5" disk in it, and use it as a web-server. The NAS runs Linux, and the sources are here.

A large part of the installation was done on a regular Gentoo x86/x64 PC, using a SATA to USB converter. Start with a clean drive with no partitions, connected to the host computer (Not the NAS).

During the install, I have aimed to have all files needed for a new intall, located on the NAS drive itself, in the hopes that it will make a reinstall, easier. You can of course remove these files from /usr/src, if you do not want this.

Much of this stuff needs root permissions, and all the NAS side stuff is done through a serial connection. If something is unclear, read The Gentoo handbook, this is in essence the same procedure, except I boot into the system instead of chrooting.

A lot of thanks and credit to the people in this thread, without whom I would never have gotten on the right track.

Partitioning

To boot from the SATA disk, a special partition layout is needed. The ox820 reads the start of the drive, to check if it is bootable. A script has been written to put the right data in the first part of the hard disk. Download disk creation files created by WarheadsSE, extract the files somewhere, and enter that directory. Edit the disk_create script to change the target drive in the variable disk.

Creating the partitions

Prepare the disk using WarheadsSE's tool.

./disk_create

Fire up fdisk to partition the disk.

fdisk -c=dos /dev/sdb
  • Create a small partition for U-Boot, stage1, and the kernel. WarheadsSE recommends a 10M partition. This partition must start at sector 2048.

  • Create a second partition for the root file system, leave a little space left for a swap partition.

  • Create a third partition for swap space. Set it as swap type.

Format the second and third partition, I use ext4 as the root file system.

mkfs.ext4 /dev/sdb2
mkswap /dev/sdb3

Last, mount the second partition to /mnt/gentoo, your partition may have another designation than /dev/sdb.

cd /mnt
mkdir gentoo
mount /dev/sdb2 /mnt/gentoo

Root file system

Download a stage 3 Gentoo for ARM5, and extract it to /mnt/gentoo. Though the processor is ARM6 compatible, I could not get it to boot beyond the kernel using and ARM6 stage 3.

tar -xvjpf stage3-armv5tel-20140115.tar.bz2 -C /mnt/gentoo

Set the baud rate in /mnt/gentoo/etc/inittab to 115200. Change:

#s0:12345:respawn:/sbin/agetty -L 9600 ttyS0 vt100

to:

s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100

Copy resolv.conf from your host /etc directory, to have DNS working.

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf

Create a link from net.lo to net.eth0 to enable the network at first boot.

cd /mnt/gentoo/etc/init.d
ln -sf net.lo net.eth0

Edit /mnt/gentoo/etc/fstab to set the devices for the root and swap file system. The file should contain something like this:

#/dev/BOOT              /boot           ext2            noauto,noatime  1 2
/dev/sda2               /               ext4            noatime         0 1
/dev/sda3               none            swap            sw              0 0
#/dev/cdrom             /mnt/cdrom      auto            noauto,ro       0 0
#/dev/fd0               /mnt/floppy     auto            noauto          0 0

Copy passwd and shadow from the running system to have your logins and passwords when you boot the NAS.

cp /etc/passwd /mnt/gentoo/etc/passwd
cp /etc/shadow /mnt/gentoo/etc/shadow
cp /etc/group /mnt/gentoo/etc/group

Select mirrors for portage.

mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
mirrorselect -i -r -o >> /mnt/gentoo/etc/portage/make.conf

Set the timezone.

echo "Europe/Copenhagen" > /mnt/gentoo/etc/timezone

Set the hostanme.

nano -w /mnt/gentoo/etc/conf.d/hostname
nano -w /mnt/gentoo/etc/hosts

Set the keymap (just in case).

nano -w /mnt/gentoo/etc/conf.d/keymaps

Last edit and change UTC to local if needed.

nano -w /etc/conf.d/hwclock

Kernel

You will need an ARM cross-compiler, Gentoo's crossdev comes in handy.

crossdev -t armv5tel-softfloat-linux-gnueabi

Clone linux-oxnas into /mnt/gentoo/usr/src.

cd /mnt/gentoo/usr/src
git clone https://github.com/kref/linux-oxnas
ln -sf linux-oxnas linux

cd linux-oxnas
make ARCH=arm ox820_defconfig CROSS_COMPILE=armv5tel-softfloat-linux-gnueabi-
make ARCH=arm menuconfig CROSS_COMPILE=armv5tel-softfloat-linux-gnueabi-

Boot options --->
[*] Use appended device tree blob to zImage (EXPERIMENTAL)
[*] Supplement the appended DTB with traditional ATAG information
disable PCI support if you device does not have one

Remember to compile in support for the root file system type, if you did like me this means enabling the ext4 file system.

File system  --->
<*> The Extended 4 (ext 4) filesystem

Compile and create kernel image.

make ARCH=arm zImage ox820-pogoplug-pro.dtb CROSS_COMPILE=armv5tel-softfloat-linux-gnueabi-

cat arch/arm/boot/zImage arch/arm/boot/dts/ox820-pogoplug-pro.dtb > arch/arm/boot/zImage.fdt

scripts/mkuboot.sh -A arm -O linux -C none -T kernel -a 0x60008000 -e 0x60008000 -n 'Linux-3.11.1+' -d arch/arm/boot/zImage.fdt arch/arm/boot/uImage

Final disk creation

Copy WarheadsSE's disk creation files (contents of onax-sata-boot.tar.gz) to the /mnt/gentoo/usr/src.

mkdir /mnt/gentoo/usr/src/disk_create
cp -Rv (Where you unpacked the files)/* /mnt/gentoo/usr/src/disk_create

Integrate the new kernel into WarheadsSE's tool.

cd /mnt/gentoo/usr/src/disk_create
cp /mnt/gentoo/usr/src/linux-oxnas/arch/arm/boot/uImage uImages/gentoo
rm uImage
ln -sf uImages/gentoo uImage
./disk_create

Preparing for first boot

Unmount and sync the disk.

cd /
umount /mnt/gentoo
sync

Remove the drive from the host computer and physically install it in the NAS.

First Boot

Set the clock. MMDDhhmmCCYY is month, date, hour, minute, century, year

date MMDDhhmmCCYY

Get the portage tree.

emerge --sync

Set the Profile.

eselect profile list

I selected default/linux/arm/13.0/armv5te.

eselect profile set 18

Configure the locales, first put the locales you want supported in locale.gen.

nano -w /etc/locale.gen

Generate the locales and select the system-wide one.

locale-gen
eselect locale list
eselect locale set *locale nr.*
env-update && source /etc/profile

Add the network interface to the startup.

rc-update add net.eth0 default

Update and install some needed stuff.

emerge -uDNv world ntp cronie syslog-ng openssh logrotate dhcpcd

Add it to the startup.

rc-update add syslog-ng default
rc-update add cronie default
rc-update add sshd default
rc-update add ntp-client default
rc-update add swclock boot
rc-update del hwclock boot

The end

You now have a basic Gentoo system running, from here you can install a web server, a DLNA server, or whatever you want.

Energia IDE

I never really caught on to the Arduino craze, not because of any dislikes as such, but because I was familiar with Microchips PICMICRO range. I had the parts, the programmer, and the knowledge to program them in both asm and C, so I guess I have had no need for the Arduino platform.

It turns out that the Arduino IDE has been ported to both the Stellaris Launchpad, and the MSP430 Launchpad from Texas Instruments. and is called Energia. This is nice, since it is then quite easy to port the vast amount of sketches and libraries from the Arduino IDE to Energia IDE and the Texas Instruments Launchpads.

Getting it going on Gentoo Linux

First to run Energia, 32-bit java support is needed, so

app-emulation/emul-linux-x86-java

needs to be emerged. When running Energia you must make sure

emul-linux-x86-java-1.6

is selected as user VM with eselect. Create a file called /etc/udev/rules.d/62-stellarpad.rules with these contents:

ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0660", GROUP="plugdev"

Reload udev and add yourself to the "plugdev" group, plug-in in the Launchpad and you should be good to go!

On Gentoo I needed to point the configure script at libbfd.so. On my system it is in /usr/lib/binutils/x86\_64-pc-linux-gnu/2.22/ hence:

./configure --prefix=/usr/local/ --with-bfd=/usr/lib/binutils/x86\_64-pc-linux-gnu/2.22/

Generated on 2018-05-03 01:14:21.851770