Skip to content

Commit dc94476

Browse files
committed
testing: switch altlinux to systemd
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent bea573a commit dc94476

File tree

4 files changed

+99
-5
lines changed

4 files changed

+99
-5
lines changed

testing/packages-altlinux

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ KERNEL_PACKAGES="kernel$KERNEL_FLAVOR"
1414
BOOTLOADER_EFI_PACKAGES="grub-common grub-efi"
1515
BOOTLOADER_PC_PACKAGES="grub-common grub-pc"
1616

17-
SYSIMAGE_BASE_PACKAGES="$MAKE_INITRD_PACKAGES sysvinit startup mingetty"
17+
SYSIMAGE_LOCAL_INIT_PACKAGES="systemd"
18+
SYSIMAGE_NETWORK_INIT_PACKAGES="sysvinit startup"
19+
20+
SYSIMAGE_BASE_PACKAGES="$MAKE_INITRD_PACKAGES mingetty"
1821
SYSIMAGE_EXTRA_PACKAGES="pwgen mdadm lvm2 cryptsetup btrfs-progs e2fsprogs xfsprogs dosfstools reiserfsprogs"
1922

2023
KICKSTART_PACKAGES="$MAKE_INITRD_PACKAGES"
21-
KICKSTART_PACKAGES+=" sysvinit util-linux rsync wget cryptsetup lvm2 mdadm pwgen"
24+
KICKSTART_PACKAGES+=" systemd util-linux rsync wget cryptsetup lvm2 mdadm pwgen"
2225
KICKSTART_PACKAGES+=" e2fsprogs btrfs-progs xfsprogs dosfstools reiserfsprogs"
2326
KICKSTART_PACKAGES+=" sfdisk unzip tar cpio eject lz4 f2fs-tools"
2427

testing/testing-altlinux-ks-initrd.cfg

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
%post --erroronfail
2+
set -xefu
3+
4+
mkdir -p /proc
5+
mount -t proc proc /proc
6+
7+
mkdir -p /sys
8+
mount -t sysfs sysfs /sys
9+
10+
mkdir -p /dev
11+
mount -t devtmpfs devfs /dev
12+
13+
! blkid -L "EFI" >/dev/null ||
14+
mount -t efivarfs none /sys/firmware/efi/efivars
15+
16+
blkid
17+
findmnt
18+
19+
echo "ENABLE=no" > /etc/sysconfig/framebuffer
20+
21+
tee /etc/initrd.mk <<-EOF
22+
AUTODETECT = all
23+
MODULES_PRELOAD += virtio-blk virtio-scsi
24+
`[ ! -f /etc/initrd.mk.addon ] || cat /etc/initrd.mk.addon`
25+
EOF
26+
27+
kver="$(readlink -ev /boot/vmlinuz)"
28+
kver="${kver##*/vmlinuz-}"
29+
30+
env -i PATH="$PATH" \
31+
/srv/.build/dest/usr/sbin/make-initrd -k "$kver"
32+
33+
tee /sbin/init.once <<-EOF
34+
#!/bin/sh
35+
echo; echo;
36+
echo 'IT WORKS!'
37+
echo; echo;
38+
exec reboot
39+
EOF
40+
chmod +x /sbin/init.once
41+
42+
tee -a /etc/inittab <<-EOF
43+
z0:3:once:/sbin/init.once
44+
EOF
45+
46+
tee -a /usr/lib/systemd/system/init-once.service <<-EOF
47+
[Unit]
48+
Description=Make-initrd target
49+
DefaultDependencies=no
50+
After=systemd-user-sessions.service plymouth-quit-wait.service
51+
Before=system-getty.slice
52+
53+
[Service]
54+
Type=oneshot
55+
ExecStart=/sbin/init.once
56+
RemainAfterExit=yes
57+
StandardOutput=tty
58+
59+
[Install]
60+
WantedBy=sysinit.target
61+
EOF
62+
63+
systemctl enable init-once ||:
64+
65+
tee -a /etc/sysconfig/grub2 <<-EOF
66+
GRUB_CMDLINE_LINUX_DEFAULT='console=ttyS0,115200n8 fastboot @CMDLINE@'
67+
GRUB_TIMEOUT=3
68+
GRUB_TERMINAL_INPUT='serial console'
69+
GRUB_TERMINAL_OUTPUT='serial console'
70+
GRUB_SERIAL_COMMAND='serial --unit=0 --speed=115200'
71+
EOF
72+
73+
if ! blkid -L "EFI" >/dev/null; then
74+
bootdev=$(findmnt -k -no SOURCE -T /boot)
75+
syspath="$(readlink -ev "/sys/class/block/${bootdev#/dev/}")"
76+
syspath="${syspath%/*}/uevent"
77+
bootdev="$(sed -n -e 's,^DEVNAME=,/dev/,p' "$syspath")"
78+
79+
grub-install "$bootdev"
80+
else
81+
strace -e %file efibootmgr ||:
82+
grub-install \
83+
--root-directory "/" \
84+
--boot-directory "/boot" \
85+
--efi-directory "/boot/efi" \
86+
#
87+
fi
88+
89+
grub-mkconfig -o /boot/grub/grub.cfg
90+
91+
umount /proc /sys /dev
92+
%end

testing/testing-altlinux-local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ for step in "$@"; do
101101
'FEATURES += compress cleanup'
102102
RUN rpm -ql filesystem | xargs -r mkdir -p
103103
RUN apt-get $apt_args update
104-
RUN apt-get $apt_args install $SYSIMAGE_PACKAGES $KERNEL_PACKAGES
104+
RUN apt-get $apt_args install $SYSIMAGE_LOCAL_INIT_PACKAGES $SYSIMAGE_PACKAGES $KERNEL_PACKAGES
105105
RUN apt-get $apt_args clean
106106
RUN \
107107
find /lib/modules \( \

testing/testing-altlinux-sshfs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ for step in "$@"; do
9797
FROM $IMAGE
9898
RUN rpm -ql filesystem | xargs -r mkdir -p
9999
RUN apt-get $apt_args update
100-
RUN apt-get $apt_args install $SYSIMAGE_PACKAGES
100+
RUN apt-get $apt_args install $SYSIMAGE_NETWORK_INIT_PACKAGES $SYSIMAGE_PACKAGES
101101
RUN apt-get $apt_args clean
102102
RUN \
103103
find /usr/share/license /usr/share/license-exception -delete; \

0 commit comments

Comments
 (0)