Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
zaoqi committed Jan 4, 2019
0 parents commit cde51c1
Show file tree
Hide file tree
Showing 35 changed files with 780 additions and 0 deletions.
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

Empty file added draft/backup/pkgs/apt-file
Empty file.
Empty file added draft/backup/pkgs/awesome
Empty file.
Empty file added draft/backup/pkgs/dbus
Empty file.
Empty file added draft/backup/pkgs/dbus-x11
Empty file.
Empty file added draft/backup/pkgs/emacs
Empty file.
Empty file added draft/backup/pkgs/fcitx
Empty file.
Empty file.
Empty file added draft/backup/pkgs/git
Empty file.
Empty file.
Empty file added draft/backup/pkgs/leafpad
Empty file.
Empty file added draft/backup/pkgs/locales
Empty file.
Empty file added draft/backup/pkgs/lxterminal
Empty file.
Empty file added draft/backup/pkgs/psmisc
Empty file.
Empty file added draft/backup/pkgs/sudo
Empty file.
Empty file added draft/backup/pkgs/synaptic
Empty file.
Empty file added draft/backup/pkgs/wget
Empty file.
Empty file added draft/backup/pkgs/wicd
Empty file.
Empty file.
Empty file added draft/backup/pkgs/xvkbd
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions draft/kual-plugin/app-awesome
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd $(dirname $0)
./no-lab126 ./start-chroot "$(./mod-begin)$(./mod-wifi)$(./mod-x11 awesome)$(./mod-end)"
3 changes: 3 additions & 0 deletions draft/kual-plugin/app-xfce4
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd $(dirname $0)
./no-lab126 ./start-chroot "$(./mod-begin)$(./mod-wifi)$(./mod-x11 startxfce4)$(./mod-end)"
3 changes: 3 additions & 0 deletions draft/kual-plugin/conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language="zh_CN.UTF-8"
user="zaoqi"
password="NoPassword"
12 changes: 12 additions & 0 deletions draft/kual-plugin/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension>
<information>
<name>Ubuntu</name>
<version>1.0</version>
<author>zaoqi</author>
<id>ubuntu</id>
</information>
<menus>
<menu type="json" dynamic="true">menu.json</menu>
</menus>
</extension>
5 changes: 5 additions & 0 deletions draft/kual-plugin/menu.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"items": [
{"name": "Ubuntu/awesome", "priority": 1, "action": "./app-awesome"}
]
}
9 changes: 9 additions & 0 deletions draft/kual-plugin/mod-begin
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
cd $(dirname $0)
. conf
echo "
export HOME=/root
unset LC_ALL
export SHELL=/bin/bash
export LANG=$language
"
1 change: 1 addition & 0 deletions draft/kual-plugin/mod-end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#!/bin/sh
11 changes: 11 additions & 0 deletions draft/kual-plugin/mod-wifi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
cd $(dirname $0)
. conf
killall wpa_supplicant
echo "
killall wpa_supplicant
wpa_supplicant -t -c /etc/wpa_supplicant.conf -i wlan0 -d -s -D nl80211&
/etc/init.d/dbus start
/etc/init.d/wicd stop
/etc/init.d/wicd start
"
6 changes: 6 additions & 0 deletions draft/kual-plugin/mod-x11
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
cd $(dirname $0)
. conf
echo "
sudo -u $user -i sh -c 'Xephyr :1 -title L:A_N:application_ID:xephyr_0:R_PC:N -screen 600x800 -cc 4 -dpi 167 -nocursor &sleep 1;DISPLAY=:1 exec $1'
"
45 changes: 45 additions & 0 deletions draft/kual-plugin/no-lab126
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh
# Check which type of init system we're running on
if [ -d /etc/upstart ]; then
export INIT_TYPE="upstart"
else
export INIT_TYPE="sysv"
fi

# Go away if we're on FW 5.0, it's not supported
if [ "${INIT_TYPE}" = "upstart" ]; then
if grep '^Kindle 5\.0' /etc/prettyversion.txt >/dev/null 2>&1; then
# "FW 5.0 is not supported. Update to 5.1!"
# And... scene!
exit 0
fi
fi

# Yield a bit to let stuff stop properly...
# NOTE: This may or may not be terribly useful...
usleep 250000

# If we were started by the KUAL Kindlet, and not the Booklet, we have a nice value to correct...
if [ "$(nice)" = "5" ]; then
# Kindlet threads spawn with a nice value of 5, go back to a neutral value
renice -n -5 $$
fi

# The framework job sends a SIGTERM on stop, trap it so we don't get killed if we were launched by KUAL
trap "" TERM

# Upstart or SysV?
if [ "${INIT_TYPE}" = "sysv" ]; then
/etc/init.d/framework stop
else
stop lab126_gui
# NOTE: Let the framework teardown finish, so we don't start before the black screen...
usleep 1250000
fi

killall -stop getty volumd

# And remove the trap like a ninja now!
trap - TERM

exec "$@"
21 changes: 21 additions & 0 deletions draft/kual-plugin/start-chroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
swapon /mnt/base-us/SWAP
cd $(dirname $0)
cd rootfs
cd $(pwd | sed 's|/us/|/base-us/|')
mount --bind /dev ./dev
mount --bind /dev/pts ./dev/pts
mount --bind /proc ./proc
mount --bind /sys ./sys
mount --bind /tmp ./tmp
same(){
[ -e /"$1" ] && rm -fr ./"$2"
cp -r /"$1" ./"$2" || cp -r ./"$2" /"$1"
mount --bind /"$1" ./"$2"
}
same var/run/wpa_supplicant run/wpa_supplicant
same var/run/resolv.conf etc/resolv.conf
same etc/wpa_supplicant.conf etc/wpa_supplicant.conf

chroot . /bin/sh -c "$*"
reboot

0 comments on commit cde51c1

Please sign in to comment.