New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Discuss development on Bubba
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Current files are:

package.use

Code: Select all

net-ftp/proftpd openssl

# allow openvpn to read passwords from a file
net-misc/openvpn passwordsave


# enable sasl in postfix
mail-mta/postfix dovecot-sasl

# required for Logitech Media Server
dev-lang/perl ithreads
dev-perl/Template-Toolkit gd

# various USE flags for php:
# - enable Apache mod_php
# - add dependencies for Roundcube
# - add dependencies for web calendar
# - add dependencies for phpmyadmin
# - replace gdbm support by qdbm
dev-lang/php apache2 cgi sockets sqlite mysql mysqli imap pdo iconv fileinfo ssl json xml intl exif odbc gd qdbm -gdbm
app-admin/eselect-php apache2
package.accept_keywords - this is a big one on account of LMS

Code: Select all

sys-kernel/gentoo-sources ~arm
net-wireless/hostapd **
net-misc/mediatomb ~arm
net-misc/minidlna ~arm
net-analyzer/hping ~arm


# required by vconfig (argument)
net-misc/vconfig ~arm


# Requirements for Domoticz home automation
app-misc/domoticz **


# Requirements for Cups print server
net-print/cups ~arm
net-print/cups-pdf ~arm
net-print/cups-filters ~arm
net-print/gutenprint ~arm
app-text/ghostscript-gpl ~arm


# Requirements for Apache 2.4
www-servers/apache ~arm
app-admin/apache-tools ~arm
dev-libs/apr ~arm


# Requirements for Logitech Media Server
media-sound/logitechmediaserver ~arm
dev-lang/nasm **
dev-perl/AppConfig ~arm
dev-perl/Audio-Scan **
dev-perl/AutoXS-Header **
dev-perl/B-Hooks-EndOfScope ~arm
dev-perl/Cache-Cache ~arm
dev-perl/Carp-Assert **
dev-perl/Class-Accessor ~arm
dev-perl/Class-Accessor-Chained **
dev-perl/Class-Accessor-Grouped **
dev-perl/Class-C3 **
dev-perl/Class-C3-Componentised **
dev-perl/Class-C3-XS **
dev-perl/Class-Data-Inheritable ~arm
dev-perl/Class-ISA **
dev-perl/Class-Method-Modifiers **
dev-perl/Class-Virtual **
dev-perl/Class-XSAccessor **
dev-perl/Clone ~arm
dev-perl/Config-Any ~arm
dev-perl/Context-Preserve **
dev-perl/DBIx-Class **
dev-perl/Data-Compare **
dev-perl/Data-Dump ~arm
dev-perl/Data-Dumper-Concise ~arm
dev-perl/Data-Page **
dev-perl/Data-URIEncode **
dev-perl/Data-UUID **
dev-perl/Devel-GlobalDestruction ~arm
dev-perl/EV **
dev-perl/Encode-Detect ~arm
dev-perl/File-Find-Rule ~arm
dev-perl/GD ~arm
dev-perl/GD-Graph3d ~arm
dev-perl/GDGraph ~arm
dev-perl/GDTextUtil ~arm
dev-perl/Hash-Merge **
dev-perl/IO-AIO **
dev-perl/IO-Interface **
dev-perl/IPC-ShareLite ~arm
dev-perl/Image-Scale **
dev-perl/Import-Into **
dev-perl/JSON-XS ~arm
dev-perl/Linux-Inotify2 **
dev-perl/Log-Log4perl ~arm
dev-perl/MRO-Compat ~arm
dev-perl/Math-Base36 **
dev-perl/Module-Find **
dev-perl/Moo **
dev-perl/Number-Compare ~arm
dev-perl/Path-Class ~arm
dev-perl/Role-Tiny **
dev-perl/SQL-Abstract **
dev-perl/Scalar-Properties **
dev-perl/Scope-Guard **
dev-perl/Template-GD ~arm
dev-perl/Template-Toolkit ~arm
dev-perl/Text-Glob ~arm
dev-perl/Tie-Cache-LRU **
dev-perl/Types-Serialiser ~arm
dev-perl/YAML-LibYAML **
dev-perl/common-sense ~arm
dev-perl/enum **
dev-perl/namespace-clean ~arm
dev-perl/strictures **
dev-perl/text-autoformat ~arm
dev-perl/text-reform ~arm
perl-core/ExtUtils-CBuilder ~arm
perl-core/ExtUtils-MakeMaker ~arm
perl-core/ExtUtils-Manifest1 ~arm
perl-core/IO **
perl-core/IPC-Cmd ~arm
perl-core/Module-CoreList ~arm
perl-core/version ~arm
make.conf

