-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathcreateimg-rootfs-post
More file actions
executable file
·32 lines (27 loc) · 932 Bytes
/
Copy pathcreateimg-rootfs-post
File metadata and controls
executable file
·32 lines (27 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#
# This script is invoked after the createimg script copied the root partition
# to the mounted image.
#
# The first argument is the folder of the mounted root partition.
# The second argument is the folder of the source root file system before it
# was copied to the mounted partition. Some folders like /boot, /media, /root,
# and /tmp are not copied to the mounted partition.
#
# The first argument is the folder of the mounted boot partition.
# The second is the boot partition UUID
# This third is the root partition device name
#
if [ "$#" -ne 4 ]; then
echo "Usage: $0 mnt boot_dir boot_uuid root_uuid"
exit 1
fi
set -e
mnt=$1
boot_dir=$2
buuid=$3
ruuid=$4
if [ -e ${mnt}etc/ld.so.preload.disabled ]; then
mv ${mnt}etc/ld.so.preload.disabled ${mnt}etc/ld.so.preload
fi
sed -e "s;\${BOOT_DIR};$boot_dir;" -e "s/\${BOOT_UUID}/$buuid/" -e "s/\${ROOT_UUID}/$ruuid/" fstab.template > ${mnt}etc/fstab