1 |
commit: c80e652a6becc61fa29e8ae5f2a8c8b5c9ee3771 |
2 |
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> |
3 |
AuthorDate: Tue Aug 2 16:48:28 2011 +0000 |
4 |
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> |
5 |
CommitDate: Tue Aug 2 16:48:28 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=c80e652a |
7 |
|
8 |
Keyboard layout support for build tool, Stage3/Portage/BINHOST override from config files |
9 |
|
10 |
--- |
11 |
configs/fluxbox.ini | 1 + |
12 |
configs/minimal.ini | 1 + |
13 |
configs/xfce.ini | 1 + |
14 |
create_image.sh | 38 +++++++++++++++++++++++++------------- |
15 |
daemon.php | 2 +- |
16 |
5 files changed, 29 insertions(+), 14 deletions(-) |
17 |
|
18 |
diff --git a/configs/fluxbox.ini b/configs/fluxbox.ini |
19 |
index f199237..cf9c3cb 100644 |
20 |
--- a/configs/fluxbox.ini |
21 |
+++ b/configs/fluxbox.ini |
22 |
@@ -5,6 +5,7 @@ BOOT_MEGABYTES='64' |
23 |
SWAP_MEGABYTES='128' |
24 |
ROOT_MEGABYTES='7999' |
25 |
TIMEZONE='Europe/London' |
26 |
+KEYBOARD='uk' |
27 |
HOSTNAME='gentoo' |
28 |
ROOT_PASSWORD='g3nt00' |
29 |
DEFAULT_USERNAME='gentoo' |
30 |
|
31 |
diff --git a/configs/minimal.ini b/configs/minimal.ini |
32 |
index 0d7eed6..13740a2 100644 |
33 |
--- a/configs/minimal.ini |
34 |
+++ b/configs/minimal.ini |
35 |
@@ -5,6 +5,7 @@ BOOT_MEGABYTES='64' |
36 |
SWAP_MEGABYTES='128' |
37 |
ROOT_MEGABYTES='3903' |
38 |
TIMEZONE='Europe/London' |
39 |
+KEYBOARD='uk' |
40 |
HOSTNAME='gentoo' |
41 |
ROOT_PASSWORD='g3nt00' |
42 |
DEFAULT_USERNAME='gentoo' |
43 |
|
44 |
diff --git a/configs/xfce.ini b/configs/xfce.ini |
45 |
index 6c249ee..bb4c14f 100644 |
46 |
--- a/configs/xfce.ini |
47 |
+++ b/configs/xfce.ini |
48 |
@@ -5,6 +5,7 @@ BOOT_MEGABYTES='64' |
49 |
SWAP_MEGABYTES='128' |
50 |
ROOT_MEGABYTES='16190' |
51 |
TIMEZONE='Europe/London' |
52 |
+KEYBOARD='uk' |
53 |
HOSTNAME='gentoo' |
54 |
ROOT_PASSWORD='g3nt00' |
55 |
DEFAULT_USERNAME='gentoo' |
56 |
|
57 |
diff --git a/create_image.sh b/create_image.sh |
58 |
index 2da2d6f..3858dac 100755 |
59 |
--- a/create_image.sh |
60 |
+++ b/create_image.sh |
61 |
@@ -52,11 +52,20 @@ LOG_FILE="${IMAGE_WORK_PATH}/log.txt" |
62 |
TOOL_RES_PATH=${RUNNING_DIRECTORY}/res |
63 |
|
64 |
NUM_JOBS=$(( `grep -c processor /proc/cpuinfo`+1 )) |
65 |
-STAGE3_URL="http://distribution.hexxeh.net/gentoo/stage3-i686-latest.tar.bz2" |
66 |
-PORTAGE_URL="http://distribution.hexxeh.net/gentoo/portage-latest.tar.bz2" |
67 |
-BINHOST_URL="http://tinderbox.dev.gentoo.org/default-linux/x86" |
68 |
EMERGE_PROXY="${FLAGS_proxy}" |
69 |
|
70 |
+if [ -z ${STAGE3_URL} ]; then |
71 |
+ STAGE3_URL="http://distribution.hexxeh.net/gentoo/stage3-i686-latest.tar.bz2" |
72 |
+fi |
73 |
+ |
74 |
+if [ -z ${PORTAGE_URL} ]; then |
75 |
+ PORTAGE_URL="http://distribution.hexxeh.net/gentoo/portage-latest.tar.bz2" |
76 |
+fi |
77 |
+ |
78 |
+if [ -z ${BINHOST_URL} ]; then |
79 |
+ BINHOST_URL="http://tinderbox.dev.gentoo.org/default-linux/x86" |
80 |
+fi |
81 |
+ |
82 |
# Clean up old mounts |
83 |
cleanup_mounts() { |
84 |
sleep 2 |
85 |
@@ -191,19 +200,22 @@ linux32 chroot . /bin/bash /etc/profile &>> ${LOG_FILE} |
86 |
echo "Step 13: Setting timezone to ${TIMEZONE}" |
87 |
linux32 chroot . cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime &>> ${LOG_FILE} |
88 |
|
89 |
-echo "Step 14: Setting hostname to ${HOSTNAME}" |
90 |
+echo "Step 14: Setting keyboard layout to ${KEYBOARD}" |
91 |
+linux32 chroot . sed -i -e "s/keymap=.*/keymap=\"${KEYBOARD}\"/" /etc/conf.d/keymaps &>> ${LOG_FILE} |
92 |
+ |
93 |
+echo "Step 15: Setting hostname to ${HOSTNAME}" |
94 |
linux32 chroot . /bin/bash -c "echo hostname='${HOSTNAME}' > /etc/conf.d/hostname" &>> ${LOG_FILE} |
95 |
linux32 chroot . /bin/bash -c "echo 127.0.0.1 ${HOSTNAME}.local ${HOSTNAME} localhost > /etc/hosts" &>> ${LOG_FILE} |
96 |
|
97 |
-echo "Step 15: Copying new fstab" |
98 |
+echo "Step 16: Copying new fstab" |
99 |
cp ${TOOL_RES_PATH}/fstab etc/fstab &>> ${LOG_FILE} |
100 |
|
101 |
-echo "Step 16: Setting up networking" |
102 |
+echo "Step 17: Setting up networking" |
103 |
echo 'config_eth0=( "dhcp" )' > etc/conf.d/net |
104 |
cp etc/init.d/net.lo etc/init.d/net.eth0 |
105 |
linux32 chroot . rc-update add net.eth0 default &>> ${LOG_FILE} |
106 |
|
107 |
-echo "Step 17: Setting up kernel" |
108 |
+echo "Step 18: Setting up kernel" |
109 |
# If we got the flag, used a cached kernel to reduce build times for testing |
110 |
if [[ ${FLAGS_cachedkernel} -eq ${FLAGS_TRUE} ]]; then |
111 |
echo "Using cached kernel" &>> ${LOG_FILE} |
112 |
@@ -227,16 +239,16 @@ else |
113 |
cp usr/src/linux/arch/i386/boot/bzImage boot/kernel &>> ${LOG_FILE} || handle_error "Error copying kernel" |
114 |
fi |
115 |
|
116 |
-echo "Step 18: Setting root password" |
117 |
+echo "Step 19: Setting root password" |
118 |
linux32 chroot . /bin/bash -c "echo 'root:${ROOT_PASSWORD}' | chpasswd" &>> ${LOG_FILE} || handle_error "Error setting root password" |
119 |
|
120 |
-echo "Step 19: Processing packages list" |
121 |
+echo "Step 20: Processing packages list" |
122 |
for PACKAGE in ${PACKAGES_LIST}; do |
123 |
echo "Installing ${PACKAGE}" &>> ${LOG_FILE} |
124 |
linux32 chroot . emerge --jobs=${NUM_JOBS} ${PACKAGE} &>> ${LOG_FILE} || handle_error "Error emerging ${PACKAGE}" |
125 |
done |
126 |
|
127 |
-echo "Step 20: Adding default user" |
128 |
+echo "Step 21: Adding default user" |
129 |
linux32 chroot . useradd -g users -G lp,wheel,audio,cdrom,portage -m ${DEFAULT_USERNAME} || handle_error "Error adding default user" |
130 |
linux32 chroot . /bin/bash -c "echo '${DEFAULT_USERNAME}:${DEFAULT_PASSWORD}' | chpasswd" &>> ${LOG_FILE} || handle_error "Error setting default user password" |
131 |
|
132 |
@@ -249,13 +261,13 @@ then |
133 |
linux32 chroot . usermod -a vboxguest ${DEFAULT_USERNAME} |
134 |
fi |
135 |
|
136 |
-echo "Step 21: Cleaning up make.conf" |
137 |
+echo "Step 22: Cleaning up make.conf" |
138 |
if [ -n ${EMERGE_PROXY} ]; then |
139 |
sed -i '/http_proxy/ d' etc/make.conf |
140 |
fi |
141 |
sed -i '/MAKEOPTS/ d' etc/make.conf |
142 |
|
143 |
-echo "Step 22: Installing extlinux" |
144 |
+echo "Step 23: Installing extlinux" |
145 |
extlinux --heads 255 --sectors 63 --install boot &>> ${LOG_FILE} || handle_error "Error installing extlinux" |
146 |
dd if=/usr/lib/extlinux/mbr.bin of=../${IMAGE_NAME} conv=notrunc &>> ${LOG_FILE} || handle_error "Error copying extlinux MBR" |
147 |
cp ${TOOL_RES_PATH}/extlinux.conf boot/ || handle_error "Error copying extlinux configuration" |
148 |
@@ -291,6 +303,6 @@ if [[ ${FLAGS_compress} -eq ${FLAGS_TRUE} ]]; then |
149 |
IMAGE_OUT="${BUILD_ID}.tar.gz" |
150 |
fi |
151 |
|
152 |
-echo "Step 23: Image build completed!" |
153 |
+echo "Step 24: Image build completed!" |
154 |
echo "Your image is here: ${IMAGES_OUTPUT_PATH}/${IMAGE_OUT}" |
155 |
echo "Your log file is here: ${IMAGES_OUTPUT_PATH}/${BUILD_ID}.log" |
156 |
|
157 |
diff --git a/daemon.php b/daemon.php |
158 |
index 6704053..65d7d2b 100644 |
159 |
--- a/daemon.php |
160 |
+++ b/daemon.php |
161 |
@@ -53,7 +53,7 @@ |
162 |
|
163 |
function image_build($job) |
164 |
{ |
165 |
- $progressMagic = 23; |
166 |
+ $progressMagic = 24; |
167 |
|
168 |
$handle = $job->handle(); |
169 |
$handlehash = md5($handle); |