Editing Devuan on N900
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
+ | == Devuan on N900 == | ||
+ | |||
What follows is an account about how I managed to get Devuan running on a Nokia N900 (console only, no desktop environment for now). | What follows is an account about how I managed to get Devuan running on a Nokia N900 (console only, no desktop environment for now). | ||
- | == Linux kernel == | + | === Linux kernel === |
I first cloned mainline (or rather stable) kernel: | I first cloned mainline (or rather stable) kernel: | ||
Line 15: | Line 17: | ||
cd ../linux-4.10.8 | cd ../linux-4.10.8 | ||
- | I used Pali’s | + | I used Pali’s [https://github.com/pali/linux-n900/blob/v4.6-rc1-n900/arch/arm/configs/rx51_defconfig] as a configuration file: |
curl -o arch/arm/configs https://raw.githubusercontent.com/pali/linux-n900/v4.6-rc1-n900/arch/arm/configs/rx51_defconfig | curl -o arch/arm/configs https://raw.githubusercontent.com/pali/linux-n900/v4.6-rc1-n900/arch/arm/configs/rx51_defconfig | ||
Line 28: | Line 30: | ||
apt-get install gcc-arm-none-eabi | apt-get install gcc-arm-none-eabi | ||
- | The latter is more complicated, but may be useful later on. It may be downloaded from emdebian.org. By following Debian’s wiki | + | The latter is more complicated, but may be useful later on. It may be downloaded from emdebian.org. By following Debian’s wiki, we first create <code> /etc/apt/sources.list.d/crosstools.list </code> containing: |
deb http://emdebian.org/tools/debian/ jessie main | deb http://emdebian.org/tools/debian/ jessie main | ||
Line 43: | Line 45: | ||
- | Now we may compile the kernel | + | Now we may compile the kernel. Let’s first cd back to the <code> linux-4.10.8 </code> directory. Then select the desired target architecture and cross-toolchain: |
export ARCH=arm | export ARCH=arm | ||
Line 52: | Line 54: | ||
make rx51_defconfig | make rx51_defconfig | ||
- | At this point it is wise to hack a bit the kernel configuration by setting the two watchdogs (OMAP and TWL4030) to be included into the kernel itself and not separated as loadable modules | + | At this point it is wise to hack a bit the kernel configuration by setting the two watchdogs (OMAP and TWL4030) to be included into the kernel itself and not separated as loadable modules. This is done by calling |
make menuconfig | make menuconfig | ||
Line 82: | Line 84: | ||
- | == Devuan file system == | + | === Devuan file system === |
- | For the following steps it is essential to be root on a Devuan system | + | For the following steps it is essential to be root on a Devuan system. Let’s install some packages: |
apt-get install binfmt-support qemu qemu-user-static debootstrap | apt-get install binfmt-support qemu qemu-user-static debootstrap | ||
Line 122: | Line 124: | ||
# jessie | # jessie | ||
deb http://auto.mirror.devuan.org/merged/ jessie main contrib non-free | deb http://auto.mirror.devuan.org/merged/ jessie main contrib non-free | ||
- | + | ||
# jessie-security, previously known as 'volatile' | # jessie-security, previously known as 'volatile' | ||
deb http://auto.mirror.devuan.org/merged/ jessie-security main contrib non-free | deb http://auto.mirror.devuan.org/merged/ jessie-security main contrib non-free | ||
Line 133: | Line 135: | ||
Pin: release o=Debian | Pin: release o=Debian | ||
Pin-Priority: -1 | Pin-Priority: -1 | ||
- | + | ||
Package: udev | Package: udev | ||
Pin: release o=Devuan | Pin: release o=Devuan | ||
Pin-Priority: -1 | Pin-Priority: -1 | ||
- | Now, in order to perform our customisation, we have to chroot again. To this aim, we first mount the <code> /proc </code> file system of the host to the <code> n900 </code> directory, and tell the system to install packages without starting their associated services. So let’s create <code> usr/sbin/policy-rc.d </code> with | + | Now, in order to perform our customisation, we have to chroot again. To this aim, we first mount the <code> /proc </code> file system of the host to the <code> n900 </code> directory, and tell the system to install packages without starting their associated services. So let’s create <code> usr/sbin/policy-rc.d </code> with: |
#!/bin/sh | #!/bin/sh | ||
Line 155: | Line 157: | ||
(if suggested by the system, also <code> apt-get autoremove </code>). | (if suggested by the system, also <code> apt-get autoremove </code>). | ||
- | To supply for the missing udev at boot and mount the <code> /dev </code> nodes anyway, we need to modify the <code> /etc/init.d/mountkernfs. | + | To supply for the missing udev at boot and mount the <code> /dev </code> nodes anyway, we need to modify the <code> /etc/init.d/mountkernfs.h </code> script (remember we are in the chroot jail, so the leading / is correct). Add the following lines: |
# | # | ||
Line 217: | Line 219: | ||
WARNING: ckbcomp reads <code> /etc/default/keyboard </code>, and then files in <code> /usr/share/X11/xkb/ </code>. The first file to be read is <code> rules/xorg </code>, which specifies other files to be read for the keyboard model and layout specified in <code> /etc/default/keyboard </code>. Based on the rules, files are read in <code> geometry/, keycodes/ </code> and <code> symbols/ </code>. At present (and probably also in the future) ckbcomp does not read files in <code> types/ </code>: the types for modifier keys are hardcoded in ckbcomp itself. As a consequence, there is a particular issue: the version of ckbcomp included in Jessie does not know about <code> PC_FN_LEVEL2 </code>, a type which allows on some keyboard layouts (e.g. Italian and German) to switch from left/right to up/down arrows by pressing (and holding) the function (blue) key. This results in a warning, and the arrow switch is instead obtained by means of shift. To correct the behaviour, I installed console-setup version 1.164 (from Debian sid), or rather installed it on Debian and copied <code> /usr/bin/ckbcomp </code> to the Devuan file system. | WARNING: ckbcomp reads <code> /etc/default/keyboard </code>, and then files in <code> /usr/share/X11/xkb/ </code>. The first file to be read is <code> rules/xorg </code>, which specifies other files to be read for the keyboard model and layout specified in <code> /etc/default/keyboard </code>. Based on the rules, files are read in <code> geometry/, keycodes/ </code> and <code> symbols/ </code>. At present (and probably also in the future) ckbcomp does not read files in <code> types/ </code>: the types for modifier keys are hardcoded in ckbcomp itself. As a consequence, there is a particular issue: the version of ckbcomp included in Jessie does not know about <code> PC_FN_LEVEL2 </code>, a type which allows on some keyboard layouts (e.g. Italian and German) to switch from left/right to up/down arrows by pressing (and holding) the function (blue) key. This results in a warning, and the arrow switch is instead obtained by means of shift. To correct the behaviour, I installed console-setup version 1.164 (from Debian sid), or rather installed it on Debian and copied <code> /usr/bin/ckbcomp </code> to the Devuan file system. | ||
- | If one wants to customise the keyboard, the layout is defined in <code> symbols/nokia_vndr/rx-51 </code>; edit the file | + | If one wants to customise the keyboard, the layout is defined in <code> symbols/nokia_vndr/rx-51 </code>; edit the file and run again <code> dpkg-reconfigure console-setup </code>. |
In order to have a working power button for shutdown, we need: | In order to have a working power button for shutdown, we need: | ||
Line 247: | Line 249: | ||
wl1251_spi | wl1251_spi | ||
- | to <code> /etc/modules </code>. At this point the wifi interface should be ready. In order to connect to my wlan, I also set up the wpa-psk protocol | + | to <code> /etc/modules </code>. At this point the wifi interface should be ready. In order to connect to my wlan, I also set up the wpa-psk protocol. This requires: |
apt-get install wpasupplicant | apt-get install wpasupplicant | ||
Line 264: | Line 266: | ||
and giving, at prompt, the corresponding passphrase. (Actually, I did <code> wpa_passhprase <myssid> <mypassphrase> > /path/to/n900/etc/network/interfaces.d/wlan0 </code>, and edited this file.) | and giving, at prompt, the corresponding passphrase. (Actually, I did <code> wpa_passhprase <myssid> <mypassphrase> > /path/to/n900/etc/network/interfaces.d/wlan0 </code>, and edited this file.) | ||
- | I also added ssh support | + | I also added ssh support: |
apt-get install openssh-server | apt-get install openssh-server | ||
Line 272: | Line 274: | ||
- | == Boot == | + | === Boot === |
Instead of flashing u-boot, I decided to test the system by: | Instead of flashing u-boot, I decided to test the system by: | ||
Line 298: | Line 300: | ||
- | My main computer is a Mac, so I downloaded Nokia’s proprietary flasher | + | My main computer is a Mac, so I downloaded Nokia’s proprietary flasher (I have also a binary for 0xFFFF, built from the sources with a few modifications, but it is prone to hanging the whole system) and installed it (actually, since newer macs have some restrictions due to the System Integrity Protection, I had to unpack the files and copy them manually to proper positions. But this is another story). Then transferred the kernel zImage from the Devuan host to the Mac. |
This is the way I boot Devuan on the N900: turn off the device, hold “u”, connect to Mac by usb cable, wait for the usb symbol to appear on the top right corner (usually with backlight off) and on the Mac, from the directory containing the kernel zImage, issue: | This is the way I boot Devuan on the N900: turn off the device, hold “u”, connect to Mac by usb cable, wait for the usb symbol to appear on the top right corner (usually with backlight off) and on the Mac, from the directory containing the kernel zImage, issue: | ||
Line 320: | Line 322: | ||
- | == Footnotes == | + | === Footnotes === |
- | + | https://wiki.debian.org/CrossToolchains | |
+ |  http://elinux.org/N900 | ||
+ |  Actually the system may boot also with the watchdogs in the modules, but in this case it is very unstable: to avoid reboot, the watchdogs need to be loaded in a few seconds, which may not be possible in some cases (namely, I had a problem due to udev waiting for the loopback lo device to be mounted, which did not happen due to the lack of an initrd). | ||
+ |  https://wiki.debian.org/EmDebian/CrossDebootstrap | ||
+ |  https://serverfault.com/questions/567474/how-can-i-install-packages-without-starting-their-associated-services | ||
+ |  https://wiki.maemo.org/Remapping_keyboard | ||
+ |  https://wiki.debian.org/WiFi/HowToUse | ||
+ |  https://wiki.debian.org/SSH | ||
+ |  It may be found at http://web.archive.org/web/20131117073524/http://skeiron.org/tablets-dev/maemo_dev_env_downloads/. |
Learn more about Contributing to the wiki.