Dnia 17 listopad 2015 o 20:20 Karsten Merker <mer...@debian.org> napisał(a): > > > On Tue, Nov 17, 2015 at 10:39:07AM +0100, Łukasz Stelmach wrote: > > Dnia 17 listopad 2015 o 10:07 Ian Campbell <i...@debian.org> napisał(a): > > > > >> Q1-b. Is there any tutorial or a checklist how to port d-i to a new > > >> platform? > > > > > > Not that I know of, other than git log on the relevant components to > > > see what the last guy did I guess. > > > > "Relevant components" is a key phrase I hoped to find as a title of a > > section in such tutorial. > > there is no step-by-step "porting d-i to a new (arm) platform" > tutorial that I know of, but perhaps the following points can > help you: > > - Your platform must be supported by the mainline kernel. From a > quick glance, that doesn't seem to be the case yet. A quick > scan of the kernel sources shows support for the Zyxel nsa320, > but not for the nsa325. > > New boards get only added to the mainline kernel via > device-tree, so the first step would be writing a device-tree > for the board and getting it upstream.
That is being taken care of by Philipp Kirchhofer. https://github.com/pkirchhofer/nsa325-linux-upstream > - D-i uses modules udebs, which get built by the Debian kernel > package. You have to make sure that > > a) all necessary modules are enabled in the relevant kernel > config: > https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/config > > b) the necessary modules get included into the relevant > module-udebs: > > > https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/installer/armel/modules/ That is a good point. I've already discovered I need to enable driver for an external RTC chip. BTW, until now I have used Debian kernel source obtained with apt-get source and patched, of course to run on NSA325. I cloned the above repo but I don't know exactly how to use it (I know there is the debian directory and it should be surrounded by the kernel source). I expect something like creating a smylink or bind-mounting the debian directory from the repo to a kernel source tree should work but (how to find out?) which version (commit?) should I use? > - Your system seems to be based on the kirkwood family of SoCs, That is right. > i.e. it needs to use the "kirwood" subarchitecture of the > Debian kernel packages. The installer therefore needs a > mapping of the machine type to the subarchitecture, which > is done in libdebian-installer: > > > https://anonscm.debian.org/cgit/d-i/libdebian-installer.git/tree/src/system/subarch-arm-linux.c#n26 Already working on it :-) https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805223 > - For making the system bootable, the installer uses > flash-kernel. Flash-kernel has a machine database which > contains a stanza for each supported system and which provides > all necessary information to create and install a bootable > kernel and the corresponding initrd. How exactly that is done > is system-dependant. Some of the steps that can be performed > by flash-kernel include: > * putting kernel and initrd into some specific directory > * appending the proper device-tree for the platform to the > kernel image (necessary on systems with old u-boot versions > that cannot load a separate device-tree blob) > * generating uImages from native Linux kernels and initrds Done. I've got a patch for debian-installer that produces uImage and uInitrd. I serve via tftp and the system boots and runs fine except for the RTC chip and detection of kernel flavour (subarch) to install (the bug above). The rest seems to be working well enough to get a runnable (booting requires some fiedling with kernel) system. > * installing system-specific u-boot scripts > * flashing the kernel and the initrd into some onboard flash > chip I don't want to touch the built-in NAND but rather install Debian on a pendrive. As of now it seems u-boot can't detect the pendrive to read kernel and initrd. I will think about it later. > The flash-kernel machine database: > https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/db/all.db > > Documentation of the stanza format: > https://anonscm.debian.org/cgit/d-i/flash-kernel.git/tree/README#n76 > > HTH, Yes that makes all things clearer. I hope I will be able to submit patches for the relevant components soon. -- Miłego dnia, Łukasz Stelmach