uuid-iso: create UUID for ISO image
By default, when building an image, xorriso generates an image UUID of the form YYYY-MM-DD-hh-mm-ss-cc from the current time. If the xorriso command line has a parameter -volume_date uuid YYYYMMDDhhmmsscc then the UUID of the image is generated from it. This feature reads the current time and creates variables: UUID_ISO containing YYYY-MM-DD-hh-mm-ss-cc UUID_ISO_SHRT containing YYYYMMDDhhmmsscc Also add 60-cdrom_id.rules to initrd This allows to identify CD/DVD by UUID and use to boot the installer method:disk,uuid:YYYY-MM-DD-hh-mm-ss-cc
This commit is contained in:
parent
7fdc5f83f5
commit
0f8e976fdc
13
features.in/uuid-iso/README
Normal file
13
features.in/uuid-iso/README
Normal file
@ -0,0 +1,13 @@
|
||||
По умолчанию при сборке образа xorriso генерирует UUID образа
|
||||
вида YYYY-MM-DD-hh-mm-ss-cc из текущего времени.
|
||||
Если в командной строке xorriso есть пареметр
|
||||
-volume_date uuid YYYYMMDDhhmmsscc
|
||||
то UUID образа генерируется из него.
|
||||
Данная фича читает текущее время и создаёт переменные:
|
||||
UUID_ISO, содержащую YYYY-MM-DD-hh-mm-ss-cc
|
||||
UUID_ISO_SHRT, содержащую YYYYMMDDhhmmsscc
|
||||
Также фича добавляет в initrd файл
|
||||
/lib/udev/rules.d/60-cdrom_id.rules
|
||||
Это позволяет идентифицировать CD/DVD по UUID
|
||||
и использовать для загрузки инсталлятора
|
||||
method:disk,uuid:YYYY-MM-DD-hh-mm-ss-cc
|
8
features.in/uuid-iso/config.mk
Normal file
8
features.in/uuid-iso/config.mk
Normal file
@ -0,0 +1,8 @@
|
||||
UUID_ISO = $(shell date -u +%Y-%m-%d-%H-%M-%S-00)
|
||||
UUID_ISO_SHRT = $(shell echo $(UUID_ISO) | sed 's/-//g')
|
||||
|
||||
use/uuid-iso:
|
||||
@$(call add_feature)
|
||||
@$(call set,UUID_ISO_SHRT,$(UUID_ISO_SHRT))
|
||||
@$(call set,UUID_ISO,$(UUID_ISO))
|
||||
@$(call xport,UUID_ISO)
|
9
features.in/uuid-iso/stage1/scripts.d/20-initrd-cdrom
Executable file
9
features.in/uuid-iso/stage1/scripts.d/20-initrd-cdrom
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# add 60-cdrom_id.rules to identify CD/DVD by UUID
|
||||
# if it's available
|
||||
|
||||
if [ -f /lib/udev/rules.d/60-cdrom_id.rules ]; then
|
||||
echo "PUT_FILES += /lib/udev/rules.d/60-cdrom_id.rules" >> /etc/initrd.mk
|
||||
else
|
||||
echo "uuid-iso, 20-initrd-cdrom: skipping 60-cdrom_id.rules (missing)"
|
||||
fi
|
20
features.in/uuid-iso/stage1/scripts.d/30-propagator-method-disk-uuid
Executable file
20
features.in/uuid-iso/stage1/scripts.d/30-propagator-method-disk-uuid
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# postprocess configurations
|
||||
# set special automatic method
|
||||
# workaround the bug 39811
|
||||
|
||||
gcfg='boot/grub/grub.cfg'
|
||||
scfg='syslinux/*.cfg'
|
||||
|
||||
cd "$WORKDIR"
|
||||
|
||||
# apply method disk with uuid if available
|
||||
[ -n "$GLOBAL_UUID_ISO" ] || exit 0
|
||||
|
||||
if [ -n "$(find $scfg)" ]; then
|
||||
sed -i "s/automatic=method:cdrom/automatic=method:disk,uuid:$GLOBAL_UUID_ISO/" $scfg
|
||||
fi
|
||||
|
||||
if [ -f "$gcfg" ]; then
|
||||
sed -i "s/automatic=method:cdrom/automatic=method:disk,uuid:$GLOBAL_UUID_ISO/" $gcfg
|
||||
fi
|
Loading…
Reference in New Issue
Block a user