Initial feature live-install

This feature complements the live image of the second stage with installation
image-specific settings and scripted hooks.

It is recommended to connect using +live-installer to ensure that a typical set
of installer-related features is included.

Unlike the install2 feature, a separate image of the second stage of 'altinst'
is not built, but the live image is supplemented with installer packages in
order to reduce the total volume of the iso image.

Installation consists of two stages:
1. The live image is unpacked, as in livecd-install
2. Install additional packages BASE_PACKAGES and package groups THE_GROUPS as in install2.

Unlike install2, only those packages that are not in the live image are placed in the main repository. This is how the size of the iso image is reduced.
This commit is contained in:
Anton Midyukov 2022-08-15 19:51:13 +07:00
parent 4a421563d8
commit 2fcfcf922a
20 changed files with 151 additions and 4 deletions

View File

@ -1,6 +1,11 @@
#!/bin/sh
# FIXME: there should be less brutal i18n tuning
# don't cripple the image to be copied over
[ -n "$GLOBAL_LIVE_INSTALL"] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0
cd /usr/share/locale
rm -r *@*
for i in */; do

View File

@ -3,6 +3,7 @@
# don't cripple the image to be copied over
[ -n "$GLOBAL_LIVE_NO_CLEANUP_DOCS" ] || \
[ -n "$GLOBAL_LIVE_INSTALL"] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0

View File

@ -3,6 +3,7 @@
# don't cripple the image to be copied over or explicitly requested
# not to do this
[ -n "$GLOBAL_LIVE_NO_CLEANUPDB" ] || \
[ -n "$GLOBAL_LIVE_INSTALL" ] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0

View File

@ -0,0 +1,8 @@
menuentry $"Install "'@distro@' --hotkey 'i' --id 'linux' {
savedefault
echo $"Loading Linux vmlinuz$KFLAVOUR ..."
linux /boot/vmlinuz$KFLAVOUR fastboot live @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ lowmem vga=@bootvga@ @bootargs@ $EFI_BOOTARGS lang=$lang
echo $"Loading initial ramdisk ..."
initrd /boot/@initrd@$KFLAVOUR.@initrd_ext@
}

View File

@ -0,0 +1,6 @@
menuentry $"VNC install "'@distro@'$" (edit to set server IP address)" --id 'vncconnect' {
savedefault
linux /boot/vmlinuz$KFLAVOUR fastboot @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ nosplash @bootargs@ $EFI_BOOTARGS headless no_alt_virt_keyboard vncconnect=IP lang=$lang
initrd /boot/@initrd@$KFLAVOUR.@initrd_ext@
}

View File

@ -0,0 +1,7 @@
menuentry $"VNC install "'@distro@'$" (edit to set password and connect here)" --id 'vncpasswd' {
savedefault
linux /boot/vmlinuz$KFLAVOUR fastboot @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ showopts nosplash @bootargs@ $EFI_BOOTARGS headless no_alt_virt_keyboard vncpassword=VNCPWD lang=$lang
initrd /boot/@initrd@$KFLAVOUR.@initrd_ext@
}

View File

@ -0,0 +1,19 @@
Эта фича дополняет live образ второй стадии специфическими
для инсталяционного образа настройками и скриптовыми хуками.
Рекомендуется подключать при помощи +live-installer, чтобы
обеспечить включение типового набора связанных с инсталятором
функций.
В отличие от фичи install2 не собирается отдельный образ
второй стадии altinst, а дополняется образ live пакетами
инсталятора с целью уменьшить общий объём iso-образа.
Установка состоит и двух этапов:
1. Распаковывается образ live, как в livecd-install
2. Устанавливаются дополнительные пакеты BASE_PACKAGES и
группы пакетов THE_GROUPS, как в install2.
В отличии от install2 в репозиторий main помещаются только те
пакеты, которых нет в live образе. Этим и достигается уменьшение
размера iso-образа.

View File

@ -0,0 +1,48 @@
# alterator-based installer, second (livecd) stage
+live-installer: use/live-install/full; @:
use/live-install: use/live use/metadata use/repo/main \
use/bootloader use/grub/live-install.cfg use/syslinux/live-install.cfg
@$(call add_feature)
@$(call add,LIVE_PACKAGES,installer-common-stage2)
@$(call add,BASE_PACKAGES,installer-common-stage3)
@$(call add,LIVE_PACKAGES,installer-livecd-install)
@$(call add,LIVE_PACKAGES,alterator-postinstall) # for auto install
@$(call try,INSTALLER,altlinux-generic) # might be replaced later
@$(call add,LIVE_PACKAGES,installer-distro-$$(INSTALLER)-stage2)
@$(call add,LIVE_PACKAGES,branding-$$(BRANDING)-alterator)
@$(call add,LIVE_PACKAGES,branding-$$(BRANDING)-release)
@$(call add,LIVE_PACKAGES,installer-distro-$$(INSTALLER)-stage3)
@$(call add,LIVE_PACKAGES,glibc-gconv-modules) # for guile22
@$(call add,LIVE_PACKAGES,curl) # for net install
@$(call set,GLOBAL_LIVE_INSTALL,1)
@$(call xport,BASE_BOOTLOADER)
use/live-install/full: use/live-install \
use/syslinux/localboot.cfg use/grub/localboot_bios.cfg \
use/syslinux/ui/menu; @:
# set up remote repositories within installed system out-of-box
use/live-install/repo: use/live-install; @:
ifneq (,$(filter-out e2k%,$(ARCH)))
@$(call add,BASE_PACKAGES,installer-feature-online-repo)
endif
use/live-install/vnc:
@$(call add,LIVE_PACKAGES,installer-feature-vnc-stage2)
# this one expects external vncviewer to come
use/live-install/vnc/listen: use/live-install/vnc \
use/syslinux/live-install-vnc-listen.cfg use/grub/live-install-vnc-listen.cfg; @:
# this one connects to a specified vncviewer --listen
use/live-install/vnc/connect: use/live-install/vnc \
use/syslinux/live-install-vnc-connect.cfg use/grub/live-install-vnc-connect.cfg; @:
# add both bootloader items to be *that* explicit ;-)
use/live-install/vnc/full: use/live-install/vnc/listen use/live-install/vnc/connect; @:
# prepare bootloader for software suspend (see also live)
use/live-install/suspend:
@$(call add,BASE_PACKAGES,installer-feature-desktop-suspend-stage2)

