Compare commits

...

26 Commits

Author SHA1 Message Date
Michael Shigorin
1af5812a09 1.0.6-alt0.M70T.1
- mktmpdir: fixed sort key
2015-09-07 23:56:39 +03:00
Michael Shigorin
f187645ba4 mktmpdir: fixed sort key
The sort key field value has been off-by-one apparently,
"6" corresponds to "capacity" field of df -PT output
while the "available" one was meant:

Filesystem     Type  1024-blocks     Used Available Capacity Mounted on
/dev/sda9      ext4     15350768 12799972   1747980      88% /
tmpfs          tmpfs     1967204    27396   1939808       2% /tmp

1              2               3        4         5       6

This lapse has been five years old, looks like it's only
been masked by lower available space limit *and* filesystem
ordering by type so far.  It didn't hit me even now, rather
inspected the code while implementing volumes-profile-starterkit...
2015-09-07 23:46:46 +03:00
Michael Shigorin
140b89c211 tar2vm: fixed broken sfdisk use
Yet another age old bug: `sfdisk -l' is mimicking what
a person does by hand but the script is rather interested
in what `sfdisk -g' provides, that is, geometry.

And it's stupid enough to only grok C locale.
2015-09-07 23:45:21 +03:00
Michael Shigorin
305e7e8fde gear-store-tags 2015-02-02 23:45:15 +03:00
Michael Shigorin
bc2789e9d6 1.0.5-alt0.M70T.1
- backported pkg/lists fix (and the commit before it)
2015-02-02 23:44:32 +03:00
Michael Shigorin
ba84ab0ae3 pkg/lists: uncrustify Makefile
The problem with the changed piece of code is that it would
- both call cp(1) multiple times if multiple *_LIST variables
  were non-empty (which is usually the case), and
