Home

Cum este construit Kogaion - Partea I?!?

Cum este construit Kogaion?!?

Fiind la esenta un Gentoo, constructia Kogaion incepe cu o arhiva Gentoo stage3. Primii pasi sunt aceeasi din Ghidul de Instalare Gentoo. Practic efectuam o instalare Gentoo pana la un anumit punct. In aceasta faza de inceput, nu ne putem folosi de insfrastructura deja existenta a Kogaion, pentru ca vom crea conflicte cu Gentoo stage3, prin urmare constructia trebuie facuta treptat, manual. Toate configurarile necesare viitorului Kogaion sunt adaugate pas cu pas. Inclusiv Kernelul este compilat manual, acesta urmand a fi inlocuit ulterior.

Dupa aproximativ 6 ore de compilat, rezolvat conflicte, ajustat dependinte, avem un Gentoo bootabil in CLI. Chiar daca acest Gentoo este aproape gata pentru a fi utilizat, nu este suficient pentru a fi nucleul Kogaion. In acest moment intra in scena prima parte din infrastructura noastra, si anume overlayul Kogaion(kogaion-desktop) alaturi de configurarile portage Kogaion (kogaion-build). Totul este recompilat in functie de modificarile aduse de kogaion-build. Kernelul este recompilat si inlocuit. Ca totul sa fie interconectat cat mai bine, recompilarea are loc de 3 ori consecutiv. Dureaza aproximativ 12 ore.

Dupa acest pas, infrastructura noastra este eliminata, toate urmele sunt sterse, ce ramane in urma fiind un Gentoo pur, dar configurat astfel incat sa devina nucleul Kogaion. Acest nucleu contine aproximativ 400 de pachete si este gata pentru a fi folosit pentru a construi sistemul final. Asa ca este comprimat folosind squashfs, fiind redus la o dimensiune foarte mica ~300Mb. Este generat fisierul de integritate al nucleului.

Fiind comprimat squashfs, inseamna ca este defapt readonly, nu se va modifica niciodata (decat daca dorim noi sa il actualizam cu noile pachete). Dar cum construiesti un sistem bazat pe un nucleu readonly?

Aici intra in scena a doua parte a infrastrucrii noastre, si anume Vasile. Acesta face 3 lucruri : compileaza pachetele in acel nucleu readonly, genereaza o imagine iso folosind ca baza acel nucleu readonly si resincronizeaza Kogaion cu Gentoo.

Pentru a compila pachete, are nevoie totusi sa scrie in acel nucleu readonly. Dar nu neaparat. Folosindu-se de tehnologii direct din kernel : overlayfs, squashfs, loop devices, mounteaza imaginea readonly intr-un punct predefinit, apoi aplica un layer rw (readwrite) peste, iar la final monteaza totul folosind overlayfs. In acest timp verifica daca integritatea nucleului este intacta, injecteaza in layerul rw : kogaion-desktop si kogaion-build, adica prima parte a infrastructurii. Intr-un final leaga totul la un loc folosind overlayfs, rezultatul fiind o clona a nucleului Kogaion, dar rw. Prin urmare trece la compilarea pachetelor. Un output arata cam asa :
buildserver kogaionx64 # ls
distfiles  kogaion_3_core_x64.squashfs  kogaion_3_core_x64.squashfs.md5  makeresyncpkglist  overlaydir  packages  resyncpkglist  rodir  rwdir  squashpkglist  workdir
buildserver kogaionx64 # kvasile --makepkg numepachet

Kernel configuration seems OK, moving on

good, squashed chroot && checksum file found ... verifying integrity

good, squashed chroot checksum passed ... starting engines

injecting kogaion desktop overlay into build environment

 * Fetching remote list,...
 * Fetching new list... https://gitlab.com/kogaion/kogaion-desktop/raw/master/overlay.xml
 * Last-modified: Thu, 18 Aug 2016 19:57:31 GMT
 * Fetching new list... http://www.gentoo.org/proj/en/overlays/repositories.xml
 * Last-modified: Sat, 13 Aug 2016 15:10:16 GMT
 * Fetch Ok

 * Adding overlay,...
 * Running Git... # ( cd /var/lib/layman  && /usr/bin/git clone https://gitlab.com/kogaion/kogaion-desktop.git /var/lib/layman/kogaion-desktop )
