I have made the following changes intended for : CE:Adaptation:N950-N9 / nokia-n950-configs
Please review and accept ASAP - BOSS has already processed this request and suggests ??? See the "Messages from BOSS" section below https://build.pub.meego.com/request/show/2495 Thank You, Marko Saukko ([email protected]) [This message was auto-generated] --- Request # 2495: Messages from BOSS: None State: new 2011-10-21T20:46:29 sage Reviews: None Changes: submit: home:stskeeps:mer:hw:n950 / nokia-n950-configs -> CE:Adaptation:N950-N9 / nokia-n950-configs Index: n950-xkb-hack.desktop =================================================================== --- n950-xkb-hack.desktop (revision 0) +++ n950-xkb-hack.desktop (revision 2) @@ -0,0 +1,8 @@ +# This hack is to cope with buggy Xorg which does not correctly +# apply Xkb options given in xorg.conf +# +[Desktop Entry] +Name=N950 xkb hack +Exec=setxkbmap -rules evdev -model nokiarm680 -option grp:ctrl_shift_toggle -layout us -variant ",qwerty" +Terminal=False +Type=Application Index: n950-alsamixer.sh =================================================================== --- n950-alsamixer.sh (revision 0) +++ n950-alsamixer.sh (revision 2) @@ -0,0 +1,56 @@ +#!/bin/sh + +# Init file for N950 sound settings + +### BEGIN INIT INFO +# Provides: n950-alsamixer default settings +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: n950-alsamixer settings +### END INIT INFO + +# source function library +. /etc/rc.d/init.d/functions + +RETVAL=0 + +start() { + echo -n "Setting alsamixer: loading N950 defaults" + alsactl restore 0 -f /etc/asound_n950.state + + RETVAL=$? + if [ "$RETVAL" = 0 ]; then + success + else + failure + fi + echo +} + +case "$1" in + start) + start + ;; + stop) + echo -n "Not implemented" + RETVAL=1 + ;; + restart) + start + ;; + reload) + start + ;; + status) + echo -n "Not implemented" + RETVAL=1 + ;; + *) + echo "Usage: $0 {start|stop|restart}" + RETVAL=1 +esac + +exit $RETVAL + Index: n950-dsp-bridge.sh =================================================================== --- n950-dsp-bridge.sh (revision 0) +++ n950-dsp-bridge.sh (revision 2) @@ -0,0 +1,65 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: dsp-bridge +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OMAP3 DSP bridge driver +### END INIT INFO + +# source function library +. /etc/rc.d/init.d/functions + +RETVAL=0 + +start() { + echo -n "Loading DSP bridge" + /sbin/modprobe bridgedriver + RETVAL=$? + if [ "$RETVAL" = 0 ]; then + success + else + failure + fi + echo +} + +stop() { + echo -n "Unloading DSP bridge" + /sbin/rmmod bridgedriver + RETVAL=$? + if [ "$RETVAL" = 0 ]; then + success + else + failure + fi + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + stop + start + ;; + status) + echo -n "Not implemented" + RETVAL=1 + ;; + *) + echo "Usage: $0 {start|stop|restart}" + RETVAL=1 +esac + +exit $RETVAL Index: n950-camera.sh =================================================================== --- n950-camera.sh (revision 0) +++ n950-camera.sh (revision 2) @@ -0,0 +1,71 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: camera +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Camera driver modules +### END INIT INFO + +# source function library +. /etc/rc.d/init.d/functions + +RETVAL=0 + +start() { + echo -n "Loading camera modules" + RETVAL=0 + /sbin/modprobe iommu2 || RETVAL=1 + /sbin/modprobe omap3_iommu || RETVAL=1 + /sbin/modprobe omap3-isp || RETVAL=1 + /sbin/modprobe smiapp || RETVAL=1 + if [ "$RETVAL" = 0 ]; then + success + else + failure + fi + echo +} + +stop() { + echo -n "Unloading camera modules" + RETVAL=0 + /sbin/rmmod smiapp || RETVAL=1 + /sbin/rmmod omap3-isp || RETVAL=1 + /sbin/rmmod omap3_iommu || RETVAL=1 + /sbin/rmmod iommu2 || RETVAL=1 + if [ "$RETVAL" = 0 ]; then + success + else + failure + fi + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + stop + start + ;; + status) + echo -n "Not implemented" + RETVAL=1 + ;; + *) + echo "Usage: $0 {start|stop|restart}" + RETVAL=1 +esac + +exit $RETVAL Index: nokia-n950-configs.spec =================================================================== --- nokia-n950-configs.spec (revision 0) +++ nokia-n950-configs.spec (revision 2) @@ -0,0 +1,119 @@ +# +# Do NOT Edit the Auto-generated Part! +# Generated by: spectacle version 0.23 +# +# >> macros +# << macros + +Name: nokia-n950-configs +Summary: Nokia N950-specific configuration files +Version: 0.2.0 +Release: 0 +Group: System/Startup Services +License: GPLv2 +BuildArch: noarch +Source0: n950-input-rules.conf +Source1: n950-xkb-hack.desktop +Source2: asound_n950.state +Source3: n950-alsamixer.sh +Source4: n950-camera.sh +Source5: n950-dsp-bridge.sh +Source6: n950-swap.sh +Source7: meegotouch-N950.conf +Source8: camera-pipelines.conf +Source9: enable_gprs.desktop +Source10: enable_gprs.sh +Source11: n950-qt-mtf-config.sh +Source12: %{name}.sh +Source13: %{name}.service +Source14: n950-plymouth-start-update.service +Source100: nokia-n950-configs.yaml +Requires: uxlaunch +Requires: systemd +Requires(preun): systemd +Requires(post): systemd +Requires(postun): systemd + + +%description +N950-specific configuration files that are hacks and/or are hard to find a proper place for. + + + +%prep +# No setup + +# >> setup +# << setup + +%build +# >> build pre +# << build pre + + + +# >> build post +# << build post +%install +rm -rf %{buildroot} +# >> install pre +install -D -m 644 %{SOURCE0} $RPM_BUILD_ROOT%{_sysconfdir}/X11/xorg.conf.d/90-input-n950.conf +install -D -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/n950-xkb-hack.desktop +install -D -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/asound_n950.state +install -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_sbindir}/n950-alsamixer-settings.sh +install -D -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/n950-camera.sh +install -D -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_sbindir}/n950-dsp-bridge.sh +install -D -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{_sbindir}/n950-swap.sh +install -D -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_datadir}/meegotouch/targets/N950.conf +install -D -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/camera/pipelines.conf +install -D -m 755 %{SOURCE10} $RPM_BUILD_ROOT%{_bindir}/enable_gprs.sh +install -D -m 755 %{SOURCE11} $RPM_BUILD_ROOT/etc/profile.d/n950-qt-mtf-config.sh +install -D -m 755 %{SOURCE12} $RPM_BUILD_ROOT%{_sbindir}/%{name}.sh +# systemd +install -D -m 644 %{SOURCE13} $RPM_BUILD_ROOT/lib/systemd/system/%{name}.service +install -d $RPM_BUILD_ROOT/lib/systemd/system/sysinit.target.wants/ +ln -s ../%{name}.service $RPM_BUILD_ROOT/lib/systemd/system/sysinit.target.wants/%{name}.service + +install -D -m 644 %{SOURCE14} $RPM_BUILD_ROOT/lib/systemd/system/n950-plymouth-start-update.service +ln -s ../n950-plymouth-start-update.service $RPM_BUILD_ROOT/lib/systemd/system/sysinit.target.wants/n950-plymouth-start-update.service +# << install pre + +# >> install post +# << install post + + +%preun +systemctl stop %{name}.service +systemctl stop n950-plymouth-start-update.service + +%post +systemctl daemon-reload +systemctl reload-or-try-restart %{name}.service +systemctl reload-or-try-restart n950-plymouth-start-update.service + +%postun +systemctl daemon-reload + + +%files +%defattr(-,root,root,-) +# >> files +%config %{_sysconfdir}/X11/xorg.conf.d/90-input-n950.conf +%config %{_sysconfdir}/xdg/autostart/n950-xkb-hack.desktop +%config %{_sysconfdir}/asound_n950.state +%attr(755,root,root) %{_sbindir}/n950-alsamixer-settings.sh +%attr(755,root,root) %{_sbindir}/n950-camera.sh +%attr(755,root,root) %{_sbindir}/n950-dsp-bridge.sh +%attr(755,root,root) %{_sbindir}/n950-swap.sh +%attr(755,root,root) %{_sbindir}/%{name}.sh +%{_datadir}/meegotouch/targets/* +%config %{_sysconfdir}/camera/pipelines.conf +%{_bindir}/* +%{_sysconfdir}/profile.d/n950-qt-mtf-config.sh +/lib/systemd/system/%{name}.service +/lib/systemd/system/sysinit.target.wants/%{name}.service +/lib/systemd/system/n950-plymouth-start-update.service +/lib/systemd/system/sysinit.target.wants/n950-plymouth-start-update.service +# << files + + Index: enable_gprs.sh =================================================================== --- enable_gprs.sh (revision 0) +++ enable_gprs.sh (revision 2) @@ -0,0 +1,3 @@ +#!/bin/sh +/usr/lib/ofono/test/set-context-property 0 AccessPointName internet +/usr/lib/ofono/test/activate-context Index: n950-configs.changes =================================================================== --- n950-configs.changes (revision 0) +++ n950-configs.changes (revision 2) @@ -0,0 +1,16 @@ +* Fri Oct 21 2011 Marko Saukko <[email protected]> - 0.2.0 +- Executed spectacle 0.23 and added boss.conf. + +* Thu Sep 22 2011 Marko Saukko <[email protected]> - 0.2.0 +- Added n950-plymouth-start-update.service to update splash during boot. + +* Tue Sep 13 2011 Marko Saukko <[email protected]> - 0.2.0 +- Update for systemd. + +* Mon Aug 22 2011 Teemu Tuominen <[email protected]> - 0.1.0 +- camera-pipelines.conf upgrade + (orig. gst-nokia-videosrc 0.57.0/data/pipelines.conf) + +* Fri Jul 01 2011 Tommi Keisala <[email protected]> - 0.1.0 +- Initial version of configuration package for n950 + Index: boss.conf =================================================================== --- boss.conf (revision 0) +++ boss.conf (revision 2) @@ -0,0 +1,3 @@ +[checks] +check_package_is_complete_tarball = skip + Index: n950-qt-mtf-config.sh =================================================================== --- n950-qt-mtf-config.sh (revision 0) +++ n950-qt-mtf-config.sh (revision 2) @@ -0,0 +1,2 @@ +# Set QT_GRAPHICSSYSTEM to meego for MTF apps. +export QT_GRAPHICSSYSTEM=meego Index: nokia-n950-configs.yaml =================================================================== --- nokia-n950-configs.yaml (revision 0) +++ nokia-n950-configs.yaml (revision 2) @@ -0,0 +1,31 @@ +Name: nokia-n950-configs +Summary: Nokia N950-specific configuration files +Version: 0.2.0 +Release: 0 +Group: System/Startup Services +License: GPLv2 +BuildArch: noarch +Sources: + - "n950-input-rules.conf" + - "n950-xkb-hack.desktop" + - "asound_n950.state" + - "n950-alsamixer.sh" + - "n950-camera.sh" + - "n950-dsp-bridge.sh" + - "n950-swap.sh" + - "meegotouch-N950.conf" + - "camera-pipelines.conf" + - "enable_gprs.desktop" + - "enable_gprs.sh" + - "n950-qt-mtf-config.sh" + - "%{name}.sh" + - "%{name}.service" + - "n950-plymouth-start-update.service" +Description: N950-specific configuration files that are hacks and/or are hard to find a proper place for. + +Requires: + - uxlaunch + +NoSetup: yes +Configure: none +Builder: none Index: enable_gprs.desktop =================================================================== --- enable_gprs.desktop (revision 0) +++ enable_gprs.desktop (revision 2) @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Application +Name=Enable GPRS +Exec=/usr/bin/enable_gprs.sh Index: asound_n950.state =================================================================== --- asound_n950.state (revision 0) +++ asound_n950.state (revision 2) @@ -0,0 +1,954 @@ +state.dfl61twl4030 { + control.1 { + comment.access 'read write' + comment.type ENUMERATED + comment.count 1 + comment.item.0 'Option 2 (voice/audio)' + comment.item.1 'Option 1 (audio)' + iface MIXER + name 'Codec Operation Mode' + value 'Option 2 (voice/audio)' + } + control.2 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC1 Digital Fine Playback Volume' + value.0 51 + value.1 51 + } + control.3 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 63' + comment.dbmin -6300 + comment.dbmax 0 + iface MIXER + name 'DAC2 Digital Fine Playback Volume' + value.0 51 + value.1 51 + } + control.4 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.5 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 2' + comment.dbmin 0 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Digital Coarse Playback Volume' + value.0 0 + value.1 0 + } + control.6 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC1 Analog Playback Volume' + value.0 12 + value.1 12 + } + control.7 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC2 Analog Playback Volume' + value.0 12 + value.1 12 + } + control.8 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC1 Analog Playback Switch' + value.0 true + value.1 true + } + control.9 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 2 + iface MIXER + name 'DAC2 Analog Playback Switch' + value.0 true + value.1 true + } + control.10 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 49' + comment.dbmin -3700 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Digital Downlink Volume' + value 37 + } + control.11 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 18' + comment.dbmin -2400 + comment.dbmax 1200 + iface MIXER + name 'DAC Voice Analog Downlink Volume' + value 12 + } + control.12 { + comment.access 'read write' + comment.type BOOLEAN + comment.count 1 + iface MIXER + name 'DAC Voice Analog Downlink Switch' + value true + } + control.13 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'PreDriv Playback Volume' + value.0 2 + value.1 2 + } + control.14 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Headset Playback Volume' + value.0 0 + value.1 0 + } + control.15 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 3' + comment.dbmin -1200 + comment.dbmax 600 + iface MIXER + name 'Carkit Playback Volume' + value.0 0 + value.1 0 + } + control.16 { + comment.access 'read write' + comment.type INTEGER + comment.count 1 + comment.range '0 - 3' + comment.dbmin -600 + comment.dbmax 1200 + iface MIXER + name 'Earpiece Playback Volume' + value 0 + } + control.17 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX1 Digital Capture Volume' + value.0 15 + value.1 15 + } + control.18 { + comment.access 'read write' + comment.type INTEGER + comment.count 2 + comment.range '0 - 31' + comment.dbmin 0 + comment.dbmax 3100 + iface MIXER + name 'TX2 Digital Capture Volume' + value.0 15 (754 more lines skipped) Index: camera-pipelines.conf =================================================================== --- camera-pipelines.conf (revision 0) +++ camera-pipelines.conf (revision 2) @@ -0,0 +1,70 @@ +# +# ISP pipeline configuration file for subdevsrc and mcsrc elements. +# +# Recognized settings: +# "max_resizer_factor:" defines resizer's max scaling factor (type: float) +# "width_modulo:" tells how preview/capture width should be rounded (type: int) +# "height_modulo:" tells how preview/capture height should be rounded (type: int) +# "primary:" defines the primary camera device pipeline +# "primary_continuous:" defines the primary camera pipeline for continuous shooting +# "secondary:" defines secondary camera device pipeline +# +# Pipeline definition utilities: +# "OUT_FORMAT" is mapped to output color format selected by application +# "OUT_SIZE" is mapped to output resolution +# "V4L2_MBUS_FMT_*" forces the color format +# "POOL" connects two pipeline segments together with a buffer pool +# "CAPTUREPOOL" works like POOL and is used for continuous shooting pipelines +# +# Each pipeline definition should start with sensor entity and end to video output node. +# The separator character used in pipeline declarations is exclamation mark (!). +# Pipeline definitions *must* also contain "OUT_FORMAT" keyword, since that is used for +# determining the entity where output pixel formats should be queried. +# +# When pipeline definition contains a mem-to-mem segment, it must be connected by +# using a POOL. Mem-to-mem segment means a pipeline section where frames are read +# out from pipeline through an "output" entity and pushed back to ISP pipeline by using +# an "input" entity. POOL must be always present between output and input entities to +# ensure a proper buffer passing service between them. +# +# Continuous shooting pipeline must contain a CAPTUREPOOL definition. It defines the +# pool which is used for image capturing in continuous shooting mode. +# +# The encoding of this file must be ISO-8859-1. + +# Keyword mappings. These are used to simplify pipeline definitions and +# to automate sensor selection. When multiple entries are found with same keyword, +# subdevsrc will try them one after another, until functional entity is found. + +main = jt8ev1 +main = smiapp-001 +main = smiapp-002 +main = smiapp-003 +main = smiapp-004 +vga = tcm8500md +vga = vw6558 +csi2 = OMAP3 ISP CSI2a +csi2_out = OMAP3 ISP CSI2a output +ccp2 = OMAP3 ISP CCP2 +ccp2_in = OMAP3 ISP CCP2 input +ccdc = OMAP3 ISP CCDC +prev = OMAP3 ISP preview +prev_out = OMAP3 ISP preview output +rsz_in = OMAP3 ISP resizer input +rsz = OMAP3 ISP resizer +rsz_out = OMAP3 ISP resizer output + +# Settings +max_resizer_factor: 4.0 +width_modulo: 16 +height_modulo: 16 + +# Primary camera pipeline +primary: main ! csi2 ! V4L2_MBUS_FMT_SGRBG10_1X10 ! ccdc ! prev ! OUT_FORMAT ! rsz ! OUT_SIZE ! rsz_out + +# Primary camera pipeline for continuous shooting +primary_continuous: main ! csi2 ! V4L2_MBUS_FMT_SGRBG10_1X10 ! ccdc ! prev ! OUT_FORMAT ! prev_out ! CAPTUREPOOL ! rsz_in ! rsz ! OUT_SIZE ! rsz_out +#primary_continuous: main ! csi2 ! V4L2_MBUS_FMT_SGRBG10_1X10 ! csi2_out ! POOL ! ccp2_in ! ccp2 ! ccdc ! prev ! OUT_FORMAT ! prev_out ! CAPTUREPOOL ! rsz_in ! rsz ! OUT_SIZE ! rsz_out + +# Secondary camera pipeline +secondary: vga ! ccp2 ! ccdc ! prev ! OUT_FORMAT ! rsz ! OUT_SIZE ! rsz_out Index: nokia-n950-configs.service =================================================================== --- nokia-n950-configs.service (revision 0) +++ nokia-n950-configs.service (revision 2) @@ -0,0 +1,11 @@ +[Unit] +Description=Nokia N950 Configs + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/nokia-n950-configs.sh start +ExecStop=/usr/sbin/nokia-n950-configs.sh stop + +[Install] +WantedBy=multi-user.target Index: n950-input-rules.conf =================================================================== --- n950-input-rules.conf (revision 0) +++ n950-input-rules.conf (revision 2) @@ -0,0 +1,37 @@ +Section "ServerFlags" + Option "AllowEmptyInput" "False" +EndSection + +# Ignore all by default +Section "InputClass" + Identifier "Ignore all by default" + Option "Ignore" "on" +EndSection + +Section "InputClass" + Identifier "Touchscreen" + MatchProduct "Touchscreen" + Driver "mtev" + Option "Ignore" "off" +EndSection + + +Section "InputClass" + Identifier "Keyboard" + MatchProduct "TWL4030 Keypad" + Option "XkbModel" "nokiarm680" + Option "XkbLayout" "us" + Option "XkbVariant" ",qwerty" + Option "XkbOptions" "grp:ctrl_shift_toggle" + Driver "evdev" + Option "Ignore" "off" +EndSection + +# Configure gpio keys and pwrbutton in MeeGo (Camera etc) +Section "InputClass" + Identifier "HW keys" + MatchProduct "gpio-keys|twl4030_pwrbutton" + Driver "evdev" + Option "Ignore" "off" +EndSection + Index: meegotouch-N950.conf =================================================================== --- meegotouch-N950.conf (revision 0) +++ meegotouch-N950.conf (revision 2) @@ -0,0 +1,11 @@ +[resolution] +X=856 +Y=480 +[ppi] +X=254 +Y=254 +[allowedOrientations] +keyboardOpen = 0 +keyboardClosed = 0,270 +[other] +showStatusBar=true Index: n950-plymouth-start-update.service =================================================================== --- n950-plymouth-start-update.service (revision 0) +++ n950-plymouth-start-update.service (revision 2) @@ -0,0 +1,9 @@ +[Unit] +Description=Update omap display +DefaultDependencies=no +After=plymouth-lite-start.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/fb_update_mode doupdate Index: n950-swap.sh =================================================================== --- n950-swap.sh (revision 0) +++ n950-swap.sh (revision 2) @@ -0,0 +1,87 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: swap +# Required-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Enable swap partition +### END INIT INFO + +# source function library +. /etc/rc.d/init.d/functions + +RETVAL=0 + +encswap="/dev/mapper/encswap" + +start() { + echo -n "Enabling MTD swap" + RETVAL=0 + + if [ ! -e $encswap ]; then + swappart=`sed -n -e '/swap/s/mtd\([0-9]\).*/\1/p' /proc/mtd` || true + if [ -n "$swappart" ]; then + modprobe mtdswap partitions=$swappart spare_eblocks=10 header=0 || RETVAL=1 + modprobe dm_mod + modprobe dm_crypt + /sbin/cryptsetup create -h sha256 -c aes-xts-plain -s 256 -d /dev/urandom encswap /dev/mtdswap$swappart || RETVAL=1 + /sbin/mkswap $encswap || RETVAL=1 + else + echo "ERROR: Could not find swap partion from mtd" + RETVAL=1 + fi + fi + + if [ $RETVAL -eq 0 ]; then + /sbin/swapon $encswap || RETVAL=1 + fi + + if [ $RETVAL -eq 0 ]; then + success + else + failure + fi + echo +} + +stop() { + echo -n "Disabling MTD swap" + RETVAL=0 + + /sbin/swapoff $encswap || RETVAL=1 + + if [ $RETVAL -eq 0 ]; then + success + else + failure + fi + echo +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + reload) + stop + start + ;; + status) + echo -n "Not implemented" + RETVAL=1 + ;; + *) + echo "Usage: $0 {start|stop|restart}" + RETVAL=1 +esac + +exit $RETVAL Index: nokia-n950-configs.sh =================================================================== --- nokia-n950-configs.sh (revision 0) +++ nokia-n950-configs.sh (revision 2) @@ -0,0 +1,6 @@ +#!/bin/bash + +/usr/sbin/n950-alsamixer.sh start +/usr/sbin/n950-camera.sh start +/usr/sbin/n950-dsp-bridge.sh start +/usr/sbin/n950-swap.sh start
