Add a better way of getting the label for alpine (#809)

This commit is contained in:
Itxaka
2024-04-16 12:27:07 +00:00
committed by GitHub
parent 1a5367ffd8
commit c6bb5f77a5
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
packages: packages:
- name: "alpine" - name: "alpine"
category: "initrd" category: "initrd"
version: "3.8.1+3" version: "3.8.1+4"
description: "Provides custom initrd scripts for alpine" description: "Provides custom initrd scripts for alpine"
# This syncs with the alpine version at https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in?ref_type=heads # This syncs with the alpine version at https://gitlab.alpinelinux.org/alpine/mkinitfs/-/blob/master/initramfs-init.in?ref_type=heads
# any changes to the initramfs-init.in file should be looked at and backported if necessary # any changes to the initramfs-init.in file should be looked at and backported if necessary

View File

@@ -395,17 +395,18 @@ if grep -q cdroot /proc/cmdline ;then
rd_break pre-livecd rd_break pre-livecd
echo "Mounting Live Media" echo "Mounting Live Media"
sync sync
label=$(grep -o CDLABEL.* /proc/cmdline | cut -f 1 -d ' ' | cut -f 2 -d '=' )
# Create mountpoints # Create mountpoints
ebegin "Create mountpoints" ebegin "Create mountpoints"
mkdir -p /media/root-ro /media/root-rw /run/rootfsbase $sysroot/media/root-ro $sysroot/media/root-rw $sysroot/run/rootfsbase mkdir -p /media/root-ro /media/root-rw /run/rootfsbase $sysroot/media/root-ro $sysroot/media/root-rw $sysroot/run/rootfsbase
eend $? eend $?
# Between udev starting, we loading the modules and the cdrom appearing sometimes there is a delay, so lets wait a bit here # Between udev starting, we loading the modules and the cdrom appearing sometimes there is a delay, so lets wait a bit here
ebegin "Waiting for Live Media to be available" ebegin "Waiting for Live Media to be available"
retry 10 test -e /dev/disk/by-label/COS_LIVE retry 10 test -e /dev/disk/by-label/$label
eend eend
# Mount read-only livecd # Mount read-only livecd
ebegin "Mount Live Media RO" ebegin "Mount Live Media RO"
retry 10 mount /dev/disk/by-label/COS_LIVE /media/root-ro retry 10 mount /dev/disk/by-label/$label /media/root-ro
eend $? eend $?
sync sync
# Mount squashfs into loop device # Mount squashfs into loop device