Cloning into '/var/lib/layman/kogaion-desktop'...
remote: Counting objects: 9515, done.
remote: Compressing objects: 100% (5343/5343), done.
remote: Total 9515 (delta 3920), reused 9509 (delta 3918)
Receiving objects: 100% (9515/9515), 107.92 MiB | 10.09 MiB/s, done.
Resolving deltas: 100% (3920/3920), done.
Checking connectivity... done.
 * Running Git... # ( cd /var/lib/layman/kogaion-desktop  && /usr/bin/git config user.name "layman" )
 * Running Git... # ( cd /var/lib/layman/kogaion-desktop  && /usr/bin/git config user.email "layman@localhost" )
 * Successfully added overlay(s) kogaion-desktop.

injecting kogaion buildsystem && setting up portage

Cloning into 'kogaion-build'...
remote: Counting objects: 3039, done.
remote: Compressing objects: 100% (1233/1233), done.
remote: Total 3039 (delta 1009), reused 3031 (delta 1007)
Receiving objects: 100% (3039/3039), 315.27 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1009/1009), done.
Checking connectivity... done.

injecting full portage tree into build environment

remote: Counting objects: 114413, done.
remote: Compressing objects: 100% (101470/101470), done.
remote: Total 114413 (delta 14444), reused 80888 (delta 11697)
Receiving objects: 100% (114413/114413), 57.06 MiB | 9.11 MiB/s, done.
Resolving deltas: 100% (14444/14444), done.
From git://anongit.gentoo.org/repo/gentoo
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
Checking out files: 100% (100150/100150), done.
Branch master set up to track remote branch master from origin.
>>> Regenerating /etc/ld.so.cache...

Environment is up && running ... building targets
Pachetul compilat este adaugat automat in index si transferat in directorul "packages". Acest director este defapt repo original, locul de nastere al pachetelor Kogaion. Este sincronizat periodic cu repo oficial, cel de pe care utilizatorii nostri dragi descarca pachetele.

Va urma !

18.08.2016. 20:06

Kogaion news

It's been a really quiet week. Not many changes, but some of them worth mentioning.

First, nm-applet will be dropped from repository in the next few days. Don't worry, a replacement is already available : nm-applet-gtk2 . I opted for this change because we ship with Xfce and Mate as DE's, and both are based on GTK2. Users won't notice pretty much any difference, since is basically the very same thing, but linked against a different toolkit. It will integrate better into the DE though. GTK3 seems to have a major issue with scaling.

I urge the users to do the switch sooner rather than later :
epkg update
epkg remove nm-applet
epkg install nm-applet-gtk2

Logout/Login and done!

Second, some new packages landed into repository : inxi, ntp, inkscape!

And that's pretty much it, untill next time, enjoy Kogaion!

07.05.2016. 18:57

What's cooking ?!?

Yesterday I discovered that the proprietary Nvidia 361.28 drivers we ship in Kogaion suffer from a stupid regression that manifests itself only in Steam, and only in Source engine games (CS:GO, CS:Source). Even if Steam itself reads the system information correctly, trying to play one of those games will fail because of, wait for it : OpenGL version 0.0.0 !!! So instead of OpenGL 4.5, the drivers report a never released version of OpenGL. A fixed driver has been released, but that is marked as unstable in Gentoo, so I really wanted to avoid it. Instead, after some digging I was able to find a small workaround. Applied it to Steam ebuild, and fixed packages are already in repo.

On the other hand, I thought maybe is the right time to fulfill yet another uncovered area in Kogaion, so starting today, Fedora's firewalld is available in repos. Is the first time I play with it, but seems to me, it will cover all the needs.

And last but not least, Handbrake also joins our growing repository. I had a huge request for it, so there you go.

03.05.2016. 17:33

Kogaion : the uncomprehended distribution

It's been a while since last time I wrote in here, and for a good reason. I failed to see any reason to do so, mainly because I tried to use Facebooks Groups potential in order to communicate with people, to get feedback more quickly. But last days I finally saw it: It was the biggest mistake I've done related to Kogaion, so I demoted and removed myself from there.

There are several reasons I did that, but the biggest one is because people tend to skip the feedback alltogether and focus on feature requests. They tend to compare Kogaion with other distros and argue my design decisions for it, based on "why it works in Ubuntu ". I'm totally fine having technical arguments, but that one is far from such a thing.

