Commit e52e2178 authored by Michael Shigorin's avatar Michael Shigorin

actually useful vm/icewm

See http://www.opennet.ru/openforum/vsluhforumID3/86239.html#1 for a query that has led to this one; in particular, - xdm dropped (won't log in root and there are no users yet); - network is brought up and configured via DHCP by default; - apt-get works out-of-box; - default image size is twice the chroot size.
parent 0e8871e7
#!/bin/bash -e
# usage:
# tar2vm chroot.tar image.raw [size_in_bytes]
. shell-error
......@@ -27,7 +29,7 @@ IMG="$2"
# image size in bytes (256M is a fallback)
TARSIZE="$(stat -Lc %s "$TAR")"
DEFSIZE="$((3 * $TARSIZE / 2))"
DEFSIZE="$((2 * $TARSIZE))"
DISKSIZE="${3:-${DEFSIZE:-268435456}}"
# ...and in megabytes
DISKSIZEM="$(($DISKSIZE / 1048576))"
......
# virtual machines
ifeq (vm,$(IMAGE_CLASS))
# NB: use/x11 employs some installer-feature packages
vm/icewm: vm/bare use/cleanup/installer use/x11/xdm +icewm; @:
vm/net: vm/bare use/vm-net/dhcp use/vm-ssh; @:
# NB: use/x11 employs some installer-feature packages
vm/icewm: vm/net use/cleanup/installer use/repo +icewm; @:
endif
......@@ -106,6 +106,11 @@
- пусто (по умолчанию) либо строка (например, "alpha", "beta")
+ см. ../image.in/Makefile
- VM_SIZE
+ задаёт размер несжатого образа виртуальной машины в байтах
+ значение: пусто (по умолчанию двойной размер чрута) или целое
+ см. ../features.in/build-vm/lib/90-build-vm.mk, ../bin/tar2vm
пример
~~~~~~
make DEBUG=1 CLEAN=1 distro/syslinux.iso
#!/bin/sh
# enable online repos if possible, just quit if anything's wrong
repo_source='/etc/apt/sources.list.d/alt.list'
host='http://ftp.altlinux.org'
[ -s "$repo_source" ] || exit 0
# regexps from alterator-pkg (via installer-feature-online-repo)
prefix_re="[[:space:]]*rpm[[:space:]]\+\([^[:space:]]\+[[:space:]]\+\)\?"
updates_re="${prefix_re}http:\/\/\([^[:space:]]\+\)[[:space:]]*"
# architectures
host_arch="$(rpm --eval '%_host_cpu')"
[ "$host_arch" = "x86_64" ] && compat="x86_64-i586" || compat=
# turn on unconditionally
for arch in "$host_arch" noarch "$compat"; do
sed -i "s/^#\($updates_re$arch\)/\1/" "$repo_source"
done
......@@ -8,7 +8,7 @@ ifeq (vm,$(IMAGE_CLASS))
vm/.bare: profile/bare
@$(call add,BASE_PACKAGES,interactivesystem lilo shadow-utils e2fsprogs)
@$(call set,KFLAVOURS,std-def)
@$(call set,KFLAVOURS,un-def)
vm/bare: vm/.bare
@$(call add,BASE_PACKAGES,apt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment