initial armh* features

These handle only VE-like products (think TWRP on Nexus 7);
the proper image support should be backported later on.

An experiment in layered configurations is still in its
early stages regarding ARM zoo...
This commit is contained in:
Michael Shigorin 2013-05-30 18:59:45 +04:00
parent d22c793ee9
commit d9ca33af6d
15 changed files with 412 additions and 0 deletions

29
conf.d/armh.mk Normal file
View File

@ -0,0 +1,29 @@
ifeq (armh,$(ARCH))
ifeq (ve,$(IMAGE_CLASS))
ve/.tegra3-base: ve/.base use/armh use/kernel
@$(call add,BASE_PACKAGES,nvidia-tegra)
ve/.tegra3-tablet: ve/.tegra3-base use/armh-tegra3
@$(call add,BASE_LISTS,$(call tags,base tablet))
ve/.nexus7-tablet: ve/.tegra3-tablet use/armh-nexus7 \
use/x11-autologin use/deflogin/altlinuxroot
@$(call set,KFLAVOURS,grouper) # fits tilapia just fine
@$(call set,BRANDING,altlinux-kdesktop) ### the only suitable so far
@$(call add,BASE_PACKAGES,mkinitrd) ### rootsubdir support
@$(call add,BASE_PACKAGES,firmware-nexus7)
@$(call add,BASE_PACKAGES,livecd-ru) ### until l10n is there
ve/nexus7-e17: ve/.nexus7-tablet use/x11/e17 use/x11/lightdm/gtk; @:
ve/nexus7-kde4: ve/.nexus7-tablet use/x11/lightdm/kde +systemd
@$(call add,BASE_LISTS,$(call tags,base kde4mobile))
ve/nexus7-xfce: ve/.nexus7-tablet use/x11/xfce use/x11/lightdm/gtk +systemd
@$(call add,BASE_PACKAGES,florence at-spi2-atk)
endif
endif

View File

@ -0,0 +1 @@
Эта фича конфигурирует специфические для Google/ASUS Nexus7 аспекты.

View File

@ -0,0 +1,2 @@
use/armh-nexus7:
@$(call add_feature)

View File

@ -0,0 +1,172 @@
#!/bin/sh
# FIXME: the exact partition may vary
cat >> /etc/fstab << EOF
# YMMV, this might be /dev/mmcblk0p10 either
/dev/mmcblk0p9 / ext4 defaults 1 1
EOF
cd /etc/udev/rules.d || exit 1
cat > 90-tegra-rt5640.rules << EOF
SUBSYSTEM!="sound", GOTO="tegra_rt5640_end"
ACTION!="change", GOTO="tegra_rt5640_end"
KERNEL!="card*", GOTO="tegra_rt5640_end"
ATTRS{id}=="tegrart5640", ENV{PULSE_PROFILE_SET}="tegra-nexus7.conf"
LABEL="tegra_rt5640_end"
EOF
cd /usr/share/pulseaudio/alsa-mixer/profile-sets || exit 1
cat > tegra-nexus7.conf << EOF
[General]
auto-profiles = yes
[Mapping analog-stereo]
device-strings = front:%f hw:%f plughw:%f
channel-map = left,right
paths-output = tegra-nexus7-speaker tegra-nexus7-headphone
paths-input = tegra-nexus7-intmic
priority = 10
EOF
cd /etc/X11 || exit 1
cat > xorg.conf << EOF
Section "Device"
Identifier "nexus"
Driver "tegra"
EndSection
EOF
cd /etc/X11/xorg.conf.d || exit 1
cat > 99-nexus-calibration.conf << EOF
Section "InputClass"
Identifier "Nexus 7 Touchscreen"
MatchIsTouchscreen "on"
MatchProduct "elan-touchscreen"
MatchDevicePath "/dev/input/event*"
MatchDriver "evdev"
# Option "Calibration" "29 2125 106 1356"
# Option "SwapAxes" "0"
# Option "Calibration" "566 1201 1025 2075"
# Option "SwapAxes" "1"
Option "Calibration" "6 2132 29 1294"
Option "SwapAxes" "0"
EndSection
EOF
cat > 99-nexus-rotation.conf << EOF
Section "Monitor"
Identifier "Monitor"
Option "Rotate" "right"
EndSection
Section "Screen"
Identifier "Screen"
Monitor "Monitor"
EndSection
EOF
cd /usr/share/pulseaudio/alsa-mixer/paths || exit 1
cat > tegra-nexus7-headphone.conf << EOF
[General]
priority = 90
name = analog-output-headphones
[Jack HP-detect]
state.plugged = yes
[Element Master]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element HP]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Headphone Jack]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Int Spk]
switch = off
; Due to a kernel bug (?) the "Int Mic" is a playback control.
; Therefore we enable it here instead of in the proper place
[Element Int Mic]
switch = on
EOF
cat > tegra-nexus7-intmic.conf << EOF
[General]
priority = 90
name = analog-input-microphone-internal
[Element ADC]
; For some reason the ADC volume seems not to be affecting input gain
switch = mute
volume = zero
override-map.1 = all
override-map.2 = all-left,all-right
[Element ADC Boost Gain]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Int Mic]
switch = mute
[Element DMIC]
enumeration = select
[Option DMIC:DMIC1]
priority = 89
name = analog-input-internal-microphone
EOF
cat > tegra-nexus7-speaker.conf << EOF
[General]
priority = 100
name = analog-output-speaker
[Jack HP-detect]
state.plugged = no
state.unplugged = unknown
[Element Master]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Speaker]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Int Spk]
switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
[Element Headphone Jack]
switch = off
; Due to a kernel bug (?) the "Int Mic" is a playback control.
; Therefore we enable it here instead of in the proper place
[Element Int Mic]
switch = on
EOF

