mkinitrd-recovery: Make required file list of HAL layer 11/257011/2
authorDongwoo Lee <dwoo08.lee@samsung.com>
Fri, 9 Apr 2021 04:38:56 +0000 (13:38 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 20 Apr 2021 01:46:59 +0000 (10:46 +0900)
If HAL layers are packed by a separated image, in order to provide the
latest HAL-related files, they should be copied from HAL image instead
of being accessed by mount point, and those copying should be
conducted at every boot-time.

To this end, this applies the process into do_copy checking file path
has 'hal' prefix and thus adding it to the list.

Change-Id: I144e5f1e32f6809accb0b3b3974ef6de4c8addac
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/initrd-recovery/mkinitrd-recovery.sh.in

index 8da67cc6b69122eaebdfdf197143f372de3b936b..5cfbc5516bc3c341bc4886236f685641d8459358 100755 (executable)
@@ -32,6 +32,7 @@ else
 fi
 
 INITRD_ROOT="/mnt/initrd-recovery"
+HAL_LIST="${INITRD_ROOT}/hal/.hal_list"
 
 OBJECTS_SPECIFY_DIR="@INITRD_RECOVERY_INSTALL_DROPIN_DIR@"
 OBJECTS_DIRECTORY=
@@ -56,6 +57,7 @@ BASE_DIRECTORIES="
 /usr/sbin
 /usr/lib
 /var/log
+/hal
 "
 
 BASE_DIR_SYMLINKS="
@@ -124,6 +126,13 @@ do_copy() {
     src=$1
     dst="$INITRD_ROOT/$src"
 
+    path_prefix=$(echo $src | "$CUT" -d '/' -f 2)
+
+    if [ "$path_prefix" == "hal" ]; then
+        remain=$(echo $src | "$SED" 's/\/hal\///')
+        echo "$remain" >> $HAL_LIST
+    fi
+
     if [ ! -e "$src" -o -e "$dst" ]; then
         return
     fi