From e813dfb576a6dc6439dac1facf2c2adc77a210dc Mon Sep 17 00:00:00 2001 From: Martin Dengler Date: Mon, 24 Aug 2009 10:28:13 +0000 Subject: merge branch xo-strawberry with mainline --- (limited to 'soas-xo.ks') diff --git a/soas-xo.ks b/soas-xo.ks new file mode 100644 index 0000000..2cb44ed --- /dev/null +++ b/soas-xo.ks @@ -0,0 +1,489 @@ +%include soas-sugar.ks +%include soas-aslo-and-content.ks + +##repo --name=olpc-kernel-xo-1 --cost=5 --baseurl=http://dev.laptop.org/~mdengler/xo-1 +#repo --name=olpc-kernel --cost=5 --baseurl=http://dev.laptop.org/~dilinger/olpc-2.6.30-xo1 +repo --name=olpc --cost=3 --baseurl=http://dev.laptop.org/~dsd/xo1-rpms + +%packages --excludedocs --instLangs en:es:ar:pl:pt_BR:pt:it:fr:ht:el:mn:mr_IN:th:am_ET:km_KH:ne_NP:ur_PK:rw:ja:de:tr:te:ps:fa_AF:si + +libertas-usb8388-firmware + +ntpdate +xcompmgr + +# sound backend +-alsa-plugins-pulseaudio +-pulseaudio + +yum-presto + +%end + +%post + + + +################## +# BEGIN olpc.fth +cat > /boot/olpc.fth <= if + " root=mtd0 rootfstype=jffs2" + else + " root=LABEL=OLPCRoot" + then + " ROOTDEV" \$set-macro +; + +: olpc-fth-boot-me + set-path-macros + " ro \${ROOTDEV} console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22" expand$ to boot-file + " \${DN}\${PN}\vmlinuz" expand$ to boot-device + " \${DN}\${PN}\initrd.img" expand$ to ramdisk + + setup-smbios + unfreeze + dcon-unfreeze + visible + + boot +; + +olpc-fth-boot-me + +EOF + +# END olpc.fth +################## + + + +################## +# BEGIN dcon-unfreeze-failsafe + + +cat > /etc/event.d/dcon-unfreeze-failsafe <" + +start on started prefdm +stop on stopping prefdm +stop on starting shutdown + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +script +echo 0 > /sys/devices/platform/dcon/freeze +end script +EOF + +chmod a+rx /etc/event.d/dcon-unfreeze-failsafe + +# END dcon-unfreeze-failsafe +################## + + + +CREATE_USERNAME=liveuser + +################## +# BEGIN avoid livesys script at every boot + + +cat >> /etc/fstab <> /etc/sudoers + +# permanently set %__dbi_cdb rpm macro to work around jffs2's lack of writeable mmap() +mkdir -p /etc/rpm +echo "%__dbi_cdb create private nommap" > /etc/rpm/macros.rpmdb + + +# amend build +sed -i -e 's/SoaS/SoaS-XO/g' /etc/fedora-release + + +# disable screensaver locking +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /apps/gnome-screensaver/lock_enabled false >/dev/null + + +# disable the logout menu item in Sugar +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool /desktop/sugar/show_logout false >/dev/null + + +# nicer console font for our little screen +# FIXME: olpc-configure sets this up too, but it's too late for first boot. +# but perhaps we could fix that so that it gets applied. +echo "SYSFONT=sun12x22" >> /etc/sysconfig/i18n + + +# make sure the fonts are not too big in GNOME +# FIXME: remove when http://dev.laptop.org/ticket/9331 is fixed +gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t float /desktop/gnome/font_rendering/dpi 201 >/dev/null + + +# make sure the fonts are not too big in Sugar +# FIXME: remove when http://dev.laptop.org/ticket/9331 is fixed +echo "Xft.dpi: 201" > /home/$CREATE_USERNAME/.Xresources +chown $CREATE_USERNAME:$CREATE_USERNAME /home/$CREATE_USERNAME/.Xresources + + +# use smaller font size for XO +# FIXME: fix upstream at http://dev.sugarlabs.org/ticket/954 +sed -i -e 's/Sans Serif 10/Sans Serif 7/g' /usr/share/sugar/data/sugar-100.gtkrc + + +# install activities +BUNDLES_DIR=/usr/share/sugar/bundles +ACTIVITIES_DIR=/home/$CREATE_USERNAME/Activities +chown -R $CREATE_USERNAME:$CREATE_USERNAME $BUNDLES_DIR +mkdir /home/$CREATE_USERNAME/Activities +chown -R $CREATE_USERNAME:$CREATE_USERNAME $ACTIVITIES_DIR +cd $BUNDLES_DIR +chmod a+x install-activity.py +for file in *.xo; do + su $CREATE_USERNAME -c "./install-activity.py $file" +done +rm -f install-activity.py + +# execute sample content script and clean up afterwards +chmod a+x copy-to-datastore.py +su $CREATE_USERNAME -c ./copy-to-datastore.py +rm -f *.pdf copy-to-datastore.py + + +# add more activities to the favorites +cat > /usr/share/sugar/data/activities.defaults << FOE +com.garycmartin.Moon +org.laptop.AbiWordActivity +org.laptop.Calculate +org.laptop.Chat +org.laptop.Memorize +org.laptop.Pippy +org.laptop.TurtleArtActivity +org.laptop.WebActivity +org.vpri.EtoysActivity +org.laptop.Oficina +org.laptop.RecordActivity +org.gnome.Labyrinth +org.laptop.physics +vu.lux.olpc.Speak +org.worldwideworkshop.olpc.JigsawPuzzle +FOE + +# END avoid livesys scripts at every boot +################## + + +################## +# BEGIN liveuser .xsession + +cat >> /home/$CREATE_USERNAME/.xsession < $ntpdate_file <> /tmp/ntpdate.log 2>&1 +fi +EOF + +chmod u+rx $ntpdate_file + +fi + +# END ntpdate +################## + + + +################## +# BEGIN smolt + +smolt_file=/etc/NetworkManager/dispatcher.d/43-smolt +if [ ! -e $smolt_file ] ; then + cat > $smolt_file <> /tmp/smolt.log 2>&1 +fi +EOF + +fi + +chmod u+rx $smolt_file + +# END smolt +################## + + +################## +# BEGIN make sugar default +cat > /home/$CREATE_USERNAME/.dmrc </dev/null +# END set sugar power management on +################## + + + +################## +# BEGIN enable serial console + +echo ttyS0 >> /etc/securetty + +cat > /etc/event.d/ttyS0 <> /etc/yum.repos.d/sugar.repo << FOE +[sugar] +name=Sugar +failovermethod=priority +baseurl=http://download.sugarlabs.org/soas/repositories/2/ +enabled=1 +gpgcheck=0 +FOE + +cat >> /etc/yum.repos.d/olpc-xo-1.repo << FOE +[olpc-xo-1] +name=OLPC XO-1 +failovermethod=priority +baseurl=http://dev.laptop.org/~mdengler/xo-1 +enabled=1 +gpgcheck=0 +FOE + +cat >> /etc/yum.repos.d/olpc.repo << FOE +[olpc] +name=OLPC XO-1 +failovermethod=priority +baseurl=http://dev.laptop.org/~dsd/xo1-rpms +enabled=1 +gpgcheck=0 +FOE + +# END add yum repos +################## + + +################## +# BEGIN setup services +for service in auditd cpuspeed cups dnsmasq exim firstboot iptables ip6tables irda mdmonitor netfs network nfs nfslock nscd portreserve rpcbind rpcgssd rpcidmapd ; do + /sbin/chkconfig --level 2345 $service off +done + +################## +# BEGIN configure powerd + +#FIXME olpc-utils needs a patch to fix ttyS0 not starting, without which rtcwake is broken +# see http://lists.sugarlabs.org/archive/sugar-devel/2009-August/018378.html +sed -i -e 's/start on stopped prefdm/start on stopped prefdm\n\n#FIXME remove when olpc-utils is patched or\n# http:\/\/lists.sugarlabs.org\/archive\/sugar-devel\/2009-August\/018378.html\n# is otherwise fixed\nstart on runlevel [2345]/' /etc/event.d/ttyS0 + +mv /etc/powerd/powerd.conf /etc/powerd/standard.conf +ln -s soas.conf /etc/powerd/powerd.conf +cat > /etc/powerd/soas.conf </sys/power/wlan-enabled"), which may override this +# setting. +# +# config_CPU_IDLE_LIMIT +# If the cpu is idle less than this percentage, then the laptop +# won't suspend. +# +# config_SLEEP_WHEN_LID_CLOSED +# This is normally left enabled, and causes the laptop to go to sleep +# when closed. If disabled, it will stay awake when the lid is +# closed, and will only sleep because of other timeouts. +# +config_BATTERY_TIME_DIM="180" +config_BATTERY_TIME_SLEEP="360" +config_BATTERY_TIME_BLANK="99999" +config_EBOOK_TIME_DIM="99999" +config_EBOOK_TIME_SLEEP="20" +config_EBOOK_TIME_BLANK="99999" +config_PLUGGED_TIME_DIM="99999" +config_PLUGGED_TIME_SLEEP="99999" +config_PLUGGED_TIME_BLANK="99999" +config_IDLE_DIM_LEVEL="0" +config_MESH_DURING_SUSPEND="no" +config_MAX_SLEEP_BEFORE_SHUTDOWN="99999" +config_ALLOW_SHUTDOWN_WHEN_PLUGGED="no" +config_CONFIRM_SECONDS="7" +config_CPU_IDLE_LIMIT="10" +config_SLEEP_WHEN_LID_CLOSED="yes" +FOE + + + +for service in avahi-daemon sshd ; do + /sbin/chkconfig --level 2345 $service on +done +# something triggers prompting, so just turn it off with a big hammer +sed -i -e 's/PROMPT=yes/PROMPT=no/;' /etc/sysconfig/init +# END setup services +################## + +%end + + +################## +# FIXME: remove when it's clear why non-OLPC kernel's being installed +# (and installed second) +%post --nochroot +cp -p ../cache/olpc*/packages/kernel-2.6.30_xo1*.rpm $INSTALL_ROOT +%end +%post +set -x +ls -l /boot +rpm -ivh --force $(/bin/ls /kernel-2.6.30_xo1*.rpm | tail -1) +ls -l /boot +%end +################## -- cgit v0.9.1