Skip to content

Commit

Permalink
Move out initrd creation from immutable-rootfs package
Browse files Browse the repository at this point in the history
Signed-off-by: David Cassany <[email protected]>
  • Loading branch information
davidcassany committed Jun 21, 2021
1 parent 5c5648a commit 8fc9fc6
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 16 deletions.
3 changes: 3 additions & 0 deletions packages/cos-setup/02-cos-setup-initramfs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
install_items+=" /lib/systemd/system/cos-setup-initramfs.service /etc/systemd/system/initrd.target.requires/cos-setup-initramfs.service "
install_items+=" /lib/systemd/system/cos-setup-rootfs.service /etc/systemd/system/initrd-fs.target.requires/cos-setup-rootfs.service "
add_dracutmodules+=" network "
1 change: 0 additions & 1 deletion packages/cos-setup/02cos-setup-initramfs.conf

This file was deleted.

2 changes: 1 addition & 1 deletion packages/cos-setup/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires:
steps:
- mkdir -p /lib/systemd/system
- mkdir -p /etc/dracut.conf.d
- cp 02cos-setup-initramfs.conf /etc/dracut.conf.d
- cp 02-cos-setup-initramfs.conf /etc/dracut.conf.d
- cp -rfv *.service /lib/systemd/system
- cp -rfv *.timer /lib/systemd/system
- cp -rfv cos-setup /usr/bin/
Expand Down
2 changes: 1 addition & 1 deletion packages/cos-setup/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: cos-setup
category: system
version: 0.2.11+2
version: "0.2.16"
requires:
- name: "yip"
category: "toolchain"
Expand Down
5 changes: 5 additions & 0 deletions packages/cos/50-cos-initrd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hostonly_cmdline="no"
hostonly="no"
compress="xz"
omit_dracutmodules+=" multipath "
add_dracutmodules+=" dmsquash-live "
7 changes: 7 additions & 0 deletions packages/cos/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ steps:
- sed -i 's/:PRETTY_NAME:/{{.Values.brand_name}} v{{.Values.version}}/g' setup.yaml
- yip setup.yaml

# Create initrd
- |
cp 50-cos-initrd.conf /etc/dracut.conf.d && \
kernel=$(ls /lib/modules | head -n1) && \
dracut -f "/boot/initrd-${kernel}" "${kernel}" && \
ln -sf "initrd-${kernel}" /boot/initrd
# See https://luet-lab.github.io/docs/docs/concepts/packages/specfile/#package-by-container-content
unpack: true

Expand Down
7 changes: 3 additions & 4 deletions packages/cos/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
packages:
- name: "cos"
category: "system"
version: 0.5.3+3
version: 0.5.3+5
brand_name: "cOS"
labels:
autobump.revdeps: "true"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
- name: "cos"
category: "recovery"
version: "0.5.3+2"
version: 0.5.3+3
version: 0.5.3+5
brand_name: "cOS recovery"
labels:
autobump.revdeps: "true"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
autobump.revbump_related: "recovery/cos-img recovery/cos-squash"
1 change: 1 addition & 0 deletions packages/immutable-rootfs/02-cos-immutable-rootfs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_dracutmodules+=" cos-immutable-rootfs "
7 changes: 1 addition & 6 deletions packages/immutable-rootfs/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,4 @@ steps:
{{end}}
{{end}}
- cp -r 30cos-immutable-rootfs /usr/lib/dracut/modules.d
- |
kernel=$(ls /lib/modules | head -n1) && \
dracut --verbose --no-hostonly --omit multipath --no-hostonly-cmdline --xz \
-f "/boot/initrd-${kernel}" --add " dmsquash-live cos-immutable-rootfs network " \
"${kernel}" && \
ln -sf "initrd-${kernel}" /boot/initrd
- cp 02-cos-immutable-rootfs.conf /etc/dracut.conf.d
2 changes: 1 addition & 1 deletion packages/immutable-rootfs/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "immutable-rootfs"
category: "system"
version: "0.0.24"
version: "0.0.30"
2 changes: 1 addition & 1 deletion packages/recovery-img/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "cos-img"
category: "recovery"
version: 0.5.3+2
version: 0.5.3+5
brand_name: "cOS"
2 changes: 1 addition & 1 deletion packages/recovery-img/squash/definition.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: "cos-squash"
category: "recovery"
version: "0.5.3+1"
version: "0.5.3+5"

0 comments on commit 8fc9fc6

Please sign in to comment.