* [gentoo-commits] proj/gentoaster:webui commit in: /
2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
@ 2011-07-15 20:40 ` Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-07-15 20:40 UTC (permalink / raw
To: gentoo-commits
commit: 0318eec2f613ed905363c31316fd50ee8bdde85d
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Fri Jul 15 20:40:31 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Fri Jul 15 20:40:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=0318eec2
Let's try not to nuke /dev if things go wrong
---
create_image.sh | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index f87e507..77664f1 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -64,8 +64,8 @@ cleanup_mounts() {
umount -d -f ${IMAGE_WORK_PATH}/rootfs/dev/shm &>> ${LOG_FILE}
umount -d -f ${IMAGE_WORK_PATH}/rootfs/dev &>> ${LOG_FILE}
umount -d -f ${IMAGE_WORK_PATH}/rootfs/proc &>> ${LOG_FILE}
- umount -d -f ${IMAGE_WORK_PATH}/rootfs/boot &>> ${LOG_FILE}
- umount -d -f ${IMAGE_WORK_PATH}/rootfs &>> ${LOG_FILE}
+ umount -d -f -l ${IMAGE_WORK_PATH}/rootfs/boot &>> ${LOG_FILE}
+ umount -d -f -l ${IMAGE_WORK_PATH}/rootfs &>> ${LOG_FILE}
sleep 2
}
@@ -73,8 +73,7 @@ cleanup_mounts() {
handle_error() {
echo "$1"
cd ${IMAGE_WORK_PATH}
- cleanup_mounts
- rm -rf ${IMAGE_WORK_PATH}
+ cleanup_mounts && rm -rf ${IMAGE_WORK_PATH}
exit 1
}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:webui commit in: /
@ 2011-07-15 20:41 Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-07-15 20:41 UTC (permalink / raw
To: gentoo-commits
commit: 5010a66fb5f1213650410f6fa737dc6db96d8b37
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Fri Jul 15 20:41:32 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Fri Jul 15 20:41:32 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=5010a66f
Also, let's NOT trash the log file when things go wrong. REALLY bad idea.
---
create_image.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index 77664f1..cc4e366 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -73,6 +73,7 @@ cleanup_mounts() {
handle_error() {
echo "$1"
cd ${IMAGE_WORK_PATH}
+ mv ${LOG_FILE} ${IMAGES_OUTPUT_PATH}/${BUILD_ID}.log || handle_error "Error moving log file"
cleanup_mounts && rm -rf ${IMAGE_WORK_PATH}
exit 1
}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:webui commit in: /
@ 2011-07-28 1:53 Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-07-28 1:53 UTC (permalink / raw
To: gentoo-commits
commit: 4186feac966e2d1bf32f55282581a7a1d2810e3b
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Thu Jul 28 01:52:53 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Thu Jul 28 01:52:53 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=4186feac
Add initrd support for cached kernels
---
create_image.sh | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index cc4e366..5052202 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -207,8 +207,9 @@ echo "Step 17: Setting up kernel"
# If we got the flag, used a cached kernel to reduce build times for testing
if [[ ${FLAGS_cachedkernel} -eq ${FLAGS_TRUE} ]]; then
echo "Using cached kernel" &>> ${LOG_FILE}
- cp ${TOOL_RES_PATH}/bzImage boot/kernel || handle_error "Error copying cached kernel"
- cp -R ${TOOL_RES_PATH}/kernelmodules/* lib/modules/ || handle_error "Error copying cached kernel modules"
+ cp ${TOOL_RES_PATH}/kernel boot/kernel || handle_error "Error copying cached kernel"
+ cp ${TOOL_RES_PATH}/initrd boot/initrd || handle_error "Error copying cached initrd"
+ cp -R ${TOOL_RES_PATH}/modules/* lib/modules/ || handle_error "Error copying cached kernel modules"
else
echo "Downloading/installing kernel sources" &>> ${LOG_FILE}
linux32 chroot . emerge gentoo-sources &>> ${LOG_FILE} || handle_error "Error emerging kernel sources"
@@ -256,6 +257,9 @@ echo "Step 22: Installing extlinux"
extlinux --heads 255 --sectors 63 --install boot &>> ${LOG_FILE} || handle_error "Error installing extlinux"
dd if=/usr/lib/extlinux/mbr.bin of=../${IMAGE_NAME} conv=notrunc &>> ${LOG_FILE} || handle_error "Error copying extlinux MBR"
cp ${TOOL_RES_PATH}/extlinux.conf boot/ || handle_error "Error copying extlinux configuration"
+if [[ ${FLAGS_cachedkernel} -eq ${FLAGS_TRUE} ]]; then
+ echo -e "\tinitrd initrd" >> boot/extlinux.conf || handle_error "Error adding initrd to bootloader"
+fi
cd ..
cleanup_mounts
case "${OUTPUT_FORMAT}" in
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:webui commit in: /
2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
@ 2011-07-28 4:05 ` Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-07-28 4:05 UTC (permalink / raw
To: gentoo-commits
commit: b044891e43062274aee969118a52f05091edc80d
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Thu Jul 28 01:52:53 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Thu Jul 28 04:05:21 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=b044891e
Add depmod for cachedkernel
---
create_image.sh | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index cc4e366..30084ba 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -207,8 +207,10 @@ echo "Step 17: Setting up kernel"
# If we got the flag, used a cached kernel to reduce build times for testing
if [[ ${FLAGS_cachedkernel} -eq ${FLAGS_TRUE} ]]; then
echo "Using cached kernel" &>> ${LOG_FILE}
- cp ${TOOL_RES_PATH}/bzImage boot/kernel || handle_error "Error copying cached kernel"
- cp -R ${TOOL_RES_PATH}/kernelmodules/* lib/modules/ || handle_error "Error copying cached kernel modules"
+ KERNEL=`ls -l lib/modules/ | cut -d" " -f9`
+ cp ${TOOL_RES_PATH}/kernel boot/kernel || handle_error "Error copying cached kernel"
+ cp -R ${TOOL_RES_PATH}/modules/* lib/modules/ || handle_error "Error copying cached kernel modules"
+ linux32 chroot . depmod -a ${KERNEL}
else
echo "Downloading/installing kernel sources" &>> ${LOG_FILE}
linux32 chroot . emerge gentoo-sources &>> ${LOG_FILE} || handle_error "Error emerging kernel sources"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:webui commit in: /
2011-08-12 23:18 [gentoo-commits] proj/gentoaster:master commit in: / Liam McLoughlin
@ 2011-08-11 20:31 ` Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-08-11 20:31 UTC (permalink / raw
To: gentoo-commits
commit: 12d52e1b1505d415e448193fd1b16c59b6219c23
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Thu Aug 11 20:25:50 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Thu Aug 11 20:25:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=12d52e1b
If the kernel config is out of date, try to use defaults to stop the build from failing
---
create_image.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index 3858dac..f83c1e3 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -232,6 +232,7 @@ else
cp ${TOOL_RES_PATH}/kernelconfig usr/src/linux/.config || handle_error "Error copying kernel config"
echo "Building kernel" &>> ${LOG_FILE}
+ yes "" | linux32 chroot . make -C /usr/src/linux oldconfig &>> ${LOG_FILE} || handle_error "Error configuring kernel"
linux32 chroot . make -C /usr/src/linux -j${NUM_JOBS} &>> ${LOG_FILE} || handle_error "Error building kernel"
echo "Installing kernel" &>> ${LOG_FILE}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:webui commit in: /
@ 2011-08-11 20:31 Liam McLoughlin
0 siblings, 0 replies; 7+ messages in thread
From: Liam McLoughlin @ 2011-08-11 20:31 UTC (permalink / raw
To: gentoo-commits
commit: 20aaffd05379b748bb7455bdbbee2d92a13c370a
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Thu Aug 11 20:19:05 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Thu Aug 11 20:19:05 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=20aaffd0
Added basic installer script and updated README appropriately
---
README | 14 +++++++----
install.php | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/README b/README
index ddf981e..7a06bf4 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
Foreword
=======
-Right now I'm developing this on Ubuntu/Debian, so the following instructions are for those platforms. This will eventually run on Gentoo, of course.
+Right now I'm developing this on Ubuntu/Debian, so the following instructions are for those platforms. If you install the appropriate prerequisites, it will work on Gentoo too, of course.
Prerequisites
@@ -39,16 +39,18 @@ Installation
cd /usr/share
git clone http://git.overlays.gentoo.org/gitroot/proj/gentoaster.git
-
+Configure settings in config.php and web/config.php as appropriate
+Run php5 install.php as root
+Configure a webserver of your choice to server the web folder on the address you specified
Running
=======
-There's no init script for the daemon yet, so simply run as follows:
+The installer will start the daemon for you automatically, but if you need to do this yourself later, run the following as root:
-sudo php5 /usr/share/gentoaster/daemon.php &
+/etc/init.d/gentoaster start
-Note the use of sudo, the daemon MUST be ran as root for it to work, otherwise all builds will fail.
+The daemon MUST be ran as root for it to work, otherwise all builds will fail.
Now that the daemon is running, you can try a build, using the sample client:
@@ -65,3 +67,5 @@ php5 /usr/share/gentoaster/status.php <handle hash>
Where <handle hash> is the hash returned by client.php (for example 6085655f187a8442f82c43ebf98e5fdb)
If the build is still running, you'll get a progress percentage. If it's finished, the return code and result message will be shown.
+
+If you've setup a webserver, you can also use the WebUI at the address you've configured
diff --git a/install.php b/install.php
new file mode 100644
index 0000000..8bb3515
--- /dev/null
+++ b/install.php
@@ -0,0 +1,74 @@
+<?
+
+ // Gentoaster installer
+ // Licensed under GPL v3, see COPYING file
+
+ // Check we're running as root
+ $processUser = posix_getpwuid(posix_geteuid());
+ if($processUser['name'] != "root") {
+ die("This installer must be run as root\n");
+ }
+
+ // Load the configurations (the web config chainloads the daemon config)
+ echo "Loading configuration\n";
+ require_once "web/config.php";
+
+ // Basic configuration path sanity checks
+ echo "Checking configuration sanity\n";
+ if(!file_exists(GENTOASTER_PATH."/install.php")) {
+ die("GENTOASTER_PATH is set incorrectly\n");
+ }
+
+ // Check database configuration is sane
+ echo "Connecting to database\n";
+ $db = new mysqli(
+ MYSQL_HOSTNAME,
+ MYSQL_USERNAME,
+ MYSQL_PASSWORD
+ );
+
+ if (mysqli_connect_errno()) {
+ die("Could not connect to MySQL server: ".mysqli_connect_error()."\n");
+ }
+
+ // If we reached here, MySQL details are fine
+ echo "Database connection is OK\n";
+
+
+ // Make sure we have a dump file to use
+ if (file_exists(GENTOASTER_PATH."/gentoaster.sql")) {
+ // Prep MySQL details for shell args
+ $mysqlHostname = escapeshellarg(MYSQL_HOSTNAME);
+ $mysqlUsername = escapeshellarg(MYSQL_USERNAME);
+ $mysqlDatabase = mysql_escape_string(MYSQL_DATABASE);
+
+ // Create shell component for password if required
+ if (strlen(MYSQL_PASSWORD) > 0) {
+ $mysqlPassword = " -p ".escapeshellarg(MYSQL_PASSWORD)." ";
+ } else {
+ $mysqlPassword = " ";
+ }
+
+ // Drop any existing database here
+ system('echo "DROP DATABASE IF EXISTS '.$mysqlDatabase.';" | mysql -u '.$mysqlUsername.$mysqlPassword);
+
+ // Create a new database
+ system('echo "CREATE DATABASE '.$mysqlDatabase.';" | mysql -u '.$mysqlUsername.$mysqlPassword);
+
+ // Import the database dump into that database
+ system('mysql -u '.$mysqlUsername.$mysqlPassword.$mysqlDatabase.' < gentoaster.sql');
+ } else {
+ die("SQL file not found, check GENTOASTER_PATH\n");
+ }
+
+ // Add the initscript for the daemon
+ echo "Adding initscript symlink\n";
+ system("rm -f /etc/init.d/gentoaster");
+ system("ln -s ".GENTOASTER_PATH."/gentoaster /etc/init.d/gentoaster");
+ system("chmod +x ".GENTOASTER_PATH."/gentoaster");
+
+ echo "Starting Gentoaster daemon\n";
+ exec("/etc/init.d/gentoaster start");
+
+ echo "If you didn't see any errors, the install was successful\n";
+ echo "Try visiting the site at ".GENTOASTER_URL." to make sure everything works\n";
\ No newline at end of file
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] proj/gentoaster:master commit in: /
@ 2011-08-12 23:18 Liam McLoughlin
2011-08-11 20:31 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
0 siblings, 1 reply; 7+ messages in thread
From: Liam McLoughlin @ 2011-08-12 23:18 UTC (permalink / raw
To: gentoo-commits
commit: 12d52e1b1505d415e448193fd1b16c59b6219c23
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Thu Aug 11 20:25:50 2011 +0000
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Thu Aug 11 20:25:50 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=12d52e1b
If the kernel config is out of date, try to use defaults to stop the build from failing
---
create_image.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/create_image.sh b/create_image.sh
index 3858dac..f83c1e3 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -232,6 +232,7 @@ else
cp ${TOOL_RES_PATH}/kernelconfig usr/src/linux/.config || handle_error "Error copying kernel config"
echo "Building kernel" &>> ${LOG_FILE}
+ yes "" | linux32 chroot . make -C /usr/src/linux oldconfig &>> ${LOG_FILE} || handle_error "Error configuring kernel"
linux32 chroot . make -C /usr/src/linux -j${NUM_JOBS} &>> ${LOG_FILE} || handle_error "Error building kernel"
echo "Installing kernel" &>> ${LOG_FILE}
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-12 23:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 23:18 [gentoo-commits] proj/gentoaster:master commit in: / Liam McLoughlin
2011-08-11 20:31 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
-- strict thread matches above, loose matches on Subject: below --
2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
2011-07-28 4:05 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
2011-08-12 23:17 [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
2011-07-15 20:40 ` [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
2011-08-11 20:31 Liam McLoughlin
2011-07-28 1:53 Liam McLoughlin
2011-07-15 20:41 Liam McLoughlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox