Commit d8121cc7 authored by Luca Giambonini's avatar Luca Giambonini

Introduced ISO creation based on profiles

the build script is able to build the ISO based on a defined profile
the packages.conf are divided in two files, the packages_base.conf and the packages.conf
parent 248b1c0d
Pipeline #463 skipped with stages
#!/usr/bin/env python3
from src import container
from src import iso
from src import helper
import os
import sys
from os.path import join as pjoin
from optparse import OptionParser
datadir = os.path.abspath("./data")
configdir = os.path.abspath(sys.argv[1]) if len(sys.argv) > 1 else os.path.abspath("./config")
outputdir = os.path.abspath("./iso_build")
def read_package_list(package_config):
"""Read the file :package_list and return a list of packages"""
packages = ""
with open(package_config) as package_list:
# TODO: that can be done with a list comprehension...
for line in package_list:
line = line.strip()
if not line or line.startswith("#"):
continue
packages = " ".join((packages, line))
return packages.strip().split()
if __name__ == "__main__":
locale_archive = "./locale-archive" # FIXME
if not os.path.isfile(locale_archive):
locale_archive = None
else:
locale_archive = os.path.abspath(locale_archive)
package_list = read_package_list(pjoin(configdir, "packages.conf"))
postinstall_package_list = read_package_list(pjoin(configdir, "postinstall_packages.conf"))
pacman_config = pjoin(configdir, "pacman.conf")
container.create(pacman_config, package_list, rootfolder=pjoin(outputdir, "chakra"))
container.add_postinall_packages(pacman_config, postinstall_package_list, rootfolder=pjoin(outputdir, "chakra"))
iso_builder = iso.IsoBuilder(outputdir, datadir, configdir)
iso_builder.prepare_overlay(locale_archive)
iso_builder.prepare_iso()
iso_builder.prepare_efi_img()
iso_builder.make_iso()
# vim: set syntax=python:
# all of the variables below are substituted by the build system
__VERSION__ = "0.0.1"
#datadir = os.path.abspath("./data")
#configdir = os.path.abspath(sys.argv[1]) if len(sys.argv) > 1 else os.path.abspath("./config")
#outputdir = os.path.abspath("./iso_build")
def command_parse():
"""return options and args from parsing the command line"""
parser = OptionParser(usage=__doc__, version=__VERSION__)
# modes (basic commands)
parser.add_option('-p', '--profile', action="store", dest="profile", help="profile name", default="default")
#parser.add_option('-d', '--datadir', action="store", dest="datadir", help="datadir string", default=os.path.abspath("./data"))
#parser.add_option('-c', '--configdir', action="store", dest="configdir", help="configdir string", default=os.path.abspath("./config"))
parser.add_option('-o', '--outputdir', action="store", dest="outputdir", help="outputdir string", default=os.path.abspath("./iso_build"))
(options, args) = parser.parse_args()
return (options, args)
def main(ret):
locale_archive = "./locale-archive" # FIXME
if not os.path.isfile(locale_archive):
locale_archive = None
else:
locale_archive = os.path.abspath(locale_archive)
(options, args) = command_parse()
# redefine the data and config dir based on the choosen profile
datadir = os.path.abspath("./" + os.path.join('profiles', options.profile, 'data'))
configdir = os.path.abspath("./" + os.path.join('profiles', options.profile, 'config'))
try:
package_list = helper.read_package_list(pjoin(configdir, "packages_base.conf"))
package_list.extend(helper.read_package_list(pjoin(configdir, "packages.conf")))
postinstall_package_list = helper.read_package_list(pjoin(configdir, "postinstall_packages.conf"))
pacman_config = pjoin(configdir, "pacman.conf")
container.create(pacman_config, package_list, rootfolder=pjoin(options.outputdir, "chakra"))
container.add_postinall_packages(pacman_config, postinstall_package_list, rootfolder=pjoin(options.outputdir, "chakra"))
iso_builder = iso.IsoBuilder(options.outputdir, datadir, configdir)
iso_builder.prepare_overlay(locale_archive)
iso_builder.prepare_iso()
iso_builder.prepare_efi_img()
iso_builder.make_iso()
except:
print("Unexpected error:", sys.exc_info()[0])
if __name__ == '__main__':
exitStatus = 0
try:
# sneaky way to ensure that we get passed back parameter even if
# we hit an exception.
retParams = {}
main(retParams)
exitStatus = retParams.get("exitStatus", exitStatus)
except (SystemExit,):
raise
except (Exception,) as exc:
exitStatus = 1
# Chakra-Live Packages file
# Version: 201601027
###########################
# CORE #
###########################
device-mapper
filesystem
lvm2
pcmciautils
util-linux
pacman-mirrorlist
mkinitcpio-busybox
attr
bash
binutils
bzip2
chakra-signatures
coreutils
cryptsetup
dhcpcd
diffutils
e2fsprogs
file
findutils
gawk
gcc-libs
gen-init-cpio
gettext
glibc
grep
gzip
iputils
jfsutils
less
libpipeline
licenses
linux
logrotate
man-pages
mdadm
nano
net-tools
pacman
pciutils
perl
ppp
procps-ng
psmisc
reiserfsprogs
rp-pppoe
sed
shadow
sysfsutils
tar
texinfo
usbutils
vi
wget
which
wpa_supplicant
xfsprogs
cdrkit
sshfs
linux-headers
squashfs-tools
aufs3-util
cdemu-client
lsb-release
# basic needs
systemd
nbd
chakra-hardware-detection
syslinux
grub
efibootmgr
os-prober
dmidecode
bc
xdelta3
avahi
e2fsprogs
xfsprogs
jfsutils
reiserfsprogs
ntfs-3g
dosfstools
gptfdisk
testdisk
dkms
f2fs-tools
# packages required to get the live system up and running
chakra-live-initcpio
chakra-live-skel
chakra-init-live
# drivers & system utilities
alsa-lib
alsa-oss
alsa-utils
lm_sensors
fuse
btrfs-progs
cpupower
upower
udisks2
acpi_call
iasl
ccr
# catalyst fixes
xinetd
libstdc++5
# generally useful tools that dont require X
bash-completion
openssh
#nmap
dosfstools
lsof
vi
vim
nano
sudo
mlocate
man-db
# packers, compressors
unzip
unrar
p7zip
zip
#unarj
# wireless drivers and tools
wireless_tools
wireless-regdb
iputils
dnsutils
crda
usb-modeswitch
vpnc
openvpn
openconnect
networkmanager-vpnc
networkmanager-pptp
networkmanager-openvpn
networkmanager-openconnect
###########################
# FIRMWAREs #
###########################
alsa-firmware
b43-fwcutter
bluez-firmware
broadcom-wl
isl3887usb-firmware
linux-firmware
zd1211-firmware
intel-ucode
###########################
# XORG #
###########################
mesa
ocl-icd
xterm
# xorg base
xorg-server
xorg-server-utils
xorg-xkb-utils
xorg-utils
xorg-xrdb
xorg-xauth
xorg-xinit
xorg-apps
xorg-fonts-alias
xorg-fonts-encodings
xorg-fonts-misc
# xorg video drivers
xf86-video-amdgpu
xf86-video-ati
xf86-video-intel
xf86-video-nouveau
xf86-video-vesa
xf86-video-vmware
xf86-video-voodoo
# xorg input drivers
xorg-input-drivers
xf86-input-synaptics
xf86-input-wacom
###########################
# FONTS #
###########################
xorg-fonts-75dpi
xorg-fonts-100dpi
xorg-fonts-cyrillic
terminus-font
ttf-dejavu
ttf-liberation
ttf-indic-fonts
ttf-lklug
ttf-opensans
ttf-raleway
ttf-noto
#ttf-noto-cjk
ttf-noto-emoji
# additional stuff that needs xorg
hicolor-icon-theme
###########################
# SOUND #
###########################
phonon-backend-gstreamer
gst-libav
libcanberra-gstreamer
libao
alsa-lib
alsa-utils
# pulse support
pulseaudio
pulseaudio-alsa
libcanberra-pulse
###########################
# KDE core and apps #
###########################
......@@ -328,7 +96,7 @@ kate
plasma-pa
dolphin
ffmpegthumbs
qupzilla
falkon
konversation
kdenetwork-kget
gwenview
......@@ -346,7 +114,7 @@ breeze-gtk
# extra
kdegraphics-thumbnailers
kdesdk-thumbnailers
xdgurl
ocs-url
yakuake
bluedevil
......@@ -437,8 +205,6 @@ networkmanager-dispatcher-ntpd
# login
sddm
# locales
#kde-l10n
###########################
# THEMES #
......@@ -465,18 +231,6 @@ xdg-user-dirs
###########################
calamares
###########################
# KAPUDAN #
###########################
#kapudan
#yakuake-themes-sirius
#kde-gtk-config
#oxygen-gtk-icons
#oxygen-gtk2
##tomoyo-tools
#python2-gobject3
###########################
# DEBUGGING #
###########################
......
../../shared/config/packages_base.conf
\ No newline at end of file
../../shared/data/efi
\ No newline at end of file
../../shared/data/isolinux
\ No newline at end of file
File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).File created by Chakra buildsystem. See systemd-update-done.service(8).
\ No newline at end of file
root:x:0:root
bin:x:1:root,bin,daemon
daemon:x:2:root,bin,daemon
sys:x:3:root,bin
adm:x:4:root,daemon
tty:x:5:
disk:x:6:root
lp:x:7:daemon,live
mem:x:8:
kmem:x:9:
wheel:x:10:root
ftp:x:11:
mail:x:12:
uucp:x:14:
utmp:x:20:
locate:x:21:
rfkill:x:24:
smmsp:x:25:
http:x:33:
games::50:
lock:x:54:
clamav:x:64:
uuidd:x:68:
dbus:x:81:
avahi:x:84:live
ntp:x:87
mysql:x:89:
network:x:90:live
video:x:91:live
audio::92:live
optical::93:live
floppy:x:94:live
storage:x:95:live
scanner:x:96:live
camera:x:97:live
power:x:98:live
nobody::99:
users::100:live
polkitd:x:102:
cdemu:x:103:live
nm-openconnect:x:104:
lpadmin:x:107:live
systemd-journal:x:110:live
systemd-timesync:x:112:live
systemd-network:x:113:live
systemd-bus-proxy:x:114:live
systemd-resolve:x:115:live
systemd-journal-remote:x:116:live
systemd-journal-upload:x:117:live
systemd-journal-gateway:x:118:live
quassel:x:998:
rtkit:x:999:
sddm:x:996:
root:::root
bin:::root,bin,daemon
daemon:::root,bin,daemon
sys:::root,bin
adm:::root,daemon
tty:::
disk:::root
lp:::daemon
mem:::
kmem:::
wheel:::root
ftp:::
mail:::
log:::root,live
smmsp:::
games:::
network:x::
video:x::live
audio:::live
optical:::live
floppy:x::live
storage:x::live
power:x::live
nobody:::
users:::
locate:!::
dbus:!::
lock:!::
avahi:!::live
nm-openconnect:!::
camera:!::live
scanner:!::live
cdemu:!::
rtkit:!::
mysql:!::
quassel:!::
lpadmin:!::
polkitd:!::
uuidd:!::
ntp:!::
systemd-journal:!::
systemd-journal-remote:!::
systemd-journal-gateway:!::
systemd-journal-upload:!::
systemd-timesync:!::
systemd-network:!::
systemd-bus-proxy:!::
systemd-resolve:!::
sddm:!::
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
ftp:x:14:11:ftp:/home/ftp:/sbin/nologin
nobody:x:99:99:nobody:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
avahi:x:84:84:Avahi daemon:/:/sbin/nologin
nm-openconnect:x:104:104:NetworkManager user for OpenConnect:/:/sbin/nologin
live:x:1000:100:,,,:/home/live:/bin/bash
mysql:x:89:89::/var/lib/mysql:/sbin/nologin
quassel:x:998:998::/var/lib/quassel:/bin/sh
rtkit:x:999:999:RealtimeKit:/proc:/sbin/nologin
polkitd:x:102:102:Policy Kit Daemon:/:/sbin/nologin
clamav:x:64:64:Clam AntiVirus:/dev/null:/sbin/nologin
uuidd:x:68:68::/:/sbin/nologin
ntp:x:87:87:Network Time Protocol:/var/lib/ntp:/sbin/nologin
systemd-timesync:x:112:112:systemd-timesync:/:/sbin/nologin
systemd-network:x:113:113:systemd-network:/:/sbin/nologin
systemd-bus-proxy:x:114:114:systemd-bus-proxy:/:/sbin/nologin
systemd-resolve:x:115:115:systemd-resolve:/:/sbin/nologin
systemd-journal-remote:x:116:116:systemd Journal Remote:/:/sbin/nologin
systemd-journal-upload:x:117:117:systemd Journal Upload:/:/sbin/nologin
systemd-journal-gateway:x:118:118:systemd Journal Gateway:/:/sbin/nologin
sddm:x:996:996:Simple Desktop Display Manager:/var/lib/sddm:/sbin/nologin
[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false
# Name of session file for autologin session
Session=plasma.desktop
# Username for autologin session
User=live
[General]
# Halt command
HaltCommand=/usr/bin/systemctl poweroff
# Input method module
InputMethod=
# Initial NumLock state. Can be on, off or none.
# If property is set to none, numlock won't be changed
# NOTE: Currently ignored if autologin is enabled.
Numlock=none
# Reboot command
RebootCommand=/usr/bin/systemctl reboot
[Theme]
# Current theme name
Current=heritage
# Cursor theme used in the greeter
CursorTheme=breeze
# Number of users to use as threshold
# above which avatars are disabled
# unless explicitly enabled with EnableAvatars
DisableAvatarsThreshold=7
# Enable display of custom user avatars
EnableAvatars=true
# Global directory for user avatars
# The files should be named <username>.face.icon
FacesDir=/usr/share/sddm/faces
# Theme directory path
ThemeDir=/usr/share/sddm/themes
[Users]
# Default $PATH for logged in users
DefaultPath=/bin:/usr/bin:/usr/sbin:/usr/local/bin
# Comma-separated list of shells.
# Users with these shells as their default won't be listed
HideShells=
# Comma-separated list of users that should not be listed
HideUsers=
# Maximum user id for displayed users
MaximumUid=65000
# Minimum user id for displayed users
MinimumUid=1000
# Remember the session of the last successfully logged in user
RememberLastSession=true
# Remember the last successfully logged in user
RememberLastUser=true
[Wayland]
# Path to a script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/wayland-session
# Directory containing available Wayland sessions
SessionDir=/usr/share/wayland-sessions
# Path to the user session log file
SessionLogFile=.local/share/sddm/wayland-session.log
[X11]
# Path to a script to execute when starting the display server
DisplayCommand=/usr/share/sddm/scripts/Xsetup
# Path to a script to execute when stopping the display server
DisplayStopCommand=/usr/share/sddm/scripts/Xstop
# The lowest virtual terminal number that will be used.
MinimumVT=7
# Arguments passed to the X server invocation
ServerArguments=-nolisten tcp
# Path to X server binary
ServerPath=/usr/bin/X
# Path to a script to execute when starting the desktop session
SessionCommand=/usr/share/sddm/scripts/Xsession
# Directory containing available X sessions
SessionDir=/usr/share/xsessions
# Path to the user session log file
SessionLogFile=.local/share/sddm/xorg-session.log
# Path to the Xauthority file
UserAuthFile=.Xauthority
# Path to xauth binary
XauthPath=/usr/bin/xauth
# Path to Xephyr binary
XephyrPath=/usr/bin/Xephyr
root:$1$0oxelHFy$70oG8CeZjLJ0VqyIt/vHE.:13984::::::
bin:x:0::::::
daemon:x:0::::::
mail:x:0::::::
ftp:x:0::::::
nobody:x:0::::::
dbus:!:13984:0:99999:7:::
avahi:!:13984:0:99999:7:::
live:$1$Nds/qyQu$0sf5EBEaaWxiJGfP8mTJ0/:13984:0:99999:7:::
rtkit:!:14855::::::
http:x:14871::::::
nm-openconnect:!:15588:0:99999:7:::
mysql:!:15588:0:99999:7:::
quassel:!:15588::::::
polkitd:!:15599:0:99999:7:::
uuidd:!:15657:0:99999:7:::
ntp:!:15684:0:99999:7:::
systemd-resolve:!:16240:0:99999:7:::
systemd-journal-gateway:!:17125:0:99999:7:::
systemd-coredump:!!:17125::::::
systemd-journal-upload:!!:17125::::::
systemd-journal-remote:!!:17125::::::
systemd-timesync:!:16240:0:99999:7:::
systemd-network:!:16241:0:99999:7:::
sddm:!:16453::::::