Skip to content

Commit

Permalink
using pkgupd
Browse files Browse the repository at this point in the history
  • Loading branch information
itsManjeet committed Jun 20, 2024
1 parent 7beae75 commit 8ac62d1
Show file tree
Hide file tree
Showing 39 changed files with 1,009 additions and 2,008 deletions.
73 changes: 0 additions & 73 deletions .vscode/settings.json

This file was deleted.

28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ OSTREE_BRANCH ?= $(shell uname -m)/os/$(CHANNEL)
OSTREE_REPO ?= ostree-repo
OSTREE_GPG ?= ostree-gpg
VERSION ?= 2.0
IGNITE ?= build/src/ignite/ignite
PKGUPD ?= build/src/pkgupd/bin/pkgupd
CACHE_PATH ?= build/
DESTDIR ?= checkout/
APPMARKET_PATH ?= appmarket/
Expand All @@ -28,35 +28,35 @@ endef


export OSTREE_GPG_CONFIG
export IGNITE
export PKGUPD
export CACHE_PATH

.PHONY: clean all docs version.yml channel.yml ostree-branch.yml apps

all: $(IGNITE) version.yml ostree-branch.yml channel.yml
all: $(PKGUPD) version.yml ostree-branch.yml channel.yml
ifdef ELEMENT
$(IGNITE) cache-path=$(CACHE_PATH) build $(ELEMENT)
$(PKGUPD) ignite ignite.cache=$(CACHE_PATH) build $(ELEMENT)
endif

status: $(IGNITE) version.yml ostree-branch.yml channel.yml
status: $(PKGUPD) version.yml ostree-branch.yml channel.yml
ifdef ELEMENT
$(IGNITE) cache-path=$(CACHE_PATH) status $(ELEMENT)
$(PKGUPD) ignite ignite.cache=$(CACHE_PATH) status $(ELEMENT)
else
@echo "no ELEMENT specified"
exit 1
endif

filepath: $(IGNITE) version.yml ostree-branch.yml channel.yml
filepath: $(PKGUPD) version.yml ostree-branch.yml channel.yml
ifdef ELEMENT
@PKGUPD_NO_MESSAGE=1 $(IGNITE) cache-path=$(CACHE_PATH) filepath $(ELEMENT)
@PKGUPD_NO_MESSAGE=1 $(PKGUPD) ignite ignite.cache=$(CACHE_PATH) filepath $(ELEMENT)
else
@echo "no ELEMENT specified"
exit 1
endif

checkout: $(IGNITE) version.yml ostree-branch.yml channel.yml
checkout: $(PKGUPD) version.yml ostree-branch.yml channel.yml
ifdef ELEMENT
$(IGNITE) cache-path=$(CACHE_PATH) checkout $(ELEMENT) $(DESTDIR)
$(PKGUPD) ignite ignite.cache=$(CACHE_PATH) checkout $(ELEMENT) $(DESTDIR)
else
@echo "no ELEMENT specified"
exit 1
Expand All @@ -66,8 +66,8 @@ endif
build/build.ninja: CMakeLists.txt
cmake -B build

$(IGNITE): build/build.ninja src/ignite/CMakeLists.txt
@cmake --build build --target ignite
$(PKGUPD): build/build.ninja src/pkgupd/CMakeLists.txt
@cmake --build build --target pkgupd

clean:
rm -rf $(DOCS_DIR)
Expand All @@ -87,8 +87,8 @@ $(OSTREE_GPG)/key-config:
files/rlxos.gpg: $(OSTREE_GPG)/key-config
gpg --homedir=$(OSTREE_GPG) --export --armor >"$@"

update-app-market: $(IGNITE) version.yml ostree-branch.yml channel.yml
$(IGNITE) cache-path=$(CACHE_PATH) meta $(APPMARKET_PATH)/$(CHANNEL)
update-app-market: $(PKGUPD) version.yml ostree-branch.yml channel.yml
$(PKGUPD) ignite ignite.cache=$(CACHE_PATH) meta $(APPMARKET_PATH)/$(CHANNEL)
./scripts/extract-icons.sh $(APPMARKET_PATH)/$(CHANNEL)/apps/ $(APPMARKET_PATH)/$(CHANNEL)/icons/

update-ostree: files/rlxos.gpg
Expand Down
4 changes: 2 additions & 2 deletions elements/components/libyaml-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ configure: >-
-DCMAKE_BUILD_TYPE=Release
-DYAML_CPP_BUILD_TESTS=OFF
-DYAML_CPP_BUILD_TOOLS=OFF
-DBUILD_SHARED_LIBS=ON
-DYAML_BUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Release
depends:
- components/glibc.yml

build-depends:
- components/cmake.yml
- components/gcc.yml

sources:
- https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-%{version}.tar.gz
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
id: sysroot
version: 2.0.7
id: pkgupd
version: 0.0.1
about: Package Management and Updater Daemon
merge: [ elements/include/rlxos.inc ]

depends:
- components/glibc.yml
- components/libyaml-cpp.yml
- components/curl.yml
- components/ostree.yml

build-depends:
- components/git.yml
Expand Down
80 changes: 49 additions & 31 deletions elements/installer/image.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
id: ostree-installer
merge: [version.yml, ostree-branch.yml, elements/include/installer.inc]
merge: [version.yml, elements/include/installer.inc]
about: OSTree Installer ISO

include:
- system/repo.yml
- system/deps.yml

capabilities:
- CAP_SYS_CHROOT

include-root: /sysroot
include-parts: [ doc, devel ]

include-root: /source-repo
sysroot: /sysroot
installer-volume-id: RLXOS

