Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move the N950 N9 parts to separate configs directory.
configs/n950-n9/init_preps.sh is installed to the image and executed by the init process during the init which contains some device specific prosesses that are needed. The moslo.config file contains some variables that define device specific functionality

Signed-off-by: Marko Saukko <marko.saukko@jollamobile.com>
  • Loading branch information
Marko Saukko committed May 15, 2013
1 parent fdaf6b2 commit 8d009a2
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 31 deletions.
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -4,9 +4,10 @@ include initfs/tools/Makefile

rootfs.tar: tools
./initfs/scripts/moslo-build.sh \
-c $(CONFIG_DIR) \
-w . \
-k /boot/vmlinuz-$(KERNEL_VERSION) \
-m /lib/modules/$(KERNEL_VERSION) \
-k $(SOURCE_DIR)/boot/vmlinuz-$(KERNEL_VERSION) \
-m $(SOURCE_DIR)/lib/modules/$(KERNEL_VERSION) \
-v $(VERSION) \
-o moslo.img \
-t rootfs.tar
Expand Down
9 changes: 9 additions & 0 deletions configs/n950-n9/file-list
@@ -0,0 +1,9 @@
/usr/sbin/bme_RX-71
/usr/lib/hwi/hw/rx71.so
/usr/lib/hwi/ic/bq24153.so
/usr/lib/hwi/ic/bq24156.so
/usr/lib/hwi/ic/bq27521.so
/usr/lib/hwi/ic/twl5030.so
/usr/lib/hwi/ic/twl5031.so
/usr/lib/hwi/bc/tabby.so

7 changes: 7 additions & 0 deletions configs/n950-n9/init_preps.sh
@@ -0,0 +1,7 @@
# Load modules
modprobe twl4030_keypad
modprobe g_nokia # load g_nokia to make bme function properly

#Start services
bme_RX-71 -n -c usr/lib/hwi/hw/rx71.so -d

2 changes: 2 additions & 0 deletions configs/n950-n9/moslo.config
@@ -0,0 +1,2 @@
KERNEL_MODS="g_nokia g_file_storage sep_driver twl4030_keypad g_multi"
WD_DEVICE="/dev/twl4030_wdt"
28 changes: 21 additions & 7 deletions initfs/scripts/moslo-build.sh
Expand Up @@ -133,8 +133,12 @@ add_dependencies()
#
echo
echo "Options:"
while getopts "w:k:m:v:o:t:" opt; do
while getopts "c:w:k:m:v:o:t:" opt; do
case $opt in
c)
CONFIG_DIR=$OPTARG
echo "Config dir: $CONFIG_DIR"
;;
w)
WORK_DIR=$OPTARG
echo "Working directory: $WORK_DIR"
Expand Down Expand Up @@ -186,8 +190,12 @@ TOOLS_PATH=$WORK_DIR/initfs/tools
PATH=$PATH:$SCRIPTS_PATH:$WORK_DIR/usr/bin:$TOOLS_PATH
ROOT_DIR=$WORK_DIR/rootfs
BUILD_VERSION_DIR=$ROOT_DIR/etc
KERNEL_MODS=""

if [ -f "$CONFIG_DIR/moslo.config" ]; then
source $CONFIG_DIR/moslo.config
fi

KERNEL_MODS="g_nokia g_file_storage sep_driver twl4030_keypad g_multi"
KERNEL_MOD_DEP=$KERNEL_MOD_DIR/modules.dep

UTIL_LIST=$BUILD_SRC/util-list
Expand Down Expand Up @@ -241,6 +249,11 @@ ln -s /init $ROOT_DIR/sbin/preinit
rm -f /tmp/build-tmp-*
TMPFILE=$(mktemp /tmp/build-tmp-XXXXXX) || exit 1
add_dependencies $UTIL_LIST $TMPFILE

if [ -z "$CONFIG_DIR/file-list" ]; then
add_dependencies $CONFIG_DIR/file-list $TMPFILE
fi

LIBS=$(cat $TMPFILE)

