forked from pool/tik-osimage-Aeon
- Populate /etc/sysconfig/bootloader (boo#1228659)
OBS-URL: https://build.opensuse.org/package/show/devel:microos:aeon:images/tik-osimage-Aeon?expand=0&rev=11
This commit is contained in:
commit
932ff29fd6
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
17
LICENSE
Normal file
17
LICENSE
Normal file
@ -0,0 +1,17 @@
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
8
_constraints
Normal file
8
_constraints
Normal file
@ -0,0 +1,8 @@
|
||||
<constraints>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">20</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
</constraints>
|
||||
|
184
config.sh
Normal file
184
config.sh
Normal file
@ -0,0 +1,184 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
#
|
||||
#======================================
|
||||
# Functions...
|
||||
#--------------------------------------
|
||||
|
||||
test -f /.kconfig && . /.kconfig
|
||||
test -f /.profile && . /.profile
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
echo "Configure image: [$kiwi_iname]-[$kiwi_profiles]..."
|
||||
|
||||
# Systemd controls the console font now
|
||||
echo FONT="eurlatgr.psfu" >> /etc/vconsole.conf
|
||||
|
||||
#======================================
|
||||
# prepare for setting root pw, timezone
|
||||
#--------------------------------------
|
||||
echo "** reset machine settings"
|
||||
rm -f /etc/machine-id \
|
||||
/var/lib/zypp/AnonymousUniqueId \
|
||||
/var/lib/systemd/random-seed
|
||||
|
||||
#======================================
|
||||
# Specify default systemd target
|
||||
#--------------------------------------
|
||||
baseSetRunlevel graphical.target
|
||||
|
||||
#======================================
|
||||
# Import trusted rpm keys
|
||||
#--------------------------------------
|
||||
suseImportBuildKey
|
||||
|
||||
#======================================
|
||||
# Set hostname by DHCP
|
||||
#--------------------------------------
|
||||
baseUpdateSysConfig /etc/sysconfig/network/dhcp DHCLIENT_SET_HOSTNAME yes
|
||||
|
||||
# Add repos from /etc/YaST2/control.xml
|
||||
if [ -x /usr/sbin/add-yast-repos ]; then
|
||||
add-yast-repos
|
||||
zypper --non-interactive rm -u live-add-yast-repos
|
||||
fi
|
||||
|
||||
# Adjust zypp conf
|
||||
sed -i 's/^multiversion =.*/multiversion =/g' /etc/zypp/zypp.conf
|
||||
|
||||
#=====================================
|
||||
# Configure snapper
|
||||
#-------------------------------------
|
||||
if [ "${kiwi_btrfs_root_is_snapshot-false}" = 'true' ]; then
|
||||
echo "creating initial snapper config ..."
|
||||
cp /etc/snapper/config-templates/default /etc/snapper/configs/root \
|
||||
|| cp /usr/share/snapper/config-templates/default /etc/snapper/configs/root
|
||||
baseUpdateSysConfig /etc/sysconfig/snapper SNAPPER_CONFIGS root
|
||||
|
||||
# Adjust parameters
|
||||
sed -i'' 's/^TIMELINE_CREATE=.*$/TIMELINE_CREATE="no"/g' /etc/snapper/configs/root
|
||||
sed -i'' 's/^NUMBER_LIMIT=.*$/NUMBER_LIMIT="2-10"/g' /etc/snapper/configs/root
|
||||
sed -i'' 's/^NUMBER_LIMIT_IMPORTANT=.*$/NUMBER_LIMIT_IMPORTANT="4-10"/g' /etc/snapper/configs/root
|
||||
fi
|
||||
|
||||
#=====================================
|
||||
# Enable chrony if installed
|
||||
#-------------------------------------
|
||||
if [ -f /etc/chrony.conf ]; then
|
||||
systemctl enable chronyd
|
||||
fi
|
||||
|
||||
#=====================================
|
||||
# Storage configuration
|
||||
#-------------------------------------
|
||||
|
||||
# The %post script can't edit /etc/fstab sys due to https://github.com/OSInside/kiwi/issues/945
|
||||
# so use the kiwi custom hack
|
||||
cat >/etc/fstab.script <<"EOF"
|
||||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
/usr/sbin/setup-fstab-for-overlayfs
|
||||
# ... set options for autoexpanding /home
|
||||
gawk -i inplace '$2 == "/home" { $4 = $4",x-systemd.growfs" } { print $0 }' /etc/fstab
|
||||
# workaround https://github.com/systemd/systemd/issues/927, drop the ro from the fstab mount
|
||||
gawk -i inplace '$2 == "/" && $4 == "compress=zstd:1,ro" { $4 = "compress=zstd:1" } { print $0 }' /etc/fstab
|
||||
EOF
|
||||
|
||||
chmod a+x /etc/fstab.script
|
||||
|
||||
#======================================
|
||||
# Enable NetworkManager
|
||||
#--------------------------------------
|
||||
systemctl enable NetworkManager
|
||||
|
||||
#======================================
|
||||
# Disable recommends on virtual images (keep hardware supplements, see bsc#1089498)
|
||||
#--------------------------------------
|
||||
sed -i 's/.*solver.onlyRequires.*/solver.onlyRequires = true/g' /etc/zypp/zypp.conf
|
||||
|
||||
#======================================
|
||||
# Disable installing documentation
|
||||
#--------------------------------------
|
||||
#sed -i 's/.*rpm.install.excludedocs.*/rpm.install.excludedocs = yes/g' /etc/zypp/zypp.conf
|
||||
|
||||
#======================================
|
||||
# Add default kernel boot options
|
||||
#--------------------------------------
|
||||
serialconsole='console=ttyS0,115200'
|
||||
|
||||
cmdline=('quiet' 'loglevel=2' 'systemd.show_status=no' "${serialconsole}" 'console=tty0' 'vt.global_cursor_default=0')
|
||||
|
||||
|
||||
ignition_platform='metal'
|
||||
|
||||
if [ -n "${ignition_platform}" ]; then
|
||||
cmdline+=("ignition.platform.id=${ignition_platform}")
|
||||
fi
|
||||
|
||||
#======================================
|
||||
# If SELinux is installed, configure it like transactional-update setup-selinux
|
||||
#--------------------------------------
|
||||
if [[ -e /etc/selinux/config ]]; then
|
||||
cmdline+=("security=selinux selinux=1")
|
||||
# Adjust selinux config
|
||||
sed -i -e 's|^SELINUX=.*|SELINUX=enforcing|g' \
|
||||
-e 's|^SELINUXTYPE=.*|SELINUXTYPE=targeted|g' \
|
||||
"/etc/selinux/config"
|
||||
|
||||
# Move an /.autorelabel file from initial installation to writeable location
|
||||
test -f /.autorelabel && mv /.autorelabel /etc/selinux/.autorelabel
|
||||
fi
|
||||
|
||||
if [ -e /etc/default/grub ]; then
|
||||
sed -i "s#^GRUB_CMDLINE_LINUX_DEFAULT=.*\$#GRUB_CMDLINE_LINUX_DEFAULT=\"${cmdline[*]}\"#" /etc/default/grub
|
||||
else
|
||||
echo "${cmdline[*]}" > /etc/kernel/cmdline
|
||||
fi
|
||||
|
||||
#======================================
|
||||
# systemd-boot specifics
|
||||
#--------------------------------------
|
||||
if rpm -q sdbootutil; then
|
||||
for d in /usr/lib/modules/*; do
|
||||
test -d "$d" || continue
|
||||
depmod -a "${d##*/}"
|
||||
done
|
||||
ENTRY_TOKEN=$(. /usr/lib/os-release; echo $ID)
|
||||
mkdir -p /etc/kernel
|
||||
echo "$ENTRY_TOKEN" > /etc/kernel/entry-token
|
||||
# FIXME: kiwi needs /boot/efi to exist before syncing the disk image
|
||||
mkdir -p /boot/efi
|
||||
mkdir -p /boot/efi/loader/entries
|
||||
echo "LOADER_TYPE=systemd-boot" > /etc/sysconfig/bootloader
|
||||
fi
|
||||
|
||||
#======================================
|
||||
# Aeon specifics
|
||||
#--------------------------------------
|
||||
|
||||
echo 'ExecStartPre=/bin/sh -c "echo 'Please wait.. setting up your computer.. this may take a few minutes'"' >> /usr/lib/dracut/modules.d/30ignition/ignition-disks.service
|
||||
echo 'StandardOutput=tty' >> /usr/lib/dracut/modules.d/30ignition/ignition-disks.service
|
||||
|
||||
setsebool -P selinuxuser_execmod 1
|
||||
setsebool -P selinuxuser_execheap 1
|
||||
setsebool -P selinuxuser_execstack 1
|
19
disk.sh
Normal file
19
disk.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -euxo pipefail
|
||||
[ -x /usr/bin/sdbootutil ] || exit 0
|
||||
echo "#######DISK"
|
||||
rootuuid=$(findmnt / -n --output uuid)
|
||||
sed -i -e "s,\$, root=UUID=$rootuuid," /etc/kernel/cmdline
|
||||
arch="$(uname -m)"
|
||||
case "$arch" in
|
||||
x86_64) arch=x64 ;;
|
||||
*) echo "Unsupported arch for Aeon - $arch"; exit 1 ;;
|
||||
esac
|
||||
echo "install boot loader"
|
||||
sdbootutil -v --no-random-seed --arch "$arch" --esp-path /boot/efi --entry-token=auto --no-variables install
|
||||
echo "add kernels"
|
||||
export hostonly_l=no # for dracut
|
||||
sdbootutil -v --arch "$arch" --esp-path /boot/efi --entry-token=auto add-all-kernels
|
||||
echo "##### AFTER ####"
|
||||
rm -f /boot/mbrid
|
||||
find /boot
|
40
tik-osimage-Aeon.changes
Normal file
40
tik-osimage-Aeon.changes
Normal file
@ -0,0 +1,40 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 31 14:09:59 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Populate /etc/sysconfig/bootloader (boo#1228659)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 24 12:42:51 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Stop populating ESP on image build, done by installer
|
||||
- Use "openSUSE-less" branding
|
||||
- Make minimal ESP size as resizing done by installer
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 22 11:08:36 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Remove growfs from initrd
|
||||
- Remove ro mount option as can cause racy mount behaviour on boot
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 16 13:17:46 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Remove redundant relabelling (done better by kiwi now)
|
||||
- Shift growfs to initrd
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 16 12:51:39 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- libcontainers-common no longer uses storage = btrfs by default,
|
||||
neither should images
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri May 10 10:36:02 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Produce image with "tik-osimage-*" prefix to be consumed by tik-img-to-rpm post check
|
||||
- Remove compression debugging tool from the image
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 12 12:07:21 UTC 2024 - Richard Brown <rbrown@suse.com>
|
||||
|
||||
- Initial Image
|
63
tik-osimage-Aeon.kiwi
Normal file
63
tik-osimage-Aeon.kiwi
Normal file
@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<image schemaversion="7.6" name="tik-osimage-Aeon" displayname="Aeon">
|
||||
<description type="system">
|
||||
<author>Richard Brown</author>
|
||||
<contact>rbrownsuse@opensuse.org</contact>
|
||||
<specification>Aeon</specification>
|
||||
</description>
|
||||
<preferences>
|
||||
<version>0.1.0</version>
|
||||
<packagemanager>zypper</packagemanager>
|
||||
<rpm-excludedocs>true</rpm-excludedocs>
|
||||
<locale>en_US</locale>
|
||||
<type
|
||||
image="oem"
|
||||
filesystem="btrfs"
|
||||
fsmountoptions="compress=zstd:1"
|
||||
firmware="uefi"
|
||||
bootpartition="false"
|
||||
initrd_system="none"
|
||||
efipartsize="0"
|
||||
bootkernel="custom"
|
||||
devicepersistency="by-uuid"
|
||||
btrfs_root_is_subvolume="true"
|
||||
btrfs_root_is_snapshot="true"
|
||||
btrfs_root_is_readonly_snapshot="true"
|
||||
btrfs_quota_groups="true"
|
||||
>
|
||||
<bootloader name="custom"/>
|
||||
<oemconfig>
|
||||
<oem-resize>false</oem-resize>
|
||||
</oemconfig>
|
||||
<systemdisk>
|
||||
<volume name="home"/>
|
||||
<volume name="root"/>
|
||||
<volume name="opt"/>
|
||||
<volume name="srv"/>
|
||||
<volume name="usr/local"/>
|
||||
<volume name="var" copy_on_write="false"/>
|
||||
</systemdisk>
|
||||
</type>
|
||||
</preferences>
|
||||
<repository type="rpm-md">
|
||||
<source path="obsrepositories:/"/>
|
||||
</repository>
|
||||
<packages type="image">
|
||||
<package name="live-add-yast-repos"/>
|
||||
<package name="patterns-aeon-base"/>
|
||||
</packages>
|
||||
<packages type="bootstrap">
|
||||
<!-- Avoid that zypper picks the busybox-foo variant for those, that would fail later -->
|
||||
<package name="coreutils"/>
|
||||
<package name="gawk"/>
|
||||
<package name="gzip"/>
|
||||
<package name="hostname"/>
|
||||
<!-- Avoid libressl -->
|
||||
<package name="openssl"/>
|
||||
<package name="filesystem"/>
|
||||
<package name="glibc-locale-base"/>
|
||||
<!-- So that https repos work for image package downloads -->
|
||||
<package name="ca-certificates-mozilla"/>
|
||||
<package name="Aeon-release"/>
|
||||
</packages>
|
||||
</image>
|
Loading…
Reference in New Issue
Block a user