ostree-initrd: Adapt patch after update of meta-updater

This patch is removing the logs from the ostree initramdisk. It had to
be adapted in regards to latest changes in meta-updater.

BugzID: 80886
This commit is contained in:
Alexandre Bard 2022-08-10 14:08:37 +02:00
parent 9027d38b10
commit 20b10c6179
1 changed files with 25 additions and 26 deletions

View File

@ -1,20 +1,20 @@
diff --git a/init.sh diff --git a/init.sh b/init.sh
index 4818a07..c2b2c64 100644 index e599451..ab6e016 100644
--- a/init.sh --- a/init.sh
+++ b/init.sh +++ b/init.sh
@@ -3,20 +3,17 @@ set -eu @@ -1,20 +1,17 @@
#!/bin/sh
# ------------------------------------------- set -eu
-log_info() { echo "$0[$$]: $*" >&2; } -log_info() { echo "$0[$$]: $*" >&2; }
log_error() { echo "$0[$$]: ERROR $*" >&2; } log_error() { echo "$0[$$]: ERROR $*" >&2; }
do_mount_fs() { do_mount_fs() {
- log_info "mounting FS: $*" - log_info "mounting FS: $*"
[[ -e /proc/filesystems ]] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } } [ -e /proc/filesystems ] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } }
[[ -d "$2" ]] || mkdir -p "$2" [ -d "$2" ] || mkdir -p "$2"
- [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } } - [ -e /proc/mounts ] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } }
+ [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { return 0; } } + [ -e /proc/mounts ] && { grep -q -e "^$1 $2 $1" /proc/mounts && { return 0; } }
mount -t "$1" "$1" "$2" mount -t "$1" "$1" "$2"
} }
@ -24,15 +24,16 @@ index 4818a07..c2b2c64 100644
#exec reboot -f #exec reboot -f
exec sh exec sh
} }
@@ -34,7 +31,6 @@ get_ostree_sysroot() { @@ -33,8 +30,6 @@ get_ostree_sysroot() {
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree
-log_info "Starting OSTree initrd script" -log_info "Starting OSTree initrd script"
-
do_mount_fs proc /proc do_mount_fs proc /proc
do_mount_fs sysfs /sys do_mount_fs sysfs /sys
@@ -58,14 +54,13 @@ ostree_sysroot=$(get_ostree_sysroot) do_mount_fs devtmpfs /dev
@@ -57,14 +52,12 @@ ostree_sysroot=$(get_ostree_sysroot)
mount "$ostree_sysroot" /sysroot || { mount "$ostree_sysroot" /sysroot || {
# The SD card in the R-Car M3 takes a bit of time to come up # The SD card in the R-Car M3 takes a bit of time to come up
# Retry the mount if it fails the first time # Retry the mount if it fails the first time
@ -43,10 +44,8 @@ index 4818a07..c2b2c64 100644
-ostree-prepare-root /sysroot -ostree-prepare-root /sysroot
+ostree-prepare-root /sysroot > /dev/null 2>&1 +ostree-prepare-root /sysroot > /dev/null 2>&1
+
-log_info "Switching to rootfs" -log_info "Switching to rootfs"
# shellcheck disable=SC2093
exec switch_root /sysroot /sbin/init exec switch_root /sysroot /sbin/init
bail_out "Failed to switch_root to $ostree_sysroot"