Welcome! Log In Create A New Profile

Advanced

Debian Installer

Posted by Jeff 
Debian Installer
July 24, 2012 11:43AM
I've created a Debian install script for the A10 devices. If you've used the kirkwood installers, this will seem very familiar.

Manual installation
You must boot into the A10 Rescue System before running the installer.

You'll need to setup partitions on your SD card before running the script. Partion 1 is reserved for the sysconfig, so create a partition 2 as ext (at least 400M) and partition 3 as swap (265M). You may need to reboot for the kernel to re-read the partition tables.

cd /tmp
wget http://projects.doozan.com/debian/sun4i.debian-wheezy.sh
chmod +x sun4i.debian-wheezy.sh
./sun4i.debian-wheezy.sh

Automatic installation

If you're feeling brave, you can use the autorun scripts and let the rescue system partition your SD card and install Debian automatically. As with the manual installation, you'll need an SD card with the Rescue System installed. You should test that the Rescue System works with your device before trying to automate the Debian installation. I've done this on my A2000 and it works just fine.

Download init-partition-mmc.sh and autorun-install-debian.sh and copy them to the /rescue directory on your SD card. When the rescue system boots, it will automatically create an ext partition with the maximum available size plus a 128M swap partition. After that, it will format the ext partition, install Debian and reboot into your new Debian installation.

If you want to customize the Debian installation, you can include debian-installer.config and specify the packages you'd like installed on the CONFIG_PACKAGES line. You can add any filesystem (configs, etc) customizations to the config_postinstall function inside the config file. The config file is sourced into the installer, so you have full access to any of the installer functions and, if you're very careful and know exactly what you're doing, you can also override the installer variable definitions.



Edited 3 time(s). Last edit at 08/26/2012 06:02PM by Jeff.
Building the Debian Kernel
July 24, 2012 11:58AM
Here's how I built the Debian kernel used by this installer:

cd ~/src
git clone https://github.com/amery/linux-allwinner.git
cd linux-allwinner
git checkout sunxi-v3.0.36-r1
wget https://raw.github.com/doozan/Kernel/master/config-3.0.36-sun4i-1.1
cp config-3.0.36-sun4i-1.1 .config
DEB_HOST_ARCH=armhf make-kpkg --rootcmd fakeroot --arch arm  --cross-compile arm-linux-gnueabi- --append-to-version=-sun4i --revision=1.1 --initrd kernel_image

The config is identical to gnexus' config-3.0.36+-1.a10linux.sun4i with the exception that I compiled .config support into the kernel.



Edited 3 time(s). Last edit at 07/30/2012 11:08AM by Jeff.
J. Carlos
Re: Debian Installer
July 24, 2012 03:35PM
When building the debian kernel, there are two swapped commands: you must "cd linux-allwinner" before "git checkout sunxi-v3.0.36-r1"

Cheers.
Re: Debian Installer
July 25, 2012 08:42AM
APT::Install-Recommends 0;
APT::Install-Suggests 0;
Good for non-gui rootfs install. Very bad for a GUI install.

I just spent two hours trying to fix LXDE on Wheezy where the above apt.conf screwed it all up almost to the point where
a reformat was needed to fix it.

I tried to put the above config in the Wheezy rootfs because the basic LXDE rootfs was too bloated with all the Gnome stuff.
It does make the image 50% smaller. But it's just not worth the pain involved. SD cards are cheap at like $5-$10. People's time and frustration is not. Now I have to pull the Wheezy LXDE rootfs and remove the above config from the apt.conf. before people try to kill me.

If I was an end user, and somebody stuck the above in my apt.conf, and made my Debian life miserable from then on, I would be quite upset.
Re: Building the Debian Kernel
July 26, 2012 01:04PM
The installer has been updated to load the appropriate modules depending on whether or not your device has an ethernet port. I also adjusted the apt configuration per gnexus' suggestion.

-- Jeff
Re: Building the Debian Kernel
July 26, 2012 03:33PM
Quote

I also adjusted the apt configuration per gnexus' suggestion.

This Debian thread has some good comments on --no-install-recommends:
http://forums.debian.net/viewtopic.php?f=20&t=62393