View File

@ -0,0 +1,8 @@
#!/bin/sh -efu
installer_steps=/usr/share/install2/installer-steps
[ -f "$installer_steps" ] || exit 1
grep -q installer-livecd-install "$installer_steps" ||
sed -i '/vm/a\installer-livecd-install' "$installer_steps"

View File

@ -0,0 +1,5 @@
#!/bin/sh
# NB: grub is currently the default in ALT
sed -ri "s/^(grub|lilo)$/$GLOBAL_BASE_BOOTLOADER/" \
/usr/share/install2/installer-steps

View File

@ -0,0 +1,4 @@
#!/bin/sh
echo -n "*** vm-profile.scm provided by: "
rpm -qf /var/cache/alterator/vm-profile.scm ||:

View File

@ -0,0 +1,9 @@
#!/bin/sh -efu
PREFIX=ALTLinux
RPM_LIVE_LIST="$WORKDIR/.disk/pkglists/live/image/rpm.txt"
[ -d "$WORKDIR/$PREFIX/RPMS.main" ] || exit 0
[ -f "$RPM_LIVE_LIST" ] || exit 1
cd "$WORKDIR/$PREFIX/RPMS.main"
cat "$RPM_LIVE_LIST" | grep -v kernel-image | grep -v kernel-modules | xargs rm -fv

View File

@ -1,5 +1,10 @@
#!/bin/sh -e
# don't cripple the image to be copied over
[ -n "$GLOBAL_LIVE_INSTALL"] || \
[ -x /usr/sbin/live-install ] || \
[ -x /usr/sbin/livecd-install ] && exit 0
if [ -n "$GLOBAL_LIVE_CLEANUP_KDRIVERS" ]; then
for i in $GLOBAL_LIVE_CLEANUP_KDRIVERS; do
rm -rf /lib/modules/*/"$i"

View File

@ -0,0 +1,7 @@
default linux
label linux
menu label ^Install @relname@
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ showopts vga=@bootvga@ @bootargs@ lowmem

View File

@ -0,0 +1,5 @@
label vncconnect
menu label ^VNC install (edit to set server IP address)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ showopts nosplash @bootargs@ headless no_alt_virt_keyboard vncconnect=IP

View File

@ -0,0 +1,5 @@
label vncpasswd
menu label VNC install (<Tab>, set pass^word and connect here)
kernel /boot/vmlinuz
append initrd=/boot/@initrd@ fastboot @initrd_bootargs@ @stagename@=live init=/usr/sbin/install2-init ramdisk_size=@live_size@ showopts nosplash @bootargs@ headless no_alt_virt_keyboard vncpassword=VNCPWD

View File

@ -1,7 +1,8 @@
#!/bin/sh
# don't cripple the image to be copied over
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install ] && exit 0
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install -o -n "$GLOBAL_LIVE_INSTALL" ] &&
exit 0
# remove unused fonts
cd /usr/share/fonts/bitmap/misc/ &&

View File

@ -1,7 +1,8 @@
#!/bin/sh
# don't cripple the image to be copied over
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install ] && exit 0
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install -o -n "$GLOBAL_LIVE_INSTALL" ] &&
exit 0
# remove unused legacy/tiny fonts
#cd /usr/share/fonts/bitmap/misc/ && rm -f *ISO* *KOI* [1456]*

View File

@ -1,7 +1,8 @@
#!/bin/sh
# don't cripple the image to be copied over
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install ] && exit 0
[ -x /usr/sbin/live-install -o -x /usr/sbin/livecd-install -o -n "$GLOBAL_LIVE_INSTALL" ] &&
exit 0
# blacklisted kernel modules
sed -n 's/^blacklist[[:space:]]\+\([^[:space:]]\+\).*/\1/p' /etc/modprobe.d/* |

View File

@ -4,7 +4,8 @@
# NB: livecd-install has 50-restore-kernel.sh
[ -x /usr/sbin/live-install -o \
-x /usr/sbin/homeros-install -o \
-x /usr/sbin/luwrain-install ] && exit 0
-x /usr/sbin/luwrain-install -o \
-n "$GLOBAL_LIVE_INSTALL" ] && exit 0
# no need for the kernel in live root otherwise: it's been booted already
# NB: installkernel run by that livecd-install hook needs System.map