Skip to content

Commit

Permalink
Improve alpine initrd boot media
Browse files Browse the repository at this point in the history
Use the LiveCD label to search for the install media, not the hardcoded
cdrom

Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Apr 16, 2024
1 parent 3a9b674 commit 64179f3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/alpine/collection.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
packages:
- name: "alpine"
category: "initrd"
version: "3.8.1+2"
version: "3.8.1+3"
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
# any changes to the initramfs-init.in file should be looked at and backported if necessary
12 changes: 6 additions & 6 deletions packages/alpine/files/initramfs-init
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

VERSION=3.8.1-kairos1
VERSION=3.8.1-kairos2
INIT=/sbin/init
sysroot="$ROOT"/sysroot

Expand Down Expand Up @@ -393,19 +393,19 @@ fi
# Path for booting from livecd
if grep -q cdroot /proc/cmdline ;then
rd_break pre-livecd
echo "Mounting LiveCD"
echo "Mounting Live Media"
sync
# 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
eend $?
# 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 cdrom to be available"
retry 10 test -e /dev/sr0
ebegin "Waiting for Live Media to be available"
retry 10 test -e /dev/disk/by-label/COS_LIVE
eend
# Mount read-only livecd
ebegin "Mount LiveCD RO"
retry 10 mount /dev/sr0 /media/root-ro
ebegin "Mount Live Media RO"
retry 10 mount /dev/disk/by-label/COS_LIVE /media/root-ro
eend $?
sync
# Mount squashfs into loop device
Expand Down

0 comments on commit 64179f3

Please sign in to comment.