View File

@ -0,0 +1 @@
Эта фича предназначена для базовой поддержки систем на чипсете NVIDIA Tegra3.

View File

@ -0,0 +1,2 @@
use/armh-tegra3:
@$(call add_feature)

View File

@ -0,0 +1,28 @@
#!/bin/sh
cd /etc/udev/rules.d || exit 1
cat > 69-tegra-gpu.rules << EOF
# Set the right permissions to the devices provided by the
# tegra driver
ENV{ACL_MANAGE}=="0", GOTO="tegra_gpu_end"
ACTION!="add|change", GOTO="tegra_gpu_end"
# root only devices
KERNEL=="knvrm" OWNER="root" GROUP="root" MODE="0660"
KERNEL=="knvmap" OWNER="root" GROUP="root" MODE="0660"
# graphics devices
ACTION=="add|change", KERNEL=="nvhost*", GROUP="xgrp", MODE="0660"
ACTION=="add|change", KERNEL=="nvmap*", GROUP="xgrp", MODE="0660"
ACTION=="add|change", KERNEL=="tegra*", GROUP="xgrp", MODE="0660"
ACTION=="add|change", KERNEL=="nvram", GROUP="xgrp", MODE="0660"
ACTION=="add|change", KERNEL=="nvhdcp*", GROUP="xgrp", MODE="0660"
LABEL="tegra_gpu_end"
EOF
# FIXME: xgrp is a kludge
cat > 69-tegra-touchscreen.rules << EOF
SUBSYSTEM=="input",ACTION=="add|change",KERNEL=="event*",ATTRS{name}=="elan-touchscreen", SYMLINK+="twofingtouch", MODE="0660", GROUP="xgrp"
EOF

2
features.in/armh/README Normal file
View File

@ -0,0 +1,2 @@
Эта фича занимается тем подмножеством необходимой для ARM-образов
функциональности, которую получается как-то обобщить.

View File

@ -0,0 +1,2 @@
use/armh:
@$(call add_feature)

View File

@ -0,0 +1,2 @@
#!/bin/sh
echo 'HWCLOCK_SET_TIME_AT_START=false' >> /etc/sysconfig/clock

View File

@ -0,0 +1,21 @@
#!/bin/sh
kver="$(rpm -qa 'kernel-image*' \
--qf '%{installtime} %{version}-%{name}-%{release}\n' \
| sort -n \
| tail -n 1 \
| cut -f 2 -d ' ' \
| sed 's/kernel-image-//')"
[ -h /boot/vmlinuz ] || ln -s vmlinuz-$kver /boot/vmlinuz
[ -h /boot/initrd.img ] || ln -s initrd-$kver.img /boot/initrd.img
# NB: mkinitrd-3.0.16+ has rootsubdir support which is critical
# for TWRP based ARM "VE" chroots (e.g. for nexus7);
# should be implemented in make-initrd either
if rpm -q mkinitrd; then
mkinitrd --with ext4 -f /boot/initrd-$kver.img "$kver"
fi
:

