Skip to content

Commit

Permalink
add boot scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Dec 7, 2023
1 parent cb9d61b commit f9b13f4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ install: install-lib ## Install the binaries
install -Dm755 scripts/arch-chroot $(DESTDIR)$(PREFIX)/sbin/arch-chroot
install -Dm755 scripts/genfstab $(DESTDIR)$(PREFIX)/sbin/genfstab
install -Dm755 scripts/pull_calaos_image $(DESTDIR)$(PREFIX)/sbin/pull_calaos_image
install -Dm755 scripts/config_calaos-boot $(DESTDIR)$(PREFIX)/sbin/config_calaos-boot
2 changes: 1 addition & 1 deletion debian/calaos-boot.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Before=basic.target

[Service]
Type=oneshot
ExecStart=/usr/bin/calaos-boot.sh
ExecStart=/usr/sbin/config_calaos-boot

StandardOutput=tty
TTYPath=/dev/tty2
Expand Down
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export GOCACHE=/tmp

override_dh_installsystemd:
dh_installsystemd --name=calaos-container
dh_installsystemd --name=calaos-boot
dh_installsystemd --name=grub-btrfsd --no-enable

override_dh_gencontrol:
Expand Down
59 changes: 59 additions & 0 deletions scripts/config_calaos-boot
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

set -e

NOCOLOR='\033[0m'
CYAN='\033[0;36m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LIGHTGRAY='\033[0;37m'
DARKGRAY='\033[1;30m'
LIGHTRED='\033[1;31m'
LIGHTGREEN='\033[1;32m'
YELLOW='\033[1;33m'
LIGHTBLUE='\033[1;34m'
LIGHTPURPLE='\033[1;35m'
LIGHTCYAN='\033[1;36m'
WHITE='\033[1;37m'

color()
{
echo -e "$1$*${NOCOLOR}"
}

color "${LIGHTBLUE}" " ██████╗ █████╗ ██╗ █████╗ ██████╗ ███████╗ ██████╗ ███████╗"
color "${LIGHTBLUE}" "██╔════╝██╔══██╗██║ ██╔══██╗██╔═══██╗██╔════╝ ██╔═══██╗██╔════╝"
color "${LIGHTBLUE}" "██║ ███████║██║ ███████║██║ ██║███████╗█████╗██║ ██║███████╗"
color "${LIGHTBLUE}" "██║ ██╔══██║██║ ██╔══██║██║ ██║╚════██║╚════╝██║ ██║╚════██║"
color "${LIGHTBLUE}" "╚██████╗██║ ██║███████╗██║ ██║╚██████╔╝███████║ ╚██████╔╝███████║"
color "${LIGHTBLUE}" " ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝"
echo
echo
color "${PURPLE}" "Welcome to Calaos-OS!"
echo
color "${CYAN}" "Calaos-OS is currently initializing. Please wait..."
color "${CYAN}" "This can take a few minutes. Please be patient."
echo
echo

source_files=(/usr/share/calaos/*.source)

for source_file in "${source_files[@]}"; do
image_src=$(<"$source_file")
ct_name=$(basename "$source_file" .source)

load_containers_cache "$ct_name" "$image_src"
done

echo
color "${GREEN}" "Initialization done!"
echo "Continuing boot..."
echo
sleep 2

# change back to main console
chvt 1

0 comments on commit f9b13f4

Please sign in to comment.