Debian 9 (Stretch) on the CI20

457 views
Skip to first unread message

pa...@boddie.org.uk

unread,
Jul 10, 2017, 9:05:14 AM7/10/17
to MIPS Creator CI20
Hello,

I just got myself a CI20 for various purposes, but one thing I've been needing to set up is a kernel and distribution that supports my monitor, which is neither HDMI-capable (it has a DVI input) nor HD/1080p-capable. The default system installed, even on the V2a boards, seems to be the 3.0.8 kernel with Debian 7 (Wheezy), but that employs the compiled-in kernel setting that chooses a fixed HD/1080p display resolution.

So, I set about trying to rebuild the 3.0.8 kernel, just to try and keep things easy, but it turns out that kernels this old do not get along with gcc 6, which is the available cross-compiler in my Debian development environment. Fortunately, the 3.18 kernel for the CI20 does build without significant issues. I also built the CI20-specific U-Boot which also had the same compiler version problem (U-Boot borrows header files from Linux), but unlike the kernel, copying the more recent compiler-gcc.h file from the 3.18 kernel distribution over the file of the same name in U-Boot got me a built and working U-Boot. (It looks like more work is needed to get the CI20 supported in a recent U-Boot.)

Anyway, this left me with the task of making a root filesystem. Now, I did follow the instructions in the CI20 "DevZone"...

http://www.elinux.org/How_to_make_a_debian_rootfs_for_MIPS_CI20

...but the minimal debootstrap method doesn't provide the necessary extra packages for a graphical system. And attempts to apt-get extra packages within the qemu-enabled chroot all failed because apt-get cannot resolve or reach the servers. Maybe this occurred because I'm performing a chroot from another chroot (my development environment), but no workarounds seemed to deal with the problem. It must be noted that the generated minimal root filesystem did work, however.

Previously, I've done bootstrapping with multistrap, and guidance in various Debian resources seems to indicate that early customisation of root filesystems is not really handled by debootstrap and that multistrap is the answer. Here is a document describing my previous multistrap work:

http://en.qi-hardware.com/wiki/Emdebian

I tried multistrap with a Debian 8 (Jessie) configuration and encountered some difficulties with the base-files package that I haven't seen before. It seems like there is some kind of transition from /var/run to /run in Jessie that some packages have not yet made, and I suppose that some of these packages are not ones that I've tried to install on the Ben NanoNote. Consequently, base-files' postinst script fails because /var/run is not empty. There is a patch which fixes this, but it appears to have been left out of the packaging:

https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/874505

Other package configuration problems seem to involve cgmanager. One thing that I've previously seen cause problems is unmet systemd requirements on the kernel configuration, but maybe that isn't the problem here. However, the generated root filesystem would eventually show a console login prompt, but I didn't look into the outstanding package configuration problems because I suspected that they too were artefacts of some transition that would hopefully be complete in the next distribution version.

So, given that Debian 9 (Stretch) is now released, I decided to give this a try with multistrap. Despite the base-files package still having the same postinst file, it appears that it is no longer disrupted by the state of other packages, and I managed to get the packages configured and the root filesystem to yield a console login again. Expanding the pre-installed packages to include those listed in the "DevZone" article...

xfce4 lightdm wicd iceweasel pulseaudio bluez

...I found that this wasn't enough to install an X server, so I also had to add the xorg package as well. (My configuration also includes other packages that are required for the configuration process.) This did eventually yield a graphical login prompt.

All of the above is mostly me documenting the things that did and didn't work, but my question now is this: what packages should one usefully install to get a working graphical environment on the CI20 with Debian 9? What other measures are required for the system to be set up correctly? Is anyone actually using Debian 9 on the CI20?

Paul

James Cowgill

unread,
Jul 10, 2017, 10:07:19 AM7/10/17
to pa...@boddie.org.uk, MIPS Creator CI20
Hi,

