summaryrefslogtreecommitdiff
path: root/sys-boot/colo/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-boot/colo/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-boot/colo/files')
-rw-r--r--sys-boot/colo/files/default.colo25
-rw-r--r--sys-boot/colo/files/menu.colo60
-rw-r--r--sys-boot/colo/files/simple.colo19
3 files changed, 104 insertions, 0 deletions
diff --git a/sys-boot/colo/files/default.colo b/sys-boot/colo/files/default.colo
new file mode 100644
index 000000000000..676a038388d1
--- /dev/null
+++ b/sys-boot/colo/files/default.colo
@@ -0,0 +1,25 @@
+#:CoLo:#
+
+# Turn on the serial port
+-serial on
+
+# Generate a menu to select the appropriate kernel image on the LCD Screen
+# Format is:
+# menu "<message>" <time out> <menu text 1> <menu option 1> <menu text 2> <menu option 2> ...
+#
+# Where <menu text> is the item displayed, and <menu option> is the item
+# that the text corresponds to. When a menu item is selected, the env variable
+# {menu-option} gets set to the value of <menu option>.
+#
+# Please note, no sample script has been provided for a backup script (linuxold).
+# You will need to create one yourself if you require this.
+menu "colo-@COLOVER@" 100 Linux linux Linux-OLD linuxold
+
+# Loads the corresponding script depending on the selected value from the menu
+-load /boot/menu-{menu-option}.colo
+-script
+
+# Incase of failure, return to the menu
+load /boot/default.colo
+script
+
diff --git a/sys-boot/colo/files/menu.colo b/sys-boot/colo/files/menu.colo
new file mode 100644
index 000000000000..ddc76135d450
--- /dev/null
+++ b/sys-boot/colo/files/menu.colo
@@ -0,0 +1,60 @@
+#:CoLo:#
+# Example configuration file for CoLo, version 1.16 or above.
+#
+
+# Turn on the serial port; if possible. - means to ignore the error and keep
+# going. Without this, execution would halt here if this command failed (e.g.
+# on Qube 2700; which lacks serial ports)
+-serial on
+
+# Mount the hard drive
+lcd "Mounting hda1"
+mount hda1
+
+# Ask the user... which kernel?
+# Timeout; 50/10 seconds
+#
+# The format is:
+# select "Message Goes Here" TimeOut label1 [label2 ... [labelN]]
+#
+# This will set the {menu-option} variable to the entry corresponding to the
+# selected value, or 0 if no option is selected.
+select "Which Kernel?" 50 Working New
+
+# Now... jump to the line corresponding to the selection...
+#
+# Explaination of the goto command...
+# goto [-]numMarks -- prefixing with - means jump backwards
+# or
+# goto numMarks{b|f} -- b == jump back, f == jump forward
+#
+# Marks are indicated by a line starting with a @ symbol.
+#
+# We use this jump to set the {image-name} variable to a kernel image.
+#
+# Explaination of the var command:
+# var VariableName Value
+#
+
+goto {menu-option}
+
+# {menu-option} = 0; TimeOut or Cancel
+var image-name vmlinux.gz.working
+
+# Skip to the next two @ lines, start at the third @ line.
+goto 3f
+
+# {menu-option} = 1; "Working" selected.
+@var image-name vmlinux.gz.working
+
+goto 2f
+@var image-name vmlinux.gz.new
+
+# Load the requested image
+@lcd "Loading Linux" {image-name}
+load /{image-name}
+
+# Boot
+lcd "Booting..."
+execute root=/dev/hda5 ro console=ttyS0,115200
+boot
diff --git a/sys-boot/colo/files/simple.colo b/sys-boot/colo/files/simple.colo
new file mode 100644
index 000000000000..05574454e811
--- /dev/null
+++ b/sys-boot/colo/files/simple.colo
@@ -0,0 +1,19 @@
+#:CoLo:#
+#
+# Simple CoLo boot script.
+
+# Turn serial on; if possible
+# - means: "ignore any failure", so if the machine has no serial device (such as
+# a Qube 2700), it will simply pretend the command never happened.
+-serial on
+
+# Mount the hard drive
+mount hda1
+
+# Loads the kernel into memory (and unzips if needed)
+# Makes sure this points at the correct kernel image
+load /boot/kernel.gz
+
+# Executes the loaded image with the specified command args
+# Change these args to suit your purposes
+execute root=/dev/hda5 console=ttyS0,115200