kargs: >-
Expand All @@ -19,38 +23,52 @@ force-rebuild: true
strip: false

script: |-
mkdir -p %{sysroot}
ostree admin init-fs --modern %{sysroot}
ostree admin os-init --sysroot=%{sysroot} rlxos
chroot %{include-root} /bin/bash -e << "EOT"
for i in %{datadir}/pkgupd/manifest/*/integration ; do
sh -e $i
done
rm -rf /install-root
ostree config --repo=%{sysroot}/ostree/repo set sysroot.bootloader none
mkdir -p /proc /sysroot
ln -sv /sysroot/ostree /ostree
ostree pull-local --repo=%{sysroot}/ostree/repo %{include-root} %{ostree-branch}
update-ca-certificates
ostree admin deploy \
--sysroot=%{sysroot} \
--os=rlxos \
%{kargs} \
%{ostree-branch}
echo "root:root" | chpasswd
mkdir -p %{sysroot}/proc
cp -ar %{sysroot}/boot %{build-root}/ISO/
echo -e "\nGTK_CSD=1" >> %{sysconfdir}/environment
# read ostree config
getconfig() {
cat /sysroot/boot/loader/entries/ostree-1-rlxos.conf | grep "$1" | cut -d ' ' -f2-
}
# TODO: should be enabled via systemd user-preset
systemctl enable --global appimaged.service
systemctl enable --global wob.socket
# TODO: should be done in components/pam::integration
chmod 4755 %{bindir}/unix_chkpwd -v
KERNEL=$(getconfig linux)
INITRD=$(getconfig initrd)
KARGS=$(getconfig options)
ln -sfv %{datadir}/zoneinfo/UTC %{sysconfdir}/localtime
touch %{sysconfdir}/skel/.zshrc
for f in ISO/boot/grub/grub.cfg ISO/isolinux/isolinux.cfg ; do
m4 -D"__KERNEL__=/boot/$KERNEL" \
-D"__INITRD__=/boot/$INITRD" \
-D"__KARGS__=$KARGS" $f > ${f}.tmp
mv ${f}.tmp ${f}
done
kerver=$(ls -1 /lib/modules | head -n1)
cp /lib/modules/${kerver}/bzImage /lib/modules/${kerver}/vmlinuz
dracut --reproducible -v --no-machineid \
--kver ${kerver} \
--add ostree \
--add plymouth \
--add dmsquash-live \
--install grep \
--install head \
--install tail \
--install less \
--install lsof \
--omit lvm \
--install 'fsck.ext4' \
%{libdir}/modules/${kerver}/initramfs
build-depends:
- components/ostree.yml
mv %{sysconfdir} %{prefix}/
EOT
mkdir -p %{install-root}
mksquashfs
14 changes: 1 addition & 13 deletions elements/system/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ depends:
- components/tzdata.yml
- components/kbd.yml
- components/branding.yml
- components/ostree.yml
- components/cups.yml
- components/vim.yml
- components/nano.yml
- components/squashfs-tools.yml
- components/wget.yml
- components/sudo.yml
- components/sysroot.yml
- components/pkgupd.yml
- components/dmidecode.yml
- components/libsmbios.yml
- components/libgtop.yml
Expand Down Expand Up @@ -98,19 +97,9 @@ depends:
- components/flatpak.yml
- components/power-profiles-daemon.yml
- components/networkmanager.yml
- components/webkitgtk.yml
- components/enchant.yml
- components/quickjs.yml
- components/gtkmm.yml
- components/gtk-layer-shell.yml
- components/gjs.yml

- components/ntfs-3g.yml
- components/bluez.yml
- components/meta-enlightenment.yml

# AppImage
- components/appimaged.yml

- kernel/linux.yml

Expand All @@ -119,5 +108,4 @@ depends:
- system/etc-skel.yml
- system/etc-sysctl.yml
- system/etc-default-useradd.yml
- system/pre-installed.yml
- system/initial-setup-config.yml
58 changes: 58 additions & 0 deletions elements/system/image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
id: system-image
merge: [ version.yml ]
about: System Image

include:
- system/deps.yml

capabilities:
- CAP_SYS_CHROOT

include-root: /sysroot
include-parts: [ doc, devel ]

kargs: >-
--karg=root=live:LABEL=RLXOS
--karg=quiet
--karg=splash
--karg=rd.live=1
--karg=rd.live.overlay.overlayfs=1
force-rebuild: true
strip: false

script: |-
chroot %{include-root} /bin/bash -e << "EOT"
for i in %{datadir}/pkgupd/manifest/*/integration ; do
sh -e $i
done
rm -rf /install-root
mkdir -p /proc
update-ca-certificates
echo "root:root" | chpasswd
echo -e "\nGTK_CSD=1" >> %{sysconfdir}/environment
# TODO: should be enabled via systemd user-preset
systemctl enable --global appimaged.service
systemctl enable --global wob.socket
# TODO: should be done in components/pam::integration
chmod 4755 %{bindir}/unix_chkpwd -v
ln -sfv %{datadir}/zoneinfo/UTC %{sysconfdir}/localtime
touch %{sysconfdir}/skel/.zshrc
kerver=$(ls -1 /lib/modules | head -n1)
cp /lib/modules/${kerver}/bzImage /lib/modules/${kerver}/vmlinuz
EOT
mkdir -p %{install-root}
mksquashfs %{sysroot} %{install-root}/system.img -noappend
cp %{include-root}%{libdir}/modules/*/vmlinuz %{install-root}/vmlinuz
Loading

0 comments on commit 8ac62d1

Please sign in to comment.