For instance users tend to ask :
- Why burning a USB drive with unetbootin works with a Ubuntu iso, but not with a Kogaion iso ?!?
My typical answer for such a question would be :
- Because Ubuntu ISOs are using isolinux/syslinux to boot, while Kogaion ISOs are using grub.

Questioning itself alone is OK, I'm totally fine answering if something is unclear. But some people don't even know what they're asking and throw in a theory : the ISO is fucked up . NO it's not, the ISO is totally fine, it is like that by design! I fail to see any reason to have 10 bootloaders into an ISO image, just because there are 10 tools that write ISO images in 10 different ways.

IF someone finds one, please let me know. But if you cannot sustain your reasoning with technical arguments, it will be ignored.

01.05.2016. 21:35

Hacked Entropy : the package manager of Sabayon

RogentOS/Kogaion/Argent are cooking nicely at low fire. Last week, we, developers agreed upon the packages that would go into the core of the distribution, aka into the Spinbase. I took the responsability to build the Spinbase from scratch, using Gentoo stage3 image and started to work. After pretty much a day of working, building, fixing conflicts bla bla bla, the core of Kogaion was ready. Since we're gonna provide a binary distribution, the last step was to add a binary package manager. Not much choice in here and I went on Entropy, the package manager from Sabayon.
And here the problems started. Entropy under no circumstances would create a package database. I overlooked on Sabayon wiki, I searched on Google and everything pointed to same solution :
equo rescue generate
That wouldn't work however.
Frustrated, I leaved it away for a couple of days. But as you know, nothing good is gonna happen unless it's 2 AM. In the middle of the night an idea popped out. I can create database myself, if I know what tables and rows it contains. And this worked, but it was kinda tricky to find what tables and rows are in the non-existent database.
First things first, knowing that Entropy databases are sqlite3, I created an empty sqlite3 database :
cd /var/lib/entropy/client/database/amd64
sqlite3 equo.db
Inside that database I created one random table, and saved it :
sqlite3 equo.db
SQLite version 3.8.7.4 2014-12-09 01:34:36
Enter ".help" for usage hints.
sqlite> create table randomtable(randomvalue);
sqlite> .quit
Tried to create the database one more time :
underworld amd64 # equo rescue generate
☛  !!! System database not found or corrupted, running in safe mode using temporary, empty repository
☛  !!! System database not found or corrupted, running in safe mode using temporary, empty repository
☛ Attention: the Installed Packages repository will be re-generated using the Source Package Manager
☛ Attention: I am not joking, this is quite disruptive
  Understood ? [Yes/No] yes
  Really ? [Yes/No] yes
  This is your last chance. Ok? [Yes/No] yes
╠  @@ Creating a backup of the current repository
╠   /var/lib/entropy/client/database/amd64/equo.db
╠    Database Export complete.
╠  @@ Repository backed up successfully: entropy_backup___system__.2015225_12h50m23s.backup.bz2
╠  @@ Initializing a new repository
╠   /var/lib/entropy/client/database/amd64/equo.db
And this is where the fun things starts. Even if I created an empty database with only one random table in it, Entropy would see it as a valid database and would create a backup for it. But in that backup, it would write every tables and rows that I need to create a valid database :
bzcat entropy_backup___system__.2015225_12h50m23s.backup.bz2 
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;
Having all what I needed, was easy for me to create a valid database :
 sqlite3 equo.db