Code: Select all

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe -march=armv5te"
CXXFLAGS="${CFLAGS}"

# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="armv5tel-softfloat-linux-gnueabi"

# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
USE="bindist"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"

# allow parallel make and emerge
MAKEOPTS="-j8 -l1"
# show what's happening during build
EMERGE_DEFAULT_OPTS="--load-average=1 --quiet-build=n"

# Only free software, please.
ACCEPT_LICENSE="-* @FREE"

# Use the 'stable' branch
ACCEPT_KEYWORDS="arm"

# use local gentoo mirrors
GENTOO_MIRRORS="rsync://mirror.leaseweb.com/gentoo/ http://gentoo.tiscali.nl/ rsync://ftp.snt.utwente.nl/gentoo"
# do not sync games, gdm's and other non interesting stuff
RSYNC_EXCLUDEFROM=/etc/portage/rsync_excludes
# don't build lots of stuff for other languages
LINGUAS="en en_US"
FEATURES="distcc buildpkg -userpriv -usersandbox"

IMAGEUSE="jpeg gif png"
PRINTUSE="cups foomatic-db freeprint"
# I don't have Mac
NOTUSE="-avahi"

USE="${USE} ${IMAGEUSE} ${PRINTUSE} ${NOTUSE}"

APACHE2_MODULES="${APACHE2_MODULES} proxy proxy_fcgi proxy_http remoteip access_compat"
APACHE2_MPMS="prefork"

# Layman entries
source /var/lib/layman/make.conf
rsync_excludes (file referenced in make.conf)

Code: Select all

/games-*/
/dev-games/
/gnustep-*/
/kde-*/
/gnome-*/
/sci-astronomy/
/sci-biology/
/sci-calculators/
/sci-chemistry/
/sci-electronics/
/sci-misc/
/sci-physics/
/sci-visualization/
/xfce-*/
world - needs cleaning up

Code: Select all

app-admin/logrotate
app-admin/sudo
app-admin/syslog-ng
app-misc/domoticz
app-misc/screen
app-portage/eix
app-portage/euses
app-portage/gentoolkit
app-portage/layman
app-portage/mirrorselect
app-text/ghostscript-gpl
dev-db/mariadb
dev-embedded/libftdi
dev-embedded/u-boot-tools
dev-lang/php
dev-libs/boost
dev-libs/libusb
dev-php/PEAR-Auth_SASL
dev-php/PEAR-Crypt_GPG
dev-php/PEAR-MDB2
dev-php/PEAR-Mail_Mime
dev-php/PEAR-Net_IDNA2
dev-php/PEAR-Net_SMTP
dev-php/PEAR-Net_Sieve
dev-php/pear
mail-mta/postfix
media-sound/logitechmediaserver
net-analyzer/tcpdump
net-dns/avahi
net-dns/dnsmasq
net-firewall/iptables
net-fs/samba
net-ftp/proftpd
net-mail/dovecot
net-misc/bridge-utils
net-misc/dhcpcd
net-misc/mediatomb
net-misc/minidlna
net-misc/netifrc
net-misc/openvpn
net-misc/vconfig
net-print/cups
net-print/cups-pdf
net-wireless/hostapd
net-wireless/iw
net-wireless/wireless-tools
sys-apps/iproute2
sys-apps/mlocate
sys-apps/pciutils
sys-devel/distcc
sys-fs/dosfstools
sys-libs/e2fsprogs-libs
sys-process/cronie
sys-process/lsof
www-servers/apache
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Hmmmm....

Code: Select all

babaorum ~ # cat /proc/mtd
dev:    size   erasesize  name
babaorum ~ #
Is this because of the kernel wrapper?
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by sakaki »

I think the issue is that since the live-USB kernel is unpatched (other than the caches/dtb post-processing of course), the file arch/arm/mach-kirkwood/bubba3-setup.c (from this patch) isn't present in the build, which is how the kernel gets told about the flash layout on a standard B3. However, the data for these three partitions is in the device tree blob (see section spi@10600), so should be visible. It's probably a missing kernel configuration option. I'll have a poke around - hopefully it'll be corrected in the 1.3.0 release.
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Would be nice to get this working, because as far as I can tell the mtd partitions are what you need to power down the B3. It would also be nice to have the button on the rear working as I found out today. I actually managed to shut myself out multiple times today trying to reconfigure my (rather complex) network and the only way to shut down turned out to be to pull the cord on it. Not in the least gracious at all.
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Found it!

