splitting spinbase for more flexibility
This commit is contained in:
+29
@@ -0,0 +1,29 @@
|
||||
FROM plabedan/gentoo
|
||||
|
||||
# Set locales to en_US.UTF-8
|
||||
RUN echo "en_US.UTF-8 UTF-8 " >> /etc/locale.gen && locale-gen && eselect locale set en_US.utf8 && env-update && source /etc/profile
|
||||
ENV LC_ALL=en_US.UTF-8
|
||||
|
||||
# Upgrading portage
|
||||
RUN emerge --sync > /dev/null 2>&1 && layman -a sabayon
|
||||
|
||||
# Configure the sabayon box, installing equo setting up locales
|
||||
ADD ./script/sabayon-configuration.sh /
|
||||
RUN /bin/bash /sabayon-configuration.sh && rm -rf /sabayon-configuration.sh
|
||||
|
||||
# Generating empty equo db
|
||||
ADD ./script/generate-equo-db.sh /
|
||||
ADD ./ext/equo.sql /
|
||||
RUN /bin/bash /generate-equo-db.sh && rm -rf /equo.sql /generate-equo-db.sh
|
||||
|
||||
# Calling equo rescue generate, unfortunately we have to use expect
|
||||
ADD ./script/equo-rescue-generate.exp /
|
||||
RUN /usr/bin/expect /equo-rescue-generate.exp && rm -rf /equo-rescue-generate.exp
|
||||
|
||||
# Portage configurations
|
||||
ADD ./script/sabayon-configuration-build.sh /sabayon-configuration-build.sh
|
||||
RUN /bin/bash /sabayon-configuration-build.sh && rm -rf /sabayon-configuration-build.sh
|
||||
|
||||
# Perform before-upgrade tasks (mirror sorting, updating repository db, removing portage and keeping profiles and metadata)
|
||||
RUN mv /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org.example /etc/entropy/repositories.conf.d/entropy_sabayonlinux.org && equo up && equo repo mirrorsort sabayonlinux.org && cd /usr/portage/;ls | grep -v 'profiles' | grep -v 'metadata' | xargs rm -rf
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# Sabayon base: a Docker Project #
|
||||
|
||||
Attention! It's under strong development
|
||||
|
||||
State: Alpha
|
||||
|
||||
The purpose of this project is to provide an image of Sabayon base.
|
||||
It is just a gentoo stage3 + entropy
|
||||
|
||||
UPDATE: Images are also on Docker Hub [sabayon/base-amd64](https://registry.hub.docker.com/u/sabayon/base-amd64/) and the already squashed image,
|
||||
[sabayon/base-amd64-squashed](https://registry.hub.docker.com/u/sabayon/base-amd64-squashed/)
|
||||
|
||||
## First steps on docker
|
||||
|
||||
Ensure to have the daemon started and running:
|
||||
|
||||
sudo systemctl start docker
|
||||
|
||||
## Building sabayon-base locally
|
||||
|
||||
git clone https://github.com/mudler/docker-sabayon-base-amd64.git docker-sabayon-base
|
||||
cd docker-sabayon-base
|
||||
sudo docker build -t sabayon/base-amd64 .
|
||||
|
||||
## Pulling sabayon-base from Docker Hub
|
||||
|
||||
sudo docker pull sabayon/base-amd64
|
||||
|
||||
## Converting the image from Docker to use it with [Molecules](https://github.com/Sabayon/molecules)
|
||||
|
||||
### Only with undocker, without squashing the layers
|
||||
|
||||
After pulling the docker image, install [undocker](https://github.com/larsks/undocker/) and then as root:
|
||||
|
||||
docker save sabayon/base-amd64:latest | undocker -i -o base sabayon/base-amd64:latest
|
||||
|
||||
### Using [docker-squash](https://github.com/jwilder/docker-squash)
|
||||
You can also squash the image with [docker-squash](https://github.com/jwilder/docker-squash) and then extract your layers.
|
||||
|
||||
sudo docker save sabayon/base-amd64:latest | sudo TMPDIR=/dev/shm docker-squash -t sabayon/base-amd64:squashed > /your/prefered/path/base.tar
|
||||
|
||||
You can replace /dev/shm with your prefered tmpdir
|
||||
|
||||
### With undocker, but squashing the layers
|
||||
|
||||
The squash can also been accomplished creating a container from the image, exporting it and then importing it back.
|
||||
|
||||
sudo docker run -t -i sabayon/base-amd64:latest /bin/bash
|
||||
$ exit # You should drop in a shell, exit, you should see a container id, otherwise find it :
|
||||
sudo docker ps -l
|
||||
sudo docker export <CONTAINER ID> | docker import - sabayon/base-amd64:squashed
|
||||
docker save sabayon/base-amd64:squashed | undocker -i -o base sabayon/base-amd64:squashed
|
||||
|
||||
Docker will loose the history revision and then you can estract the layer, using as base for chroot.
|
||||
|
||||
You now have the tree on the *base/* directory
|
||||
|
||||
If you are planning to use the resulting files as a chroot, don't forget to set a nameserver on resolv.conf file
|
||||
|
||||
echo "nameserver 208.67.222.222" > base/etc/resolv.conf
|
||||
|
||||
+300
@@ -0,0 +1,300 @@
|
||||
BEGIN TRANSACTION;
|
||||
CREATE TABLE IF NOT EXISTS baseinfo (
|
||||
idpackage INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
atom VARCHAR,
|
||||
category VARCHAR,
|
||||
name VARCHAR,
|
||||
version VARCHAR,
|
||||
versiontag VARCHAR,
|
||||
revision INTEGER,
|
||||
branch VARCHAR,
|
||||
slot VARCHAR,
|
||||
license VARCHAR,
|
||||
etpapi INTEGER,
|
||||
trigger INTEGER
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS extrainfo (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
description VARCHAR,
|
||||
homepage VARCHAR,
|
||||
download VARCHAR,
|
||||
size VARCHAR,
|
||||
chost VARCHAR,
|
||||
cflags VARCHAR,
|
||||
cxxflags VARCHAR,
|
||||
digest VARCHAR,
|
||||
datecreation VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS content (
|
||||
idpackage INTEGER,
|
||||
file VARCHAR,
|
||||
type VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS contentsafety (
|
||||
idpackage INTEGER,
|
||||
file VARCHAR,
|
||||
mtime FLOAT,
|
||||
sha256 VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS provide (
|
||||
idpackage INTEGER,
|
||||
atom VARCHAR,
|
||||
is_default INTEGER DEFAULT 0,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS dependencies (
|
||||
idpackage INTEGER,
|
||||
iddependency INTEGER,
|
||||
type INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS dependenciesreference (
|
||||
iddependency INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
dependency VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS conflicts (
|
||||
idpackage INTEGER,
|
||||
conflict VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS mirrorlinks (
|
||||
mirrorname VARCHAR,
|
||||
mirrorlink VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS sources (
|
||||
idpackage INTEGER,
|
||||
idsource INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS sourcesreference (
|
||||
idsource INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
source VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS useflags (
|
||||
idpackage INTEGER,
|
||||
idflag INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS useflagsreference (
|
||||
idflag INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
flagname VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS keywords (
|
||||
idpackage INTEGER,
|
||||
idkeyword INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS keywordsreference (
|
||||
idkeyword INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
keywordname VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS configprotect (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
idprotect INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS configprotectmask (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
idprotect INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS configprotectreference (
|
||||
idprotect INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
protect VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS systempackages (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS injected (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS installedtable (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
repositoryname VARCHAR,
|
||||
source INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS sizes (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
size INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS counters (
|
||||
counter INTEGER,
|
||||
idpackage INTEGER,
|
||||
branch VARCHAR,
|
||||
PRIMARY KEY(idpackage,branch),
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS trashedcounters (
|
||||
counter INTEGER
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS needed_libs (
|
||||
idpackage INTEGER,
|
||||
lib_user_path VARCHAR,
|
||||
lib_user_soname VARCHAR,
|
||||
soname VARCHAR,
|
||||
elfclass INTEGER,
|
||||
rpath VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS provided_libs (
|
||||
idpackage INTEGER,
|
||||
library VARCHAR,
|
||||
path VARCHAR,
|
||||
elfclass INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS treeupdates (
|
||||
repository VARCHAR PRIMARY KEY,
|
||||
digest VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS treeupdatesactions (
|
||||
idupdate INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
repository VARCHAR,
|
||||
command VARCHAR,
|
||||
branch VARCHAR,
|
||||
date VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS licensedata (
|
||||
licensename VARCHAR UNIQUE,
|
||||
text BLOB,
|
||||
compressed INTEGER
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS licenses_accepted (
|
||||
licensename VARCHAR UNIQUE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS triggers (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
data BLOB,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS entropy_misc_counters (
|
||||
idtype INTEGER PRIMARY KEY,
|
||||
counter INTEGER
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS categoriesdescription (
|
||||
category VARCHAR,
|
||||
locale VARCHAR,
|
||||
description VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagesets (
|
||||
setname VARCHAR,
|
||||
dependency VARCHAR
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagechangelogs (
|
||||
category VARCHAR,
|
||||
name VARCHAR,
|
||||
changelog BLOB,
|
||||
PRIMARY KEY (category, name)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS automergefiles (
|
||||
idpackage INTEGER,
|
||||
configfile VARCHAR,
|
||||
md5 VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagedesktopmime (
|
||||
idpackage INTEGER,
|
||||
name VARCHAR,
|
||||
mimetype VARCHAR,
|
||||
executable VARCHAR,
|
||||
icon VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagedownloads (
|
||||
idpackage INTEGER,
|
||||
download VARCHAR,
|
||||
type VARCHAR,
|
||||
size INTEGER,
|
||||
disksize INTEGER,
|
||||
md5 VARCHAR,
|
||||
sha1 VARCHAR,
|
||||
sha256 VARCHAR,
|
||||
sha512 VARCHAR,
|
||||
gpg BLOB,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS provided_mime (
|
||||
mimetype VARCHAR,
|
||||
idpackage INTEGER,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagesignatures (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
sha1 VARCHAR,
|
||||
sha256 VARCHAR,
|
||||
sha512 VARCHAR,
|
||||
gpg BLOB,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagespmphases (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
phases VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS packagespmrepository (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
repository VARCHAR,
|
||||
FOREIGN KEY(idpackage)
|
||||
REFERENCES baseinfo(idpackage) ON DELETE CASCADE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS entropy_branch_migration (
|
||||
repository VARCHAR,
|
||||
from_branch VARCHAR,
|
||||
to_branch VARCHAR,
|
||||
post_migration_md5sum VARCHAR,
|
||||
post_upgrade_md5sum VARCHAR,
|
||||
PRIMARY KEY (repository, from_branch, to_branch)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS preserved_libs (
|
||||
library VARCHAR,
|
||||
elfclass INTEGER,
|
||||
path VARCHAR,
|
||||
atom VARCHAR,
|
||||
PRIMARY KEY (library, path, elfclass)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS xpakdata (
|
||||
idpackage INTEGER PRIMARY KEY,
|
||||
data BLOB
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS settings (
|
||||
setting_name VARCHAR,
|
||||
setting_value VARCHAR,
|
||||
PRIMARY KEY(setting_name)
|
||||
);
|
||||
INSERT INTO "settings" VALUES('arch', 'amd64');
|
||||
INSERT INTO "settings" VALUES('on_delete_cascade', '1');
|
||||
INSERT INTO "settings" VALUES('_baseinfo_extrainfo_2010', '1');
|
||||
INSERT INTO "settings" VALUES('schema_revision', '6');
|
||||
COMMIT;
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
# no need for timeout 1
|
||||
set timeout -1
|
||||
|
||||
spawn equo rescue generate
|
||||
|
||||
expect {
|
||||
"*Understood*" { send "Yes\r\n" ; exp_continue }
|
||||
"*Really*" { send "Yes\r\n" ; exp_continue }
|
||||
"*Ok*" { send "Yes\r\n" ; exp_continue }
|
||||
"*generation complete*" { sleep 3; send "exit\r"; exit }
|
||||
# timeout { puts "timed out during generation"; exit 1 }
|
||||
}
|
||||
|
||||
expect EOF
|
||||
|
||||
puts $expect_out(buffer)
|
||||
|
||||
lassign [wait] pid spawnid os_error_flag value
|
||||
|
||||
if {$os_error_flag == 0} {
|
||||
puts "exit status: $value"
|
||||
} else {
|
||||
puts "errno: $value"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p /var/lib/entropy/client/database/amd64
|
||||
cd /var/lib/entropy/client/database/amd64
|
||||
cat /equo.sql | sqlite3 equo.db
|
||||
|
||||
# remove files used to generate a correct equo db
|
||||
rm -rfv /equo.sql
|
||||
rm -rfv /generate-equo-db.sh
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# fetch the bits!
|
||||
cd /opt
|
||||
git clone git://github.com/Sabayon/build.git sabayon-build
|
||||
cd /opt/sabayon-build/conf/intel/portage
|
||||
# keep your specific stuff in "myconf" branch:
|
||||
git checkout -b myconf
|
||||
# symlink to your <arch>:
|
||||
ln -sf make.conf.amd64 make.conf
|
||||
ln -sf package.env.amd64 package.env
|
||||
# add & commit
|
||||
git add make.conf package.env
|
||||
git config --global user.name "root"
|
||||
git config --global user.email "root@localhost"
|
||||
git commit -m "saving my configurations"
|
||||
# rename the gentoo /etc/make.conf and /etc/portage/:
|
||||
cd /etc/
|
||||
mv portage portage-gentoo
|
||||
#mv make.conf make.conf-gentoo
|
||||
# symlink to sabayon /etc/make.conf /etc/portage/:
|
||||
ln -sf /opt/sabayon-build/conf/intel/portage portage
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setting locale.conf
|
||||
for f in /etc/env.d/02locale /etc/locale.conf; do
|
||||
echo LANG=en_US.UTF-8 > "${f}"
|
||||
echo LANGUAGE=en_US.UTF-8 >> "${f}"
|
||||
echo LC_ALL=en_US.UTF-8 >> "${f}"
|
||||
done
|
||||
|
||||
# Defyning /usr/local/portage configuration
|
||||
mkdir /usr/local/portage
|
||||
mkdir -p /usr/local/portage/metadata/
|
||||
mkdir -p /usr/local/portage/profiles/
|
||||
echo "masters = gentoo" > /usr/local/portage/metadata/layout.conf
|
||||
echo "user_defined" > /usr/local/portage/profiles/repo_name
|
||||
|
||||
emerge -C =dev-python/python-exec-0.3.1
|
||||
|
||||
mkdir -p /etc/portage/package.keywords/
|
||||
echo "app-admin/equo ~amd64
|
||||
sys-apps/entropy ~amd64
|
||||
" > /etc/portage/package.keywords/00-sabayon.package.keywords
|
||||
|
||||
mkdir -p /etc/portage/package.use/
|
||||
echo "dev-lang/python sqlite
|
||||
sys-apps/file python
|
||||
" > /etc/portage/package.use/00-sabayon.package.use
|
||||
|
||||
|
||||
# emerging equo and expect
|
||||
emerge -vt equo --autounmask-write || exit 1
|
||||
emerge expect || exit 1
|
||||
|
||||
# Choosing only python2.7 for now, cleaning others
|
||||
eselect python set python2.7
|
||||
|
||||
# Removing other versions of python
|
||||
emerge -C python:3.2 python:3.3
|
||||
|
||||
# Specifying a gentoo profile
|
||||
eselect profile set default/linux/amd64/13.0/desktop
|
||||
|
||||
# default to opendns for next stage(s)
|
||||
echo "nameserver 208.67.222.222" > /etc/resolv.conf
|
||||
|
||||
# set default shell
|
||||
chsh -s /bin/bash
|
||||
|
||||
rm -rf /etc/make.profile
|
||||
|
||||
|
||||
Reference in New Issue
Block a user