SQLite version 3.8.7.4 2014-12-09 01:34:36
Enter ".help" for usage hints.
sqlite> BEGIN TRANSACTION;
sqlite> 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
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS content (
   ...>                     idpackage INTEGER,
   ...>                     file VARCHAR,
   ...>                     type VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS contentsafety (
   ...>                     idpackage INTEGER,
   ...>                     file VARCHAR,
   ...>                     mtime FLOAT,
   ...>                     sha256 VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS provide (
   ...>                     idpackage INTEGER,
   ...>                     atom VARCHAR,
   ...>                     is_default INTEGER DEFAULT 0,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS dependencies (
   ...>                     idpackage INTEGER,
   ...>                     iddependency INTEGER,
   ...>                     type INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS dependenciesreference (
   ...>                     iddependency INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     dependency VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS conflicts (
   ...>                     idpackage INTEGER,
   ...>                     conflict VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS mirrorlinks (
   ...>                     mirrorname VARCHAR,
   ...>                     mirrorlink VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS sources (
   ...>                     idpackage INTEGER,
   ...>                     idsource INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS sourcesreference (
   ...>                     idsource INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     source VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS useflags (
   ...>                     idpackage INTEGER,
   ...>                     idflag INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS useflagsreference (
   ...>                     idflag INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     flagname VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS keywords (
   ...>                     idpackage INTEGER,
   ...>                     idkeyword INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS keywordsreference (
   ...>                     idkeyword INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     keywordname VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS configprotect (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     idprotect INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS configprotectmask (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     idprotect INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS configprotectreference (
   ...>                     idprotect INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     protect VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS systempackages (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS injected (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS installedtable (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     repositoryname VARCHAR,
   ...>                     source INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS sizes (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     size INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS trashedcounters (
   ...>                     counter INTEGER
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS provided_libs (
   ...>                     idpackage INTEGER,
   ...>                     library VARCHAR,
   ...>                     path VARCHAR,
   ...>                     elfclass INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS treeupdates (
   ...>                     repository VARCHAR PRIMARY KEY,
   ...>                     digest VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS treeupdatesactions (
   ...>                     idupdate INTEGER PRIMARY KEY AUTOINCREMENT,
   ...>                     repository VARCHAR,
   ...>                     command VARCHAR,
   ...>                     branch VARCHAR,
   ...>                     date VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS licensedata (
   ...>                     licensename VARCHAR UNIQUE,
   ...>                     text BLOB,
   ...>                     compressed INTEGER
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS licenses_accepted (
   ...>                     licensename VARCHAR UNIQUE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS triggers (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     data BLOB,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS entropy_misc_counters (
   ...>                     idtype INTEGER PRIMARY KEY,
   ...>                     counter INTEGER
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS categoriesdescription (
   ...>                     category VARCHAR,
   ...>                     locale VARCHAR,
   ...>                     description VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS packagesets (
   ...>                     setname VARCHAR,
   ...>                     dependency VARCHAR
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS packagechangelogs (
   ...>                     category VARCHAR,
   ...>                     name VARCHAR,
   ...>                     changelog BLOB,
   ...>                     PRIMARY KEY (category, name)
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS automergefiles (
   ...>                     idpackage INTEGER,
   ...>                     configfile VARCHAR,
   ...>                     md5 VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS provided_mime (
   ...>                     mimetype VARCHAR,
   ...>                     idpackage INTEGER,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> 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
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS packagespmphases (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     phases VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS packagespmrepository (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     repository VARCHAR,
   ...>                     FOREIGN KEY(idpackage)
   ...>                         REFERENCES baseinfo(idpackage) ON DELETE CASCADE
   ...>                 );
sqlite> 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)
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS preserved_libs (
   ...>                     library VARCHAR,
   ...>                     elfclass INTEGER,
   ...>                     path VARCHAR,
   ...>                     atom VARCHAR,
   ...>                     PRIMARY KEY (library, path, elfclass)
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS xpakdata (
   ...>                     idpackage INTEGER PRIMARY KEY,
   ...>                     data BLOB
   ...>                 );
sqlite> CREATE TABLE IF NOT EXISTS settings (
   ...>                     setting_name VARCHAR,
   ...>                     setting_value VARCHAR,
   ...>                     PRIMARY KEY(setting_name)
   ...>                 );
sqlite> INSERT INTO "settings" VALUES('arch', 'amd64');
sqlite> INSERT INTO "settings" VALUES('on_delete_cascade', '1');
sqlite> INSERT INTO "settings" VALUES('_baseinfo_extrainfo_2010', '1');
sqlite> INSERT INTO "settings" VALUES('schema_revision', '6');
sqlite> COMMIT;
sqlite> .quit
Now the database is in place, and ready to be populated with the packages I installed with Portage :
equo rescue spmsync
And it's done. Packages are added to the database, so I can start manage the system using Entropy instead of Portage.

Comments (0) 25.02.2015. 11:08

<< First < Previous [1 / 12] Next > Last >>