Two things wrong here:
  1. You're missing a kernel config option. In fact when comparing the selections with those from the bubba-kernel this option did not even show in menuconfig. It only appeared after I enabled another option. I enabled the following options (in order):

    Code: Select all

    CONFIG_SPI_ORION
    CONFIG_MTD_SPI_NOR
    CONFIG_MTD_M25P80
    
  2. The kirkwood-b3 dtb source contains an error:
    In 'spi@10600' the flash chip is indicated as being compatible with "st,m25p16". This needs to be "st,m25p80" (see the corresponding kernel config entry)
Also, in the dtb source in gpio-leds the programming_led entry contains a default-state property with the value "off". As it turns out this is in fact the default value already. I therefore added this property to the red and blue led entries and gave it the value of "on". Now the B3 boots with purple led on, just like the original bubba kernel.

Code: Select all

babaorum ~ # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000c0000 00010000 "u-boot"
mtd1: 00020000 00010000 "u-boot env"
mtd2: 00120000 00010000 "data"
babaorum ~ 
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by sakaki »

Thanks! CONFIG_MTD_M25P80 should definitely be set. Can you confirm that it doesn't work without the change to the kirkwood-b3.dts (i.e., if you only change the config)? If so, I guess a patch should be sumitted upstream...
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

It does not work without the change to the dts

Code snippet, original:

Code: Select all

                spi@10600 {
                        status = "okay";

                        m25p16@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "st,m25p16";
                                reg = <0>;
                                spi-max-frequency = <40000000>;
                                mode = <0>;
...and changed:

Code: Select all

                spi@10600 {
                        status = "okay";

                        m25p80@0 {
                                #address-cells = <1>;
                                #size-cells = <1>;
                                compatible = "st,m25p80";
                                reg = <0>;
                                spi-max-frequency = <40000000>;
                                mode = <0>;
I've also just added bubba-buttond to my bubba-overlay on git, giving you the write-magic application for manual shutdown and the buttond daemon that allows shutting down the B3 with the power button on the rear.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by sakaki »

OK, thanks for double-checking. Would you mind submitting the dts change upstream when you get a chance?

I'll make sure the modified kernel config (and a temporary fix for the dts) is in the 1.3.0; also, I'll put your buttond ebuild in there too.

best, sakaki
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Okay.

Submitted and response received. Too late for current merge (3.19?) apparently but should show up in the next one.

For your convenience:

0001-Fix-unavailable-MTD-userland-devices-on-Excito-B3.patch

Code: Select all

---
Deleted - m25p80 driver now recognizes m25p16 device
--- 
0002-Fix-bootled-on-Excito-B3-boards.patch

Code: Select all

---
 arch/arm/boot/dts/kirkwood-b3.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/kirkwood-b3.dts b/arch/arm/boot/dts/kirkwood-b3.dts
index c9247f8..f24e4fe 100644
--- a/arch/arm/boot/dts/kirkwood-b3.dts
+++ b/arch/arm/boot/dts/kirkwood-b3.dts
@@ -141,11 +141,13 @@
 		error_led {
 			label = "bubba3:red:error";
 			gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
 		};
 
 		active_led {
 			label = "bubba3:blue:active";
 			gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
 		};
 	};
 
-- 
Optional: 0003-Create-Excito-B3-rescue-kernel.patch

Code: Select all

---
 arch/arm/boot/dts/kirkwood-b3.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/kirkwood-b3.dts b/arch/arm/boot/dts/kirkwood-b3.dts
index f24e4fe..56ea550 100644
--- a/arch/arm/boot/dts/kirkwood-b3.dts
+++ b/arch/arm/boot/dts/kirkwood-b3.dts
@@ -135,19 +135,19 @@
 		programming_led {
 			label = "bubba3:green:programming";
 			gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
-			default-state = "off";
+			default-state = "on";
 		};
 
 		error_led {
 			label = "bubba3:red:error";
 			gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
+			default-state = "off";
 		};
 
 		active_led {
 			label = "bubba3:blue:active";
 			gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
+			default-state = "off";
 		};
 	};
 
-- 
This will set the LED color to green as the kernel starts. Should not be used for regular operation, but for USB boot only.
Last edited by Gordon on 08 Feb 2015, 05:41, edited 1 time in total.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by sakaki »

Great, thanks for doing that. As your patches will (hopefully) make it into the mainline eventually, I'll not create a custom ebuild for the kernel, as I did with the B2, but just apply them via the kernel build script for now (and retain the standard gentoo-sources).
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Gentoo live USB updated (Linux 3.17.1, shellshock fix)

Post by Gordon »

Skip the 0001 patch for the next kernel.

Having upgraded my kernel to 3.18.5 it now complains in dmesg that it found m25p16 instead of m25p80. Reversing the patch now also allows access to mtd where it didn't on the 3.17.1 kernel. No clue what changed. I used the same kernel config from /proc, accepting most of the default choices for 'make oldconfig'. :?
Post Reply