diff options
author | Santiago Collazo <scollazo@activitycentral.com> | 2012-11-03 00:09:17 (GMT) |
---|---|---|
committer | Santiago Collazo <scollazo@activitycentral.com> | 2012-11-03 00:09:17 (GMT) |
commit | b26a23f3b324b2bf3cf8990d43425f74471ce5c0 (patch) | |
tree | c715a766db19ea03b5b2ccfebb7e1de2f074389d | |
parent | 8b8a2c3c08233aaf02a699d28957d456a842fd15 (diff) |
Added kpartx and merge dextrose hacks into one file
-rw-r--r-- | modules/base/kspost.11.core.inc | 3 | ||||
-rw-r--r-- | modules/base/kspost.12.core.inc | 4 | ||||
-rw-r--r-- | modules/base/kspost.13.core.inc | 6 | ||||
-rw-r--r-- | modules/base/kspost.14.core.inc | 59 | ||||
-rw-r--r-- | modules/sd_card_image/image.50.makefs.sh | 14 | ||||
-rw-r--r-- | modules/x11/kspost.90.tweaks.inc | 88 |
6 files changed, 83 insertions, 91 deletions
diff --git a/modules/base/kspost.11.core.inc b/modules/base/kspost.11.core.inc deleted file mode 100644 index f806a4a..0000000 --- a/modules/base/kspost.11.core.inc +++ /dev/null @@ -1,3 +0,0 @@ -# Disable "requiretty" for "wheel" group, so that "sudo" commands are be able to run in a terminal-less environment. -echo "Defaults:%wheel !requiretty" >> /etc/sudoers - diff --git a/modules/base/kspost.12.core.inc b/modules/base/kspost.12.core.inc deleted file mode 100644 index 7b94284..0000000 --- a/modules/base/kspost.12.core.inc +++ /dev/null @@ -1,4 +0,0 @@ -# sl#3267, enable ctrl+alt+erase to restart sugar for all xo-[1,1.5,1.75] laptops -sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.conf -sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.5.conf -sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.75.conf diff --git a/modules/base/kspost.13.core.inc b/modules/base/kspost.13.core.inc deleted file mode 100644 index 54d74fc..0000000 --- a/modules/base/kspost.13.core.inc +++ /dev/null @@ -1,6 +0,0 @@ -# Set microphone recording level -# don't think this is the right place JV -# might need to patch olpc-configure -echo "/usr/bin/amixer set \"Master Surround\" 31 unmute" > /etc/rc.d/rc.local -echo "/usr/bin/alsactl store" >> /etc/rc.d/rc.local - diff --git a/modules/base/kspost.14.core.inc b/modules/base/kspost.14.core.inc deleted file mode 100644 index 8dbbe60..0000000 --- a/modules/base/kspost.14.core.inc +++ /dev/null @@ -1,59 +0,0 @@ -cat << EOF > /usr/bin/yumfix -#!/usr/bin/env python -# Copyright (C) 2011, OLPC-AU. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -import os -import sys -import string -import gettext -import gconf - -def main(): - - - ## JV export http_proxy from .gconf - yumtmp = open("/tmp/yum.conf.mod", "w") - if not os.path.exists('/home/olpc/.gconf/system/proxy'): - yumtmp.close() - sys.exit(1) - sys_dir = '/system/http_proxy' - client = gconf.client_get_default() - use_proxy = client.get_string('/system/proxy/mode') - if use_proxy != 'none': - http_host = client.get_string('%s/host' % sys_dir) - http_port = client.get_int('%s/port' % sys_dir) - proxy_info = '%s:%d' % (http_host, http_port) - yumtmp.write('proxy=http://%s\n' % proxy_info) - use_auth = client.get_bool('%s/use_authentication' % sys_dir) - if use_auth is True: - auth_user = client.get_string('%s/authentication_user' % sys_dir) - yumtmp.write('proxy_username %s\n' % auth_user) - auth_pass = client.get_string('%s/authentication_password' % sys_dir) - yumtmp.write('proxy_password %s\n' % auth_pass) - else: - pass - yumtmp.close() - -main() - -EOF -chmod 755 /usr/bin/yumfix - -# run the above from ~/.xsession -echo "/usr/bin/yumfix" > /home/olpc/.xsession - -echo "include=/tmp/yum.conf.mod" >> /etc/yum.conf diff --git a/modules/sd_card_image/image.50.makefs.sh b/modules/sd_card_image/image.50.makefs.sh index b259409..2b32ee1 100644 --- a/modules/sd_card_image/image.50.makefs.sh +++ b/modules/sd_card_image/image.50.makefs.sh @@ -79,20 +79,14 @@ make_image() $ROOT_PARTITION_START_BLOCK,,, EOF - disk_loop=$(losetup --show --find --partscan $img) + disk_loop=$(kpartx -l $img | head -n1 | awk '{print $5}' | sed -e 's/dev/dev\/mapper/g' ) boot_loop="${disk_loop}p1" root_loop="${disk_loop}p2" - # Work around occasional failure for loop partitions to appear - # http://marc.info/?l=linux-kernel&m=134271282127702&w=2 - local i=0 - while ! [ -e "$boot_loop" ]; do - partx -a -v $disk_loop - sleep 1 - (( ++i )) - [ $i -ge 10 ] && break - done + kpartx -a -v $img + echo "mke2fs -O dir_index,^resize_inode -L Boot -F $boot_loop" + echo "Create filesystems..." mke2fs -O dir_index,^resize_inode -L Boot -F $boot_loop mount $boot_loop $BOOT diff --git a/modules/x11/kspost.90.tweaks.inc b/modules/x11/kspost.90.tweaks.inc index f930144..a8299c7 100644 --- a/modules/x11/kspost.90.tweaks.inc +++ b/modules/x11/kspost.90.tweaks.inc @@ -1,21 +1,91 @@ +# Disable "requiretty" for "wheel" group, so that "sudo" commands are be able to run in a terminal-less environment. +echo "Defaults:%wheel !requiretty" >> /etc/sudoers + +# sl#3267, enable ctrl+alt+erase to restart sugar for all xo-[1,1.5,1.75] laptops +sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.conf +sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.5.conf +sed -i -e '/DontZap/d' /usr/share/olpc-utils/xorg.conf.d/xo1.75.conf + +# Set microphone recording level +# don't think this is the right place JV +# might need to patch olpc-configure +echo "/usr/bin/amixer set \"Master Surround\" 31 unmute" > /etc/rc.d/rc.local +echo "/usr/bin/alsactl store" >> /etc/rc.d/rc.local + +cat << EOF > /usr/bin/yumfix +#!/usr/bin/env python +# Copyright (C) 2011, OLPC-AU. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import os +import sys +import string +import gettext +import gconf + +def main(): + + + ## JV export http_proxy from .gconf + yumtmp = open("/tmp/yum.conf.mod", "w") + if not os.path.exists('/home/olpc/.gconf/system/proxy'): + yumtmp.close() + sys.exit(1) + sys_dir = '/system/http_proxy' + client = gconf.client_get_default() + use_proxy = client.get_string('/system/proxy/mode') + if use_proxy != 'none': + http_host = client.get_string('%s/host' % sys_dir) + http_port = client.get_int('%s/port' % sys_dir) + proxy_info = '%s:%d' % (http_host, http_port) + yumtmp.write('proxy=http://%s\n' % proxy_info) + use_auth = client.get_bool('%s/use_authentication' % sys_dir) + if use_auth is True: + auth_user = client.get_string('%s/authentication_user' % sys_dir) + yumtmp.write('proxy_username %s\n' % auth_user) + auth_pass = client.get_string('%s/authentication_password' % sys_dir) + yumtmp.write('proxy_password %s\n' % auth_pass) + else: + pass + yumtmp.close() + +main() + +EOF +chmod 755 /usr/bin/yumfix + +# run the above from ~/.xsession +echo "/usr/bin/yumfix" > /home/olpc/.xsession + +echo "include=/tmp/yum.conf.mod" >> /etc/yum.conf #au#704: add permissions for '/etc/ntp/step-tickers' file -chmod 0777 /etc/ntp -chmod 0777 /etc/ntp/step-tickers -# also, make the file empty. +mkdir -p /etc/ntp echo > /etc/ntp/step-tickers +chmod 0777 /etc/ntp/step-tickers /etc/ntp # uy#1375 : Utility Functions. SearchAndReplaceRegex() { - cat $1 | sed "s/$2/$3/g" > temp - cat temp > $1 + sed "s/$2/$3/g" "$1" -i } SearchAndDeleteLineContainingRegex() { - cat $1 | sed "/$2/d" > temp - cat temp > $1 + sed "/$2/d" "$1" -i } # uy#1375 (a): Append to "/home/olpc/.xsession" @@ -40,8 +110,8 @@ chmod -R 0777 /var/www/web1/ # Some necessary tweaks in "httpd" service. # -rm /etc/httpd/logs -mkdir /etc/httpd/logs +rm /etc/httpd/logs -f +mkdir /etc/httpd/logs -p # Generate the ssl-key and certificate. # Note that initially, all XOs will be having the same pair |