View File

@ -0,0 +1,73 @@
#!/bin/sh
# DESCRIPTION
#
# Setup network settings
# 1. Truncate /etc/resolv.conf
# 2. Init /etc/hosts with "127.0.0.1 localhost"
# 3. Set hostname, domainname
# 4. Set defaults for NetworkManager.
# REQUIRES
#
# Nothing
# INFO
# At startup time hostname may be changed by live-hostname package.
. shell-config
NAME="init3-network"
verbose()
{
if [ -n "$GLOBAL_VERBOSE" ]; then
echo "HOOK: $NAME: $@"
fi
}
verbose "has started"
DOMAINNAME="localdomain"
HOSTNAME="localhost.localdomain"
verbose "Init /etc/hosts with 127.0.0.1 localhost"
/bin/echo "127.0.0.1 localhost localhost.localdomain" > /etc/hosts
verbose "Truncate /etc/resolv.conf"
/bin/echo nameserver 8.8.8.8 >/etc/resolv.conf
chkconfig network on
netcfg="/etc/sysconfig/network"
verbose "Enable networking, disable FORWARD_IPV4, set hostname to $HOSTNAME, domainname to $DOMAINNAME"
shell_config_set "$netcfg" NETWORKING yes
shell_config_set "$netcfg" FORWARD_IPV4 false
shell_config_set "$netcfg" HOSTNAME "$HOSTNAME"
shell_config_set "$netcfg" DOMAINNAME "$DOMAINNAME"
if [ -x /etc/init.d/connmand ]; then
verbose "Enable connmand and finish"
chkconfig --add connmand && chkconfig connmand on
exit 0
fi
verbose "Setup defaults for NetworkManager"
shell_config_set /etc/net/ifaces/default/options-eth BOOTPROTO dhcp
if [ -f /usr/sbin/NetworkManager ] ; then
chkconfig --add NetworkManager && chkconfig NetworkManager on
shell_config_set /etc/net/ifaces/default/options-eth NM_CONTROLLED yes
shell_config_set /etc/net/ifaces/default/options-eth DISABLED yes
#subst 's/NM_CONTROLLED=no/NM_CONTROLLED=yes/' /etc/net/ifaces/*/options ||:
else
verbose "Did you install NetworkManager? Can't find them."
# Don't assign configuration to interfaces, untill ifplugd detects cable presence
subst 's/USE_IFPLUGD=no/USE_IFPLUGD=yes/' /etc/net/ifaces/default/options-eth
fi
verbose "finished"

View File

@ -0,0 +1,11 @@
#!/bin/sh
# poor man's root switch
# NB: 50-users creates predefined users
control su public
control sudo public
cat >> /etc/openssh/sshd_config << EOF
PermitRootLogin yes
UseDNS no
EOF

View File

@ -0,0 +1,24 @@
kde4mobile-regular
kde4-settings-kmobile
maliit-framework-settings
kde4base
kde4graphics
kde4multimedia
kde4network
### this one was hard to find out but requisite
python3-module-pygobject3
gst-plugins-base
mplayer
vlc-mini
libqt4-sql-sqlite
plasma-applet-networkmanager
NetworkManager
NetworkManager-vpnc
NetworkManager-openvpn
NetworkManager-pptp
wpa_gui

View File

@ -0,0 +1,42 @@
xorg-server
xorg-utils
xterm
xauth
twofing
setxkbmap
fonts-ttf-dejavu
fonts-ttf-droid
alsa-utils
amixer
aplay
pulseaudio-daemon
pulseaudio-utils
pavucontrol
rfkill
wpa_supplicant
pciutils
glibc-timezones
tzdata
etcnet
dhcpcd
openssh
openssh-blacklist
sysklogd
nfs-clients
zsh
vim-console
screen
rsync
sudo
su