Skip to content

Commit

Permalink
Fixed problem with browser not being localized till the first reboot
Browse files Browse the repository at this point in the history
Fixed problem with ACXs reverting to English after temporary deactivation
  • Loading branch information
dsmid committed Mar 13, 2014
1 parent 19c2684 commit d16275e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 18 deletions.
2 changes: 1 addition & 1 deletion config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
HACKNAME=loc_cz
HACKLANG=cs
VERSION=5.4.3
RELEASE=r1
RELEASE=r2
INSTALLKUG=yes
README=cti-me
28 changes: 13 additions & 15 deletions loc_hack/src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,59 +19,57 @@ fail()
exit 1;
}

progress 5 "Mounting main partition r/w"
progress 10 "Mounting main partition r/w"
mntroot rw || fail "Unable to mount main partition r/w".

progress 15 "Copying upstart config to main partition"
progress 20 "Copying upstart config to main partition"
cp -f localization.conf /etc/upstart/ || fail "Unable to copy upstart config"


progress 20 "Copying l10n pack to user store"
progress 30 "Copying l10n pack to user store"
[ -d /mnt/us/localization ] || mkdir /mnt/us/localization || fail "Unable to create l10n dir"
cp -f localization.pack /mnt/us/localization/ || fail "Unable to copy l10n pack"
cp -f version.txt /mnt/us/localization/

progress 30 "Cleaning stock ACXs cache"
rm -f /mnt/us/system/acw/stock-*

bookmarks=/mnt/us/.active_content_sandbox/browser/resource/LocalStorage/file__0.localstorage
md5=$(md5sum $bookmarks 2>/dev/null | (read md file; echo $md))
if [ "$md5" == "e97836b4b5a37a608ff01208542ac870" -o "$md5" == "6a5d715e7411f4958da84927fbbc100b" ]
then
progress 35 "Resetting bookmarks"
rm -f $bookmarks
fi

mntus umount
mntus mount

progress 40 "Setting system locale"
echo -e "LANG=en_GB.UTF-8\nLC_ALL=en_GB.UTF-8" > /var/local/system/locale
sed -i 's/^locale=.*$/locale=en-GB/' /var/local/java/prefs/com.amazon.ebook.framework/prefs

progress 45 "Disabling autoupdates"
progress 50 "Disabling autoupdates"
if [ -f /etc/todo/handler_registry.conf ]
then
sed -i 's/^[^#].*=com[.]lab126[.]ota$/#\0/g' /etc/todo/handler_registry.conf
fi

progress 50 "Mounting diags partition"
progress 55 "Mounting diags partition"
/bin/mount /dev/mmcblk0p2 /mnt/mmc/ || fail "Unable to mount diags partition"

progress 55 "Setting diags root password to mario"
progress 60 "Setting diags root password to mario"
echo 'root:$1$szXhciXv$MWycANLcKbEravzSx7sET0:0:0:99999:7:::' > /tmp/shadow.diags
cat /mnt/mmc/etc/shadow | grep -v '^root:' >> /tmp/shadow.diags || fail "Unable to change diags root password (1)"
cp /tmp/shadow.diags /mnt/mmc/etc/shadow || fail "Unable to change diags root password (2)"


progress 60 "Creating directories"
progress 65 "Creating directories"
mkdir -p /mnt/mmc/usr/local/bin
mkdir -p /mnt/mmc/usr/local/sbin
mkdir -p /mnt/mmc/usr/local/etc/dropbear

progress 65 "Copying SSH keys"
progress 70 "Copying SSH keys"
cp dropbear_*_host_key /mnt/mmc/usr/local/etc/dropbear || fail "Unable to copy SSH keys"

progress 70 "Copying binary files"
progress 75 "Copying binary files"
cp dropbearmulti /mnt/mmc/usr/local/bin || fail "Unable to copy dropbearmulti"
chmod 755 /mnt/mmc/usr/local/bin/dropbearmulti || fail "Unable to chmod 755 dropbearmulti"
ln -sf /usr/local/bin/dropbearmulti /mnt/mmc/usr/local/bin/dbclient || fail "Unable to link dropbearmulti to dbclient"
Expand All @@ -80,13 +78,13 @@ ln -sf /usr/local/bin/dropbearmulti /mnt/mmc/usr/local/bin/dropbearkey || fail "
ln -sf /usr/local/bin/dropbearmulti /mnt/mmc/usr/local/bin/scp || fail "Unable to link dropbearmulti to scp"


progress 80 "Patching system_diags"
progress 85 "Patching system_diags"
sed -i -e 's/rm -rf \/usr\/local/rm -rf \/DIS\/ABLED/' /mnt/mmc/opt/factory/system_diags || fail "Unable to patch system_diags"

progress 85 "Unmounting diags partition"
progress 90 "Unmounting diags partition"
/bin/umount /mnt/mmc || fail "Unable to unmount diags partition"

progress 90 "Copying debrick scripts to main partition"
progress 95 "Copying debrick scripts to main partition"
cp debrick /etc/upstart/ || fail "Unable to copy debrick script"
chmod 755 /etc/upstart/debrick || fail "Unable to chmod 755 debrick"
cp debrick.conf /etc/upstart/ || fail "Unable to copy debrick.conf"
Expand Down
16 changes: 14 additions & 2 deletions loc_hack/src/localization.conf.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
start on ( started filesystems_userstore and started filesystems_var_local ) or starting x
stop on stopping filesystems_userstore or stopping filesystems_var_local
start on started filesystems_userstore and started filesystems_var_local and starting dbus
stop on stopping filesystems_userstore or stopping filesystems_var_local or stopping dbus

export LANG LC_ALL

Expand Down Expand Up @@ -194,9 +194,21 @@ pre-start script
[ -d /mnt/base-us/documents/Kindle_Users_Guide.sdr ] && rm -rf /mnt/base-us/documents/Kindle_Users_Guide.sdr || true
fi

rm -f /mnt/base-us/system/acw/stock-* || true

/usr/sbin/mntroot ro || true
fi

bookmarks=/mnt/us/.active_content_sandbox/browser/resource/LocalStorage/file__0.localstorage
if [ -f $bookmarks ]
then
md5=$(md5sum $bookmarks 2>/dev/null | (read md file; echo $md) || true)
fi
if [ "$md5" == "e97836b4b5a37a608ff01208542ac870" -o "$md5" == "6a5d715e7411f4958da84927fbbc100b" ]
then
rm -f $bookmarks || true
fi

if [ -f "$USERROOT"/original_margins -a ! -f "$BACKUPROOT"/original_margins ]
then
if ! /usr/sbin/mntroot rw
Expand Down

0 comments on commit d16275e

Please sign in to comment.