On 10/07/17 14:05, pa...@boddie.org.uk wrote:
> Hello,
>
> I just got myself a CI20 for various purposes, but one thing I've been
> needing to set up is a kernel and distribution that supports my monitor,
> which is neither HDMI-capable (it has a DVI input) nor HD/1080p-capable.
> The default system installed, even on the V2a boards, seems to be the
> 3.0.8 kernel with Debian 7 (Wheezy), but that employs the compiled-in
> kernel setting that chooses a fixed HD/1080p display resolution.
>
> So, I set about trying to rebuild the 3.0.8 kernel, just to try and keep
> things easy, but it turns out that kernels this old do not get along
> with gcc 6, which is the available cross-compiler in my Debian
> development environment. Fortunately, the 3.18 kernel for the CI20 does
> build without significant issues. I also built the CI20-specific U-Boot
> which also had the same compiler version problem (U-Boot borrows header
> files from Linux), but unlike the kernel, copying the more recent
> compiler-gcc.h file from the 3.18 kernel distribution over the file of
> the same name in U-Boot got me a built and working U-Boot. (It looks
> like more work is needed to get the CI20 supported in a recent U-Boot.)

Sidenote: Debian Stretch for MIPS absolutely requires a >= 3.2 kernel.
glibc will refuse to run anything if you have a kernel older than this.

> Anyway, this left me with the task of making a root filesystem. Now, I
> did follow the instructions in the CI20 "DevZone"...
>
> http://www.elinux.org/How_to_make_a_debian_rootfs_for_MIPS_CI20
>
> ...but the minimal debootstrap method doesn't provide the necessary
> extra packages for a graphical system. And attempts to apt-get extra
> packages within the qemu-enabled chroot all failed because apt-get
> cannot resolve or reach the servers. Maybe this occurred because I'm
> performing a chroot from another chroot (my development environment),
> but no workarounds seemed to deal with the problem. It must be noted
> that the generated minimal root filesystem did work, however.

This is usually caused by having no dns configuration in the chroot. Try
copying /etc/resolv.conf from the host. Also, the --include option to
debootstrap can be used to preinstall extra packages.

[...]

> So, given that Debian 9 (Stretch) is now released, I decided to give
> this a try with multistrap. Despite the base-files package still having
> the same postinst file, it appears that it is no longer disrupted by the
> state of other packages, and I managed to get the packages configured
> and the root filesystem to yield a console login again. Expanding the
> pre-installed packages to include those listed in the "DevZone" article...
>
> xfce4 lightdm wicd iceweasel pulseaudio bluez
>
>
> ...I found that this wasn't enough to install an X server, so I also had
> to add the xorg package as well. (My configuration also includes other
> packages that are required for the configuration process.) This did
> eventually yield a graphical login prompt.
>
> All of the above is mostly me documenting the things that did and didn't
> work, but my question now is this: what packages should one usefully
> install to get a working graphical environment on the CI20 with Debian
> 9?

Installing the "task-xfce-desktop" package should be enough to get a
working desktop. The "task-XXX-desktop" packages correspond to the
options you can select in the standard Debian installer images.

> What other measures are required for the system to be set up correctly?

There are the usual configuration steps when installing any Linux distro
manually:

- Package repositories
- Timezone
- Locales / keyboard config
- Users / passwords
- Network
- Fstab