- try to evaluate stdout of the called commands as a shell
  script (which would be empty unless someone passed e.g. -v
  to that cp(1) but it's crazy to rely on things like this).

So the functions should prepare arguments for a single copy
command that is predictable and could be made verbose.

Ouch.
2015-02-02 23:41:45 +03:00
Michael Shigorin
0e31d305ae pkg/lists: tweak Makefile to expand variables
The issue at hand is the hack to be employed in the init feature:

	@$(call add,THE_LISTS,$$(INIT_TYPE))

where INIT_TYPE is set separately; $(value $V) would leave that kind
of substitution unmolested while we would actually need it done.
2015-02-02 23:41:29 +03:00
Michael Shigorin
c601706517 gear-store-tags 2014-03-17 20:39:06 +04:00
Michael Shigorin
d59601f7ad 1.0.4-alt0.M70T.1
- kernel: don't insist on k-m-r8168
2014-03-17 20:37:43 +04:00
Michael Shigorin
8ca80d1ac4 kernel, stage1: don't provide r8168.ko by default
It conflicts with r8169.ko inobviously.

The whole mess looks like this:
- r8169.ko doesn't work for all of Realtek 8111/8168/8169 mutations
- r8168.ko works with some of the chips r8169.ko doesn't
- r8168.ko also works with many chips r8169.ko works with
- r8169.ko is provided by kernel-image package (thus default)
- r8168.ko is provided by kernel-modules-r8168 package (optional)
- kernel-modules-r8168 package requires r8168-blacklist package
- r8168-blacklist package is a one-liner that blacklists r8169.ko
- STAGE1_KMODULES wouldn't include r8168 (std-def) or rtl8168 (led-ws)
- sub.in/stage1/modules would mention r8168.ko (m-p-d: r8169.ko)

So a LiveCD built with use/kernel/net might work with RTL8111/8110
just fine when booted live but fail to automatically load the module
when installed onto hard drive; manual modprobe r8169 would work though.
NB: some of the chips (those available to me) would work just fine
both ways -- this has contributed to fixing this *that* late.

Bottom line:

  do not install backup/kludge drivers overriding main ones by default!

Thanks sem@ for providing the crucial hint.
2014-03-14 12:09:37 +04:00
Michael Shigorin
c29ec7beaa gear-store-tags 2014-03-03 20:14:56 +04:00
Michael Shigorin
ee09a917e8 1.0.3-alt0.M70T.1
- vm fixes/backports
2014-03-03 20:13:56 +04:00
Michael Shigorin
d60492e87c vm.mk: extend vm/net base image size to 5 Gb
qemu-img makes use of sparse files so the image will take up
reasonable space when handled appropriately (and compress nicely
as well); making images of minimal size is going to result in
grave usage problems starting with apt-get update hitting ENOSPC.
2014-03-03 19:16:24 +04:00
Michael Shigorin
b84182c5cb tar2vm: use UUID, prepare for virtio as well
Thanks glebfm@ and sem@ for reminding me about UUID;
the only hardwired thing left is "sda" which *will*
break for virtio_blk case when updating the kernel;
fixing this up in a firsttime script might be due
but the diagnostics should be pretty informative.

These images boot with SATA emulation, virtio_blk setup
(plain virtio disk), and virtio_scsi setup available in
newer qemu/kvm and libvirt; one is advised to read
http://linux-kvm.com/content/virtio-scsi
2014-03-03 19:06:53 +04:00
Michael Shigorin
c4dcf994b0 tar2vm: append to MODULES_PRELOAD, do not clobber
Thanks glebfm@ for spotting that it's = instead of +=
as it goes in all the other places; I remember no good
reason to overwrite the potentially preexisting contents.

(backport)
2014-03-03 19:05:00 +04:00
Michael Shigorin
8547de0f0b vm.mk: use led-ws kernel instead of un-def
It's the most compact "generic" kernel available
in Sisyphus and some branches; led-vs might have
been more suitable but it's not supported within
p7/branch (current stable).
2014-03-01 23:00:20 +04:00
Michael Shigorin
3311ce5d80 p7.mk: added vm/net alias
vm/altlinux-p7-vm-net is yet another bridge...

(backport)
2014-03-01 22:30:54 +04:00
Michael Shigorin
d65a61ea47 vm.mk: vm/net should use/repo
IOW one has every right to expect that package manager
is set up already in a networked virtual machine.

(backport)
2014-03-01 22:30:54 +04:00
Michael Shigorin
b441894df7 vm.mk: use sysvinit
I don't see any reason to use systemd within VM images,
and it would stick its journal as a syslog implementation
when not ditched explicitly :-/

(backport)
2014-03-01 22:30:49 +04:00
Michael Shigorin
e31b12cbf8 tar2vm: use -s Luke
This is a partial backport of g4918019 commit:
"Really no need to test and sleep when there's sync mode"
2014-02-27 17:53:55 +04:00
Michael Shigorin
4b45694ee4 gear-store-tags 2013-12-24 04:15:48 +02:00
Michael Shigorin
d9f11e6fee 1.0.2-alt0.M70T.1
- backported adaptations to handle EFI signed binaries the current way
2013-12-23 14:16:23 +04:00
Michael Shigorin
7bb22cce78 efi: drop -signed subpackages
We chose to provide methods to sign packages but to avoid
signing these by default (with some arbitrary test keys)
the signatures are being added *after* the build by means
of rpmrebuild-pesign; all of this is made significantly
more complicated if there are separate -signed subpackages.

So these are being dropped in the packages; account for that.
2013-12-23 12:02:14 +02:00
Michael Shigorin
f716669bc1 gear-store-tags 2013-11-25 21:07:30 +04:00
Michael Shigorin
3b2a0649bf 1.0.1-alt0.M70T.1
- important bugfix: THE_PACKAGES weren't getting through to .base
  (backported from 1.1.14)
2013-11-25 21:06:01 +04:00
Michael Shigorin
7929f61cad metadata: fix THE_PACKAGES processing
Actually the issue was worse in general: *_PACKAGES
weren't quoted when put into .base thus resulting
in a potentially broken echo command (silent one).

The macro scheme used was overgeneralized; stuffing
quoting differentiation into it was doable but ugly
(unless one is able to pass an unquoted quote sign
as a function's parameter in some elegant manner),
let's just make it straightforward.
2013-11-25 09:33:54 +04:00
14 changed files with 86 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
Name: mkimage-profiles
Version: 1.0.0
Release: alt1
Version: 1.0.6
Release: alt0.M70T.1
Summary: ALT Linux based distribution metaprofile
License: GPLv2+
@@ -16,7 +16,7 @@ BuildRequires: /proc
Requires: rsync git-core
Requires: time schedutils sfdisk
Requires: mkimage >= 0.2.5
Requires: mkimage >= 0.2.12
# Recommends: graphviz qemu-img
@@ -78,6 +78,25 @@ cp -a * %buildroot%mpdir
%doc %docs/*
%changelog
* Mon Sep 07 2015 Michael Shigorin <mike@altlinux.org> 1.0.6-alt0.M70T.1
- mktmpdir: fixed sort key
* Mon Feb 02 2015 Michael Shigorin <mike@altlinux.org> 1.0.5-alt0.M70T.1
- backported pkg/lists fix (and the commit before it)
* Mon Mar 17 2014 Michael Shigorin <mike@altlinux.org> 1.0.4-alt0.M70T.1
- kernel: don't insist on k-m-r8168
* Mon Mar 03 2014 Michael Shigorin <mike@altlinux.org> 1.0.3-alt0.M70T.1
- vm fixes/backports
* Mon Dec 23 2013 Michael Shigorin <mike@altlinux.org> 1.0.2-alt0.M70T.1
- backported adaptations to handle EFI signed binaries the current way
* Mon Nov 25 2013 Michael Shigorin <mike@altlinux.org> 1.0.1-alt0.M70T.1
- important bugfix: THE_PACKAGES weren't getting through to .base
(backported from 1.1.14)
* Mon Jun 17 2013 Michael Shigorin <mike@altlinux.org> 1.0.0-alt1
- 1.0

View File

@@ -0,0 +1,6 @@
object bc2789e9d6f4c23270b5ac7f9f31c257620259a1
type commit
tag v1.0.5
tagger Michael Shigorin <mike@altlinux.org> 1422909897 +0300
lists fix backported

View File

@@ -1,6 +0,0 @@
object 5ffd07c65e360561c7a04f41aff746d9caa165cd
type commit
tag v1.0.0
tagger Michael Shigorin <mike@altlinux.org> 1371463392 +0400
1.0

View File

@@ -1 +1 @@
5f4103e2678b4db8760eda8622f094f694f9cdcd v1.0.0
4817a708672e35513e7c25a38d8646a61ed10179 v1.0.5

View File

@@ -45,7 +45,7 @@ choose_tmpdir() {
echo -n "$i "
df -PT "$i" | tail -1
done \
| sort -unk6 \
| sort -unk5 \
| while read dir dev fstype size used free percent mnt; do
check_options "$dev" "$mnt" || continue
[ "$free" -gt "$MINSIZE" ] || continue

View File

@@ -3,6 +3,7 @@
# tar2vm chroot.tar image.raw [size_in_bytes]
. shell-error
export LANG=C
if [ $# -lt 2 ]; then
fatal "error: tar2vm needs at least two arguments"
@@ -38,9 +39,10 @@ DISKSIZEM="$(($DISKSIZE / 1048576))"
# NB: xfs doesn't have a spare sector for the bootloader
ROOTFSTYPE="${4:-ext4}"
# single root partition hardwired so far,
# add another image for swap if needed
ROOTDEV="/dev/sda1"
# SCSI case hardwired so far;
# use virtio_scsi setup if performance is critical
# *and* updating the image is going to occur
BOOTDEV="/dev/sda"
# last preparations...
for i in losetup sfdisk parted kpartx mkfs."$ROOTFSTYPE"; do
@@ -78,20 +80,29 @@ losetup "$LOOPDEV" "$IMG"
parted --script "$LOOPDEV" mklabel msdos
parted --script "$LOOPDEV" mkpart primary ext2 1 "$DISKSIZEM"
kpartx -a "$LOOPDEV"
kpartx -a -s "$LOOPDEV"
LOOPDEV1="/dev/mapper/$(basename "$LOOPDEV")p1"
mkfs."$ROOTFSTYPE" "$LOOPDEV1"
ROOTUUID="$(blkid -s UUID -o value -c /dev/null "$LOOPDEV1")"
if [ -n "$ROOTUUID" ]; then
ROOTDEV="UUID=$ROOTUUID"
else
ROOTDEV="${BOOTDEV}1"
fi
# mount and populate it
mkdir -pm755 "$ROOTFS"
mount "$LOOPDEV1" "$ROOTFS"
tar -C "$ROOTFS" --numeric-owner -xf "$TAR"
for i in /dev /proc /sys; do mount --bind "$i" "$ROOTFS$i"; done
# NB: different storage modules might be needed for non-kvm
# NB: different storage modules might be needed for different VMs
VIRTIO_MODULES="virtio_pci virtio_blk virtio_scsi"
echo "$LOOPDEV1 / $ROOTFSTYPE defaults 1 1" >> "$ROOTFS/etc/fstab"
echo "MODULES_PRELOAD=sd_mod ata_piix $ROOTFSTYPE" >> "$ROOTFS/etc/initrd.mk"
echo "MODULES_PRELOAD += sd_mod ata_piix $VIRTIO_MODULES $ROOTFSTYPE" \
>> "$ROOTFS/etc/initrd.mk"
KERNEL="$(readlink $ROOTFS/boot/vmlinuz | sed 's,vmlinuz-,,')"
chroot "$ROOTFS" make-initrd -k "$KERNEL"
@@ -99,8 +110,8 @@ chroot "$ROOTFS" make-initrd -k "$KERNEL"
sed -i "s,$LOOPDEV1,$ROOTDEV," "$ROOTFS/etc/fstab"
# configure and install bootloader
REGEXP='^Disk .*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$'
set -- $(sfdisk -l "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@")
REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$'
set -- $(sfdisk -g "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@")
LILO_COMMON="lba32
delay=1
@@ -125,7 +136,7 @@ EOF
chroot "$ROOTFS" lilo -C /etc/lilo-loop.conf
cat > "$ROOTFS"/etc/lilo.conf << EOF
boot=${ROOTDEV%[0-9]*}
boot=$BOOTDEV
$LILO_COMMON
EOF

View File

@@ -1,9 +1,10 @@
# p7 base kits
ifeq (distro,$(IMAGE_CLASS))
mixin/p7:
@$(call set,BRANDING,altlinux-starterkit)
ifeq (distro,$(IMAGE_CLASS))
### kludge compatibility: introspection stub for ../main.mk :-/
distro/altlinux-p7-cinnamon: distro/regular-cinnamon mixin/p7; @:
distro/altlinux-p7-e17: distro/regular-e17 mixin/p7; @:
@@ -18,3 +19,7 @@ distro/altlinux-p7-tde: distro/regular-tde mixin/p7; @:
distro/altlinux-p7-xfce: distro/regular-xfce mixin/p7; @:
endif
ifeq (vm,$(IMAGE_CLASS))
vm/altlinux-p7-vm-net: vm/net mixin/p7; @:
endif

View File

@@ -1,9 +1,10 @@
# virtual machines
ifeq (vm,$(IMAGE_CLASS))
vm/net: vm/bare use/vm-net/dhcp use/vm-ssh; @:
vm/net: vm/bare use/vm-net/dhcp use/vm-ssh use/repo
@$(call set,VM_SIZE,5368709120) # 5 Gb is enough for everyone
# NB: use/x11 employs some installer-feature packages
vm/icewm: vm/net use/cleanup/installer use/repo +icewm; @:
vm/icewm: vm/net use/cleanup/installer +icewm; @:
endif

View File

@@ -18,11 +18,9 @@ use/efi/refind: use/efi
@$(call set,EFI_BOOTLOADER,refind)
use/efi/signed: use/efi
@$(call set,MKI_VER_MINIMAL,0.2.7) # refind->elilo handoff
@$(call set,MKI_VER_MINIMAL,0.2.7) # refind->elilo handoff ### 0.2.11
@$(call set,EFI_CERT,altlinux)
@$(call add,THE_PACKAGES,shim-signed)
@$(call set,EFI_SHELL,efi-shell-signed) # even more useful
@$(call add,RESCUE_PACKAGES,refind-signed)
@$(call add,RESCUE_PACKAGES,openssl sbsigntools)
use/efi/shell: use/efi

View File

@@ -9,5 +9,7 @@ use/kernel:
@$(call add_feature)
@$(call set,KFLAVOURS,std-def)
# r8168 is a kludge, never install it by default
use/kernel/net:
@$(call add,THE_KMODULES,e1000e igb r8168 rtl8168)
@$(call add,THE_KMODULES,e1000e igb)
@$(call add,MAIN_KMODULES,r8168 rtl8168)

View File

@@ -9,22 +9,25 @@ WHATEVER += metadata
# handle these too
DOT_BASE += $(BASE_PACKAGES_REGEXP)
# args: name, suffix, command
define dump-THEM
if [ -n "$($(1)_$(2))" ]; then echo -e "\n## $(1)_$(2)"; $(3) $($(1)_$(2)); fi;
# args: type, name
define dump
if [ -n "$($(2)_$(1))" ]; then \
echo -e "\n## $(2)_$(1)"; \
case "$(1)" in \
PACKAGES) echo "$($(2)_$(1))";; \
LISTS) cat $($(2)_$(1));; \
esac; \
fi;
endef
dump-PACKAGES = $(call dump-THEM,$(1),PACKAGES,echo)
dump-LISTS = $(call dump-THEM,$(1),LISTS,cat)
# BASE_PACKAGES, BASE_LISTS and whatever else goes into base install;
# thus construct requisite .base packagelist for alterator-pkg
metadata-.base:
@cd $(call list,/); \
{ \
echo "## generated by features.in/metadata/lib/metadata.mk"; \
$(foreach p,SYSTEM COMMON THE BASE,$(call dump-PACKAGES,$(p))) \
$(foreach l,THE BASE,$(call dump-LISTS,$(l))) \
echo "## generated by features.in/metadata/lib/50-metadata.mk";\
$(foreach p,SYSTEM COMMON THE BASE,$(call dump,PACKAGES,$(p))) \
$(foreach l,THE BASE,$(call dump,LISTS,$(l))) \
if [ -n "$(DOT_BASE)" ]; then \
echo -e "\n## DOT_BASE\n$(DOT_BASE)"; \
fi; \

View File

@@ -7,8 +7,10 @@ endif
ifeq (vm,$(IMAGE_CLASS))
vm/.bare: profile/bare
@$(call add,BASE_PACKAGES,interactivesystem lilo shadow-utils e2fsprogs)
@$(call set,KFLAVOURS,un-def)
@$(call add,BASE_PACKAGES,sysklogd syslogd sysvinit interactivesystem)
@$(call add,BASE_PACKAGES,lilo shadow-utils e2fsprogs)
@$(call set,KFLAVOURS,led-ws)
@$(call add,BASE_KMODULES,guest)
vm/bare: vm/.bare
@$(call add,BASE_PACKAGES,apt)

View File

@@ -21,13 +21,12 @@ TARGET := $(BUILDDIR)/$(SUFFIX)
all: $(TARGET) $(GLOBAL_DEBUG) $(DOTBASE) copy-lists copy-groups
@mp-commit "$(TARGET)" "requested $(SUFFIX) copied over"
# env | sort -u | grep _LISTS | xargs cp
copy-lists:
@# env | sort -u | grep _LISTS | xargs cp
@$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\
$(shell cp --parents -at $(TARGET) \
-- $(value $V))))
@cp --parents -at $(TARGET) -- \
$(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),$($V)))
copy-groups:
@if [ -n "$(THE_GROUPS)$(MAIN_GROUPS)" ]; then \
@@ -43,6 +42,6 @@ debug:
@echo -e $(foreach V, \
$(filter %_LISTS,$(sort $(.VARIABLES))), \
$(if $(filter environment% file,$(origin $V)),\
$(shell echo '\\n"**"' $V: $(value $V)))) '\n'
$(shell echo '\\n"**"' $V: $($V)))) '\n'
endif

View File

@@ -169,7 +169,7 @@ qlogicfas408.ko
qlogicfas.ko
qlogicfc.ko
qlogicisp.ko
r8168.ko
r8169.ko
raid_class.ko
reiserfs.ko
rrunner.ko