--no-install-recommends can be extremely helpful on a non-gui system. Especially something like a Dockstar with limited space on the flash. But when you get to a big GUI desktop it can be a major nightmare. I would rather forget the Wheezy experience I just had using it ;(

The "recommends" thing is one reason I still prefer Fedora on my x86 systems. There is no such option there. You either get it all or nothing. But Fedora lives on the bleeding edge. They like to change and break things on every release. They don't support the yum version upgrades I do. By the 6 mos. the issues with the upgrade are fixed it is time for a new release.
Re: Debian Installer
August 03, 2012 11:00PM
I've updated the installer to include a very simple GUI by default and added better customization through the debian-installer.config file.
Re: Debian Installer
August 28, 2012 12:54AM
Hi Jeff,

thanks a lot for your great work! I have tested the auto-install scripts and it works well. Except for one minor bug.

"/usr/sbin/debootstrap --verbose --no-check-gpg ...." does not work on "--no-check-pgp" option, i have to change it to "--no-check-certificate" to make it work.

Cheers!
Re: Debian Installer now with x11 mali
August 29, 2012 12:18PM
Just a quick update to make x11 use the mali drivers. This is still missing most hardware acceleration, so don't expect to see any performance increase. I've also bumped the kernel to 3.0.39, with the fbcon module installed. It crashes on my system whenever I try to load it with modprobe, but I left it in there because I suspect it could just be a problem with having to load modules in the correct order.

The secret sauce comes from Tom Cubie's mali_opengl_hf_lib package. It's built with the closed-source DDK, so all we have available are the binary blobs.

The xfree86-video-mali-r2p4-02rel1 drivers were compiled on my a2000 with the following commands (starting from a fresh Debian install)
apt-get install make gcc libdrm-dev xorg-dev

cd /usr/src

wget --no-check-certificate https://dl.dropbox.com/u/65312725/mali_opengl_hf_lib.tgz
tar -xzvf mali_opengl_hf_lib.tgz
cp mali_opengl_hf_lib/* /usr/lib/

wget http://www.malideveloper.com/files/DX910-SW-99006-r2p4-02rel1.tgz
wget http://www.malideveloper.com/files/DX910-SW-99003-r2p4-02rel1.tgz

tar -xzvf DX910-SW-99006-r2p4-02rel1.tgz
tar -xzvf DX910-SW-99003-r2p4-02rel1.tgz
cd DX910-SW-99003-r2p4-02rel1/x11/xf86-video-mali-0.0.1/

chmod +x configure
CFLAGS="-O3 -Wall -W -Wextra -I/usr/include/libdrm -I/usr/src/DX910-SW-99006-r2p4-02rel1/driver/src/ump/include" LDFLAGS="-L/usr/lib -lMali -lUMP -lpthread" ./configure --prefix=/usr --x-includes=/usr/include --x-libraries=/usr/lib
make
make install

The kernel was cross-compiled with the following commands
cd ~/src
git clone https://github.com/amery/linux-allwinner.git
cd linux-allwinner
git checkout 3ca6f758e9
wget https://raw.github.com/doozan/Kernel/master/config-3.0.39-sun4i-1.0
cp config-3.0.39-sun4i-1.0 .config
DEB_HOST_ARCH=armhf make-kpkg --rootcmd fakeroot --arch arm  --cross-compile arm-linux-gnueabi- --append-to-version=-sun4i --revision=1.0 --initrd kernel_image kernel_headers
Re: Debian Installer now with x11 mali
October 29, 2012 08:27AM
Since uboot for SD card is not reliable for all devices we need the script to be adopted to install the uboot to NAND instead.
matthieu
Re: Debian Installer
November 12, 2012 05:29PM
Hi

I am a new owner of a Mele A1000. A quick search on the net told me that the easiest way
to install debian on the Mele was with your rescue disk and script, and it worked well, thank you very much!

There are a few glitches however:

- While on the rescue disk, the console output worked fine, it does not any more when debian is installed.
I only have a VGA display; so I added a call to a10_display to /etc/rc.local; it seems to work because my monitor led went from orange to blue, but still nothing is displayed. It may be because X was launched

- There is a problem while fetching Tom Cubie's mali_opengl_hf_lib.tgz (the dropbox bandwith was exceeded). A workaround is to remove the xorg.conf file (I think it must then use the vesa driver), but it does not work very well at high resolutions. I think I found a duplicate here: http://www.android.hightech-solutions.biz/es/download.php?id=5091A1E81, and when manually redoing this part of the install I seem to be able to use the mali driver (using the xorg.conf file created by the script), but I cannot change the resolution.

Any ideas? I am going to investigate a bit more.

- I still don't know how I could use the rescue partition if I messed with my debian. Which can easily happen, especially because I do not have access to a local console...

Anyway, thank you very much for your script, I was a real help!
All the best
Matthieu
matthieu
Re: Debian Installer
November 12, 2012 06:31PM
Replying to myself : to boot in the rescue partition, it suffices to put a file named "force_rescue.txt" in the /rescue directory in the FAT partition. Clever.

To change the display options, if I understood right it suffices to change the system.bin file in the FAT directory,using fex2bin, with the new parameters.
matthieu
Re: Debian Installer
November 14, 2012 06:10PM
Hi,

I found a problem which may be specific to the debian installation; I did not find other people suffering from the problem.
So to change the resolution (I only have a VGA display), I changed the system.fex file in the FAT partition, with the right parameters (screen0_output_type=4, screen0_output_mode=0), and rebooted. I has an effect: whenever I change the bin file with a different mode, and launch xrandr, it tells me that I am in that mode. But I can see (and my monitor confirms) that I am still in 1024x768 mode; with (depending on the resolution) either the displayed image being too large, or too small, for the screen.

Anyone already had this problem?
Thank you
Matthieu
matthieu
Re: Debian Installer
November 14, 2012 06:41PM
Me again...

I found my problem: it was because I added a call to a10_display in my rc.local.

The bottom line is: once your debian system is installed, you should not try to setup the display using a10_display, but do it only by recompiling the fex file. Else you will have problems as I had.
Still I would have loved it if my debian system could display a console like it does on the rescue disk...
Re: Debian Installer
March 06, 2013 11:31PM
Thanks, Jeff, this worked really well. I could install Debian really easily on my Mele A1000G. The only problem I have is that it only shows 370 MB available memory. The A1000G should have 1GB. Is there a way to access the rest?

Thanks again.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: