Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
27674e29
Commit
27674e29
authored
May 07, 2019
by
Anton Midyukov
Committed by
Michael Shigorin
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build-vm, kernel, tar2fs: make-initrd happens now in build-vm
NB: 07-kernel change breaks multi-kernel setup! Breaks:
650e92bf
parent
18951479
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
22 deletions
+47
-22
tar2fs
bin/tar2fs
+2
-20
config.mk
features.in/build-vm/config.mk
+1
-1
07-kernel
features.in/build-vm/image-scripts.d/07-kernel
+4
-0
90-build-vm.mk
features.in/build-vm/lib/90-build-vm.mk
+8
-1
config.mk
features.in/kernel/config.mk
+32
-0
No files found.
bin/tar2fs
View file @
27674e29
...
...
@@ -27,10 +27,11 @@ BOOT_SIZE_FACTOR=2 # multiply /boot size by this value additionally
CUR_BOUNDARY
=
0
# align first partition at 1MB for performance (+1)
INITRD_MODULES
=
BOOTFSTYPE
=
BOOTPART
=
BOOTLOADER
=
"
$5
"
ARCH
=
"
$(
arch
)
"
# NB: sudo => no GLOBAL_ will do either; mind qemu-*
case
"
$ARCH
"
in
...
...
@@ -209,24 +210,6 @@ fi
# Query ARCH in chroot and redefine arch-dependent variable
ARCH
=
"
$(
chroot
"
$ROOTFS
"
rpm
--eval
'%_host_cpu'
)
"
if
[[
$ARCH
=
*
86
*
]]
then
# NB: different storage modules might be needed for non-kvm
INITRD_MODULES
=
"sd_mod ata_piix ahci virtio-scsi virtio-blk"
else
INITRD_MODULES
=
fi
echo
"MODULES_PRELOAD +=
$INITRD_MODULES
$ROOTFSTYPE
"
>>
"
$ROOTFS
/etc/initrd.mk"
case
"
$ARCH
"
in
*
86
*
)
echo
"FEATURES += qemu"
>>
"
$ROOTFS
/etc/initrd.mk"
;;
e2k
)
echo
"FEATURES += usb"
>>
"
$ROOTFS
/etc/initrd.mk"
;;
esac
# NB: don't stick BOOTFS here, it has slightly different semantics
pushd
$ROOTFS
/boot
...
...
@@ -236,7 +219,6 @@ get_label() { echo "${1# *}" | sed -r 's,.*elbrus-([0-9a-z]+)-.*$,\1,'; }
KVERSIONS
=
if
[
-s
.origver
]
;
then
while
read
kver
;
do
chroot
"
$ROOTFS
"
make-initrd
-k
"
$kver
"
KVERSIONS
=
"
$KVERSIONS
$kver
"
done
< .origver
fi
...
...
features.in/build-vm/config.mk
View file @
27674e29
# hooked from lib/sugar.mk
use/build-vm: sub/rootfs@/ use/kernel
use/build-vm: sub/rootfs@/ use/kernel
/initrd-setup
@$(call add_feature)
features.in/build-vm/image-scripts.d/07-kernel
View file @
27674e29
...
...
@@ -13,6 +13,10 @@ kver="$(rpm -qa 'kernel-image*' \
cd
/boot
echo
"
$kver
"
>
.origver
# for tar2fs
make-initrd
-N
-k
"
$kver
"
AUTODETECT
=
\
FEATURES+
=
"
$GLOBAL_VM_INITRDFEATURES
"
\
MODULES_ADD+
=
"
$GLOBAL_VM_INITRDMODULES
"
# NB: e2k kernel builds "image" instead of "vmlinuz"
[
-f
vmlinuz-
$kver
]
&&
ln
-s
vmlinuz-
$kver
vmlinuz
||
:
ln
-s
initrd-
$kver
.img initrd.img
# missing at this stage
...
...
features.in/build-vm/lib/90-build-vm.mk
View file @
27674e29
...
...
@@ -10,6 +10,12 @@ IMAGE_PACKAGES = $(DOT_BASE) \
IMAGE_PACKAGES_REGEXP = $(THE_PACKAGES_REGEXP) \
$(BASE_PACKAGES_REGEXP)
ifdef EFI_BOOTLOADER
VM_BOOTLOADER=$(EFI_BOOTLOADER)
else
VM_BOOTLOADER=$(BASE_BOOTLOADER)
endif
# intermediate chroot archive
VM_TARBALL := $(IMAGE_OUTDIR)/$(IMAGE_NAME).tar
VM_RAWDISK := $(IMAGE_OUTDIR)/$(IMAGE_NAME).raw
...
...
@@ -31,7 +37,8 @@ prepare-image: check-sudo
TOPDIR=/usr/share/mkimage-profiles; \
fi; \
if ! sudo $$TOPDIR/bin/tar2fs \
"$(VM_TARBALL)" "$(VM_RAWDISK)" $(VM_SIZE) $(VM_FSTYPE); then \
"$(VM_TARBALL)" "$(VM_RAWDISK)" "$(VM_SIZE)" "$(VM_FSTYPE)" \
"$(VM_BOOTLOADER)"; then \
echo "** error: sudo tar2fs failed, see build log" >&2; \
exit 1; \
fi
...
...
features.in/kernel/config.mk
View file @
27674e29
...
...
@@ -37,3 +37,35 @@ use/kernel/desktop:
use/kernel/server:
@$(call add,THE_KMODULES,ipset kvm)
# for vm targets
use/kernel/initrd-setup: use/kernel
@$(call add,VM_INITRDFEATURES,add-modules compress cleanup)
@$(call try,VM_FSTYPE,ext4)
@$(call add,VM_INITRDMODULES,$$(VM_FSTYPE))
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
@$(call add,VM_INITRDFEATURES,qemu)
@$(call add,VM_INITRDMODULES,ata_piix)
endif
ifeq (,$(filter-out e2k%,$(ARCH)))
@$(call add,VM_INITRDFEATURES,usb)
endif
ifeq (,$(filter-out i586 x86_64 aarch64 armh,$(ARCH)))
@$(call add,VM_INITRDMODULES,ahci sd_mod)
@$(call add,VM_INITRDMODULES,nvme nvme-core)
@$(call add,VM_INITRDMODULES,virtio-scsi virtio-blk virtio-rng)
endif
ifeq (,$(filter-out aarch64 armh,$(ARCH)))
@$(call add,VM_INITRDMODULES,bcm2835 sunxi-mmc)
@$(call add,VM_INITRDMODULES,nvmem_rockchip_efuse)
@$(call add,VM_INITRDMODULES,virtio-mmio)
endif
ifeq (,$(filter-out aarch64,$(ARCH)))
@$(call add,VM_INITRDMODULES,meson-gx-mmc)
@$(call add,VM_INITRDMODULES,nvmem_meson_efuse)
endif
ifeq (,$(filter-out armh,$(ARCH)))
@$(call add,VM_INITRDMODULES,sdhci_dove sdhci_esdhc_imx)
endif
@$(call xport,VM_INITRDMODULES)
@$(call xport,VM_INITRDFEATURES)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment