Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build_vm
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ main() {
assert_value target ${target} alt-server alt-workstation alt-kworkstation
assert_value arch ${arch} i586 x86_64
assert_value headless ${headless} true false
assert_value BASE_VERSION ${BASE_VERSION} '8sp' '8sp-yandex' '10' '10.1' '10.2' '10.1-vmware' '10.2-vmware' '10-yandex' '10.1-yandex' 'c10f1' 'c10f1-vmware' 'c10f2' 'c10f2-vmware' 'sisyphus'
assert_value TARGET_VERSION ${TARGET_VERSION} '8sp' '8sp-yandex' '10' '10.1' '10.2' '10.1-vmware' '10.2-vmware' '10-yandex' '10.1-yandex' 'c10f1' 'c10f1-vmware' 'c10f2' 'c10f2-vmware' 'sisyphus'
assert_value BASE_VERSION ${BASE_VERSION} '8sp' '8sp-yandex' '10' '10.1' '10.2' '10.4' '10.1-vmware' '10.2-vmware' '10.4-vmware' '10-yandex' '10.1-yandex' 'c10f1' 'c10f1-vmware' 'c10f2' 'c10f2-vmware' 'sisyphus'
assert_value TARGET_VERSION ${TARGET_VERSION} '8sp' '8sp-yandex' '10' '10.1' '10.2' '10.4' '10.1-vmware' '10.2-vmware' '10.4-vmware' '10-yandex' '10.1-yandex' 'c10f1' 'c10f1-vmware' 'c10f2' 'c10f2-vmware' 'sisyphus'
assert_value VM_TYPE ${VM_TYPE} qemu onebula vbox vagrant-qemu vagrant-vbox cloud vsphere openuds-actor
assert_value onerror ${onerror} ask cleanup abort

Expand Down
15 changes: 15 additions & 0 deletions config/alt-workstation-10.4-x86_64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"iso_url": "http://ftp.altlinux.org/pub/distributions/ALTLinux/p10/images/workstation/x86_64/alt-workstation-10.4-x86_64.iso",
"iso_target_path": "alt-workstation-10.4-x86_64.iso",
"iso_checksum": "bedfda720eeb07f2d6127bbcbc4e16d4",
"iso_checksum_type": "md5",
"boot_escape_cmd": "c",
"boot_cmd": "linux /boot/vmlinuz showopts net.ifnames=0 selinux=0 changedisk automatic=method:cdrom lowmem",
"boot_finish_cmd": "<wait><enter>initrd /boot/initrd.img<enter>boot<enter>",
"metadata": "alt-workstation-10.4-x86_64",
"descr": "ALT Linux Workstation 10.4 x86_64",
"image_version": "1.0.0",
"with_cloudinit": "1",
"with_sisyphus": "0"
}