For the CI20 there's some extra firmware to install and you need to
setup SGX if you want graphic acceleration (although I expect SGX will
not work with Debian Stretch's version of Xorg).

> Is anyone actually using Debian 9 on the CI20?

I am, but not as a desktop (headless only).

James

signature.asc

Paul Boddie

unread,
Jul 10, 2017, 10:30:37 AM7/10/17
to mips-cre...@googlegroups.com, James Cowgill
On Monday 10. July 2017 16.07.11 James Cowgill wrote:
>

[3.0.8 and 3.18 kernels]

> Sidenote: Debian Stretch for MIPS absolutely requires a >= 3.2 kernel.
> glibc will refuse to run anything if you have a kernel older than this.

Yes, the 3.18 kernel works just fine. I was only interested in using the 3.0.8
kernel with Wheezy, but it became apparent that rebuilding that kernel was
more trouble than it was worth.

[Non-functioning networking within the chroot (inside another chroot)]

> This is usually caused by having no dns configuration in the chroot. Try
> copying /etc/resolv.conf from the host. Also, the --include option to
> debootstrap can be used to preinstall extra packages.

I think the mkdebianrfs.sh script copies /etc/resolv.conf into the chroot, but
using that or the suggested Google DNS configuration didn't help.

On the topic of installing extra packages, I found that specifying --include
did get the indicated packages downloaded but not necessarily installed. Maybe
I needed to figure out all the dependencies myself, though. I then tried to
use...

apt-get --no-download install xorg

...given the presence of xorg in the --include list and the .deb file in
/var/cache/apt/archives, but apt-get decided that it couldn't install xorg for
some reason. (Using dpkg would obviously involve all the usual chasing down of
dependencies.) I guess it just isn't possible to have apt-get operate using
only cached package files, or maybe I did something wrong that I'm not aware
of.

I imagine that it is in this area that multistrap comes into its own, being
able to work out which packages it needs to install. I'm performing the
second-stage work on the CI20 using what might be described as a "preinit"
hook, and this works in general. The qemu approach is interesting, though.

[...]

> Installing the "task-xfce-desktop" package should be enough to get a
> working desktop. The "task-XXX-desktop" packages correspond to the
> options you can select in the standard Debian installer images.

OK, I'll look into that.

[...]

> There are the usual configuration steps when installing any Linux distro
> manually:
>
> - Package repositories
> - Timezone
> - Locales / keyboard config
> - Users / passwords
> - Network
> - Fstab

So, my helper scripts do set up most of these things, although I imagine that
I could do things like setting the time and handling locales a bit better. I
did look at debian-installer-related things, but it doesn't seem very clear to
me what I would actually need to look at.

> For the CI20 there's some extra firmware to install and you need to
> setup SGX if you want graphic acceleration (although I expect SGX will
> not work with Debian Stretch's version of Xorg).

Fortunately, I'm not interested in the PowerVR stuff. I guess the only other
significant firmware to install is the WLAN blob, but that's not a priority
for me, either. It's great that the device has an Ethernet port, in my
opinion.

> > Is anyone actually using Debian 9 on the CI20?
>
> I am, but not as a desktop (headless only).

That's useful to know. Thanks for all the advice!

Paul

Mathieu Malaterre

unread,
Jul 10, 2017, 1:20:06 PM7/10/17
to MIPS Creator CI20, pa...@boddie.org.uk, jcow...@debian.org
Hi James,
Which kernel are you running ? Is it one from Debian buildds ?

Thanks 

James Cowgill

unread,
Jul 10, 2017, 4:42:16 PM7/10/17
to Mathieu Malaterre, MIPS Creator CI20, pa...@boddie.org.uk
Hi,

On 10/07/17 18:20, Mathieu Malaterre wrote:
> Hi James,
>
> On Monday, July 10, 2017 at 4:07:19 PM UTC+2, James Cowgill wrote:
> On 10/07/17 14:05, pa...@boddie.org.uk <javascript:> wrote:
> > Is anyone actually using Debian 9 on the CI20?
>
> I am, but not as a desktop (headless only).
>
> James
>
> Which kernel are you running ? Is it one from Debian buildds ?

It isn't - Debian doesn't build a kernel which would work on the CI20. I
build my own kernel based on the 3.18 branch on GitHub, with a recent
3.18 stable tag merged into it.

James

signature.asc

wzs...@gmail.com

unread,
Jan 11, 2018, 9:21:45 PM1/11/18
to MIPS Creator CI20
Is CI20's kernel support upstreamed?
By search in Linus's git tree, it seems yes.

I will have a try to add kernel support to it in Sid/experimental.

Mathieu Malaterre

unread,
Jan 12, 2018, 1:52:54 AM1/12/18
to MIPS Creator CI20
Hi,

Just for reference, while most of the private vendor CI20 branch could be upstream'ed it is not the case as of today. One can boot a vanilla kernel on a CI20 but this is nowhere near as complete as the private vendor ones. The Debian userland is 100% compatible AFAIK, so if you have time to invest I would suggest you work on upstreaming more CI20 kernel drivers...

2cts

YunQiang Su

unread,
Jan 16, 2018, 7:50:43 AM1/16/18
to Mathieu Malaterre, MIPS Creator CI20
On Fri, Jan 12, 2018 at 2:52 PM, Mathieu Malaterre
<mathieu....@gmail.com> wrote:
> Hi,
>
> Just for reference, while most of the private vendor CI20 branch could be
> upstream'ed it is not the case as of today. One can boot a vanilla kernel on
> a CI20 but this is nowhere near as complete as the private vendor ones. The
> Debian userland is 100% compatible AFAIK, so if you have time to invest I
> would suggest you work on upstreaming more CI20 kernel drivers...
>

I am trying to add a ci20 flavor for Debian's `linux' package.
While I meet a problem that the /boot partition is not big enough.

Uboot reports that this partition (ubi0:boot) is 64MiB,
while in Linux, `df' reports 19MiB.

Any idea?

> 2cts
>
> On Friday, January 12, 2018 at 3:21:45 AM UTC+1, wzs...@gmail.com wrote:
>>
>> Is CI20's kernel support upstreamed?
>> By search in Linus's git tree, it seems yes.
>>
>> I will have a try to add kernel support to it in Sid/experimental.
>>
>> On Tuesday, July 11, 2017 at 4:42:16 AM UTC+8, James Cowgill wrote:
>>>
>>> Hi,
>>>
>>> On 10/07/17 18:20, Mathieu Malaterre wrote:
>>> > Hi James,
>>> >
>>> > On Monday, July 10, 2017 at 4:07:19 PM UTC+2, James Cowgill wrote:
>>> > On 10/07/17 14:05, pa...@boddie.org.uk <javascript:> wrote:
>>> > > Is anyone actually using Debian 9 on the CI20?
>>> >
>>> > I am, but not as a desktop (headless only).
>>> >
>>> > James
>>> >
>>> > Which kernel are you running ? Is it one from Debian buildds ?
>>>
>>> It isn't - Debian doesn't build a kernel which would work on the CI20. I
>>> build my own kernel based on the 3.18 branch on GitHub, with a recent
>>> 3.18 stable tag merged into it.
>>>
>>> James
>>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "MIPS Creator CI20" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/mips-creator-ci20/F0CWLtzGtm0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> mips-creator-c...@googlegroups.com.
> To post to this group, send email to mips-cre...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/mips-creator-ci20/8d9f6ec4-9827-42b5-91c6-aa0708ac1eb4%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
YunQiang Su

Mathieu Malaterre

unread,
Jan 17, 2018, 2:41:27 AM1/17/18
to YunQiang Su, matt.r...@mips.com, MIPS Creator CI20
On Tue, Jan 16, 2018 at 1:50 PM, YunQiang Su <wzs...@gmail.com> wrote:
> On Fri, Jan 12, 2018 at 2:52 PM, Mathieu Malaterre
> <mathieu....@gmail.com> wrote:
>> Hi,
>>
>> Just for reference, while most of the private vendor CI20 branch could be
>> upstream'ed it is not the case as of today. One can boot a vanilla kernel on
>> a CI20 but this is nowhere near as complete as the private vendor ones. The
>> Debian userland is 100% compatible AFAIK, so if you have time to invest I
>> would suggest you work on upstreaming more CI20 kernel drivers...
>>
>
> I am trying to add a ci20 flavor for Debian's `linux' package.
> While I meet a problem that the /boot partition is not big enough.
>
> Uboot reports that this partition (ubi0:boot) is 64MiB,
> while in Linux, `df' reports 19MiB.

No idea why this is setup this way:

https://github.com/MIPS/CI20_u-boot/blob/ci20-v2013.10/include/configs/ci20.h#L173

#define MTDPARTS_DEFAULT
"mtdparts=nand:8m(uboot-spl),2m(uboot),2m(uboot-env),64m(boot),-(system)"

with last commit:

https://github.com/MIPS/CI20_u-boot/commit/f58cce3658

while:

$ df -h /boot/
Filesystem Size Used Avail Use% Mounted on
ubi0:boot 19M 9.4M 9.4M 51% /boot

Mathieu Malaterre

unread,
Feb 3, 2018, 2:31:37 PM2/3/18
to YunQiang Su, Matt Redfearn, MIPS Creator CI20
May be an actual good time to start building a kernel for CI20 since
the official image have now disapear:

$ HEAD http://mipscreator.mips.com/CI20/images/default_NAND/Debian8_20160602/nand_2016_06_02.img
500 Can't connect to mipscreator.mips.com:80
Content-Type: text/plain
Client-Date: Sat, 03 Feb 2018 19:30:52 GMT
Client-Warning: Internal response


--
Mathieu
Reply all
Reply to author
Forward
0 new messages