#
Expand Down Expand Up @@ -344,6 +357,7 @@ mkdir -p $TARGET_KERNEL_MOD_DIR
# create tar of rootfs
#
if [ -n $TAR_FILE ]; then
echo "Packing $ROOT_DIR to $WORK_DIR/$TAR_FILE"
tar -cf $WORK_DIR/$TAR_FILE $ROOT_DIR
debug "$(tar -tf $WORK_DIR/$TAR_FILE)"
fi
Expand All @@ -354,13 +368,13 @@ fi
if [ -z $NO_BUILD_FILE_REQ ]; then
gen_initramfs_list.sh -o $WORK_DIR/rootfs.cpio \
-u squash -g squash $ROOT_DIR
gzip $WORK_DIR/rootfs.cpio
gzip -f $WORK_DIR/rootfs.cpio
cat $KERNEL_ZIMAGE > zImage
cat $WORK_DIR/rootfs.cpio.gz > initrd.img
cat $KERNEL_ZIMAGE > $BUILD_FILE
cat $WORK_DIR/rootfs.cpio.gz >> $BUILD_FILE
echo Build is ready at $BUILD_FILE
cat $KERNEL_ZIMAGE > $BUILD_FILE
cat $WORK_DIR/rootfs.cpio.gz >> $BUILD_FILE
echo Build is ready at $BUILD_FILE
else
echo Build is ready
echo Build is ready
fi

31 changes: 19 additions & 12 deletions initfs/skeleton/init
Expand Up @@ -16,7 +16,6 @@ INIT_OPTS=
MMC_DEV="/dev/mmcblk0"
ALT_OS_PART="$MMC_DEV"p4
IP_ARRD="192.168.2.15"
WD_NAME=twl4030_wdt
# Text2screen wrapper for next lines
TTSYI=0 # Where to start
TTSX=0
Expand Down Expand Up @@ -61,8 +60,10 @@ shell()
echo "Starting shell..."
getty 115200 ttyS0 -n -l /bin/sh &
while : ; do
echo "30" >&3
sleep 2
if [ -n "$WD_DEVICE" ]; then
echo "30" >&3
fi
sleep 2
done
}

Expand Down Expand Up @@ -157,9 +158,17 @@ mkdir /dev/pts
mount -a
cat /proc/mounts > /etc/mtab

# Kick the watch dog
exec 3>/dev/$WD_NAME
echo "30" >&3
# Get the device specific configs
if [ -f /moslo.config ]; then
source /moslo.config
fi

# If there is Watch dog device set then kick it
if [ -n "$WD_DEVICE" ]; then
# Kick the watch dog
exec 3>$WD_DEVICE
echo "30" >&3
fi

# adjust kernel to minimize memory consumption,
# flushing of memory card buffers
Expand Down Expand Up @@ -189,13 +198,11 @@ mdev -s
#Set mdev as hotplug manager
echo /bin/mdev > /proc/sys/kernel/hotplug

# Load modules
modprobe twl4030_keypad
modprobe g_nokia # load g_nokia to make bme function properly

#Start services
syslogd &
bme_RX-71 -n -c usr/lib/hwi/hw/rx71.so -d

/sbin/init_preps.sh

# Start telnetd service
telnetd -l/bin/sh

# Start shell for console use
Expand Down
11 changes: 2 additions & 9 deletions initfs/skeleton/util-list
Expand Up @@ -3,18 +3,11 @@
/sbin/busybox
/sbin/parted
/sbin/mkfs.ext4
/usr/sbin/bme_RX-71
/usr/lib/hwi/hw/rx71.so
/usr/lib/hwi/ic/bq24153.so
/usr/lib/hwi/ic/bq24156.so
/usr/lib/hwi/ic/bq27521.so
/usr/lib/hwi/ic/twl5030.so
/usr/lib/hwi/ic/twl5031.so
/usr/lib/hwi/bc/tabby.so
/usr/bin/fb_text2screen
usr/bin/kexec_load
usr/bin/disable_pm
usr/bin/autopartition.sh
sbin/reboot2
sbin/evkey

moslo.config
sbin/init_preps.sh
7 changes: 6 additions & 1 deletion initfs/tools/Makefile
@@ -1,6 +1,11 @@
TOOLS_PATH=./initfs/tools

tools: gen_init_cpio reboot2 evkey install_util
tools: gen_init_cpio reboot2 evkey install_util install_configs

install_configs:
install -d ./sbin
install -m 755 $(CONFIG_DIR)/init_preps.sh ./sbin
install -m 755 $(CONFIG_DIR)/moslo.config ./moslo.config

install_util:
install -d ./sbin
Expand Down

0 comments on commit 8d009a2

Please sign in to comment.