65 changes: 65 additions & 0 deletions metadata/alt-workstation-10.4-x86_64/autoinstall.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
("/sysconfig-base/language" action "write" lang ("ru_RU"))
("/sysconfig-base/kbd" action "write" layout "ctrl_shift_toggle")
; Alterator in p9 prevents from installing "UTC" zone somehow.
("/datetime-installer" action "write" commit #t name "RU" zone "Europe/Moscow" utc #t)

("/evms/control" action "write" control open installer #t)
("/evms/control" action "write" control update)
; Choices other than "workstation" are not really working.
("/evms/profiles/workstation" action apply commit #f clearall #t exclude ())
("/evms/control" action "write" control commit)
("/evms/control" action "write" control close)

("pkg-install-init" action "write")
; Package lists for installation are taken from 'pkg-groups.tar' file
; which originally resides in 'Metadata' directory inside installation
; image/ISO. You may get the idea about necessary packages by
; running installation process with 'instdebug' option passed as
; kernel argument and then looking at '/tmp/wizard.log' script.
;
; Please note that in this case the package group called 'alterator'
; is unavoidable otherwise the '/preinstall' step will go into
; inifinite loop waiting for non-existent 'alteratord' to start in
; chrooted environment. Other package groups may be optional.
;
; It's also advised to avoid installing 'selinux-altlinux-server' package
; group in SELinux-enabled distros because SELinux must be disabled to
; perform 'apt-get dist-upgrade' which you will eventually try to
; perform when VM is up.
;
; SUDDENLY: You won't get Alterator in installed system chroot without
; "/pkg-install" call even if no package lists needed so you MUST invoke
; it every time.
("/pkg-install" action "write" lists "" auto #t)
("/preinstall" action "write")

; It should be noted that 'virtio' block device driver will render
; device file names as '/dev/vda', not '/dev/sda' under QEMU. Alterator
; is unable to handle errors returned by applications it calls
; internally so you will get unbootable VM in case of device name
; mismatch without any errors.
;
; In this case the driver 'virtio-scsi' is used when building box under
; QEMU which makes devices to look like classic '/dev/sda'. It allows
; to have one 'autoinstall.scm' file for both QEMU and VirtualBox
; reducing duplication, errors and differences.
("/grub" action "write" device "/dev/sda" passwd #f passwd_1 "*" passwd_2 "*")

("/net-eth" action "write" reset #t)
; There is a problem with 8SP networking - "persistent" interface names
; are turned on by default and there is no 'alterator-postinstall'
; package included in initrd so there is no way to know the network
; interface namem when the system is finally booted.
;
; Here we have settings (enp0s3) for QEMU and (ens4) for VirtualBox
; builds. Please note that you may need to adjust interface names when
; building VMs using this autoinstall scripts.
("/net-eth" action "write" name "eth0" ipv "4" configuration "dhcp" controlled "NetworkManagerNative" search "" dns "" computer_name "c245" ipv_enabled #t)
("/net-eth" action "write" name "enp0s3" ipv "4" configuration "dhcp" controlled "NetworkManagerNative" search "" dns "" computer_name "c245" ipv_enabled #t)
("/net-eth" action "write" commit #t)

("/root/change_password" language ("ru_RU") passwd_2 "123" passwd_1 "123")

; There is no sshd available in Workstation by default so we enable it
("/postinstall/laststate" run "cd $(dirname $AUTOINSTALL); cp-metadata autoinstall.sh; bash ./autoinstall.sh; cd -")
("/postinstall/firsttime" run "systemctl enable sshd; systemctl start sshd")
14 changes: 14 additions & 0 deletions metadata/alt-workstation-10.4-x86_64/autoinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

dest="$ALTERATOR_DESTDIR"
iface="$(ls -1 /sys/class/net/ | grep -v ^lo$ | head -1)"

apt-get -y remove virtualbox-guest-common-vboxguest virtualbox-guest-common-vboxvideo virtualbox-common
rm -f /etc/modules-load.d/virtualbox-addition.conf
rm -f $dest/etc/modules-load.d/virtualbox-addition.conf

mkdir -p "$dest/etc/systemd/system/network.service.d"
echo -e "[Unit]\nRequires=sys-subsystem-net-devices-$iface.device\nAfter=sys-subsystem-net-devices-$iface.device" >$dest/etc/systemd/system/network.service.d/$iface.conf

echo "PasswordAuthentication yes" >> $dest/etc/openssh/sshd_config
echo "PermitRootLogin yes" >> $dest/etc/openssh/sshd_config
7 changes: 7 additions & 0 deletions metadata/alt-workstation-10.4-x86_64/vm-profile.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
((workstation
(title . "Setup for workstation")
(action . trivial)
(actiondata
("/" (size 20971520 . 20971520 ) (fsim . "Ext2/3") (methods plain))
;("/var" (size 1024000 . #t) (fsim . "Ext2/3") (methods plain))
)))
2 changes: 1 addition & 1 deletion scripts/steps/setup_minimalize_workstation_10.2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

echo "Minimalize VM for clouds"
apt-get remove -y -D \
docs-alt-server \
docs-alt-workstation \
dosfstools \
eject \
fatresize \
Expand Down
2 changes: 1 addition & 1 deletion scripts/vm_setup
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ main() {
${STEP_DIR}/setup_remove_etcnet
${STEP_DIR}/setup_minimalize_server_10.1
;;
'10.2')
'10.2' | '10.4')
${STEP_DIR}/setup_remove_etcnet
if test "${TARGET}" == "alt-workstation"; then
${STEP_DIR}/setup_minimalize_workstation_10.2
Expand Down