summaryrefslogtreecommitdiff
path: root/config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom/01gfxoverlay
blob: 9e4d9134ec6eb822f4041922142f26ddb5b74eb5 (plain)
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
#!/bin/sh

[ ! -f /etc/gfxoverlay ] && exit 0

gfx="$(cat /etc/gfxoverlay)"
bit=32
[ "$(uname -m)" = "x86_64" ] && bit=64

mkdir -p /live/gfxoverlay /root/live/gfxoverlay
for overlay in /root/live/image/gfxoverlay.* /root/live/image/gfxoverlay/$gfx.*
do
    [ ! -e "$overlay" ] && continue
    mount -o loop "$overlay" /live/gfxoverlay
    for dir in /live/gfxoverlay/overlay$bit-$gfx /live/gfxoverlay/$gfx /live/gfxoverlay
    do
        if [ -d $dir/lib ]; then
            mount -o remount,add:1:$dir /root
            mount -n -o move /live/gfxoverlay /root/live/gfxoverlay
	    exit 0
	fi
    done
    umount /live/gfxoverlay
done
rmdir /live/gfxoverlay /root/live/gfxoverlay