aboutsummaryrefslogtreecommitdiff
path: root/scripts/QCOM/21-customize
blob: b5e62108c30caa118e4f2ee35413bbda4ecc2957 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -e

cat << EOF > $target/etc/fstab
PARTLABEL=${ROOTFS_PARTLABEL} / ext4   rw,relatime,data=ordered 0 1
EOF

# Add symlink to trigger systemd start of ttyMSM0 console
ln -sf "/lib/systemd/system/serial-getty@.service" "$target/etc/systemd/system/getty.target.wants/serial-getty@${SERIAL_CONSOLE}.service"

if ifclass INSTALLER; then
    # no need to resize rootfs for SD card boot
    rm -f $target/lib/systemd/system/resize-helper.service

    # needed by GUI installer
    cat << EOF >> $target/etc/fstab
/dev/mmcblk1p9 /mnt vfat defaults 0 0
EOF
fi

# Add tsched=0 on module-udev-detect to fix distorted sound
sed -i "s|^load-module module-udev-detect|load-module module-udev-detect tsched=0|" $target/etc/pulse/default.pa

# In case initrd doesn't exist, create it, else update
if [ -f $target/boot/initrd.img-${KVERS} ]
then
    chroot $target /usr/sbin/update-initramfs -u -k ${KVERS}
else
    chroot $target /usr/sbin/update-initramfs -c -k ${KVERS}
fi

# Hold the kernel package to avoid kernel upgrade
# This is a workaround to avoid upgrade the kernel (hence the modules in /lib/modules)
# without updating the boot image
$ROOTCMD apt-mark hold linux-image-${KVERS}

OUT=$FAI/out
mkdir -p $OUT
cp $target/boot/vmlinuz-${KVERS} $OUT/
cp $target/usr/lib/linux-image-${KVERS}/$fdtfile $OUT/
cp $target/boot/initrd.img-${KVERS} $OUT/
cp $target/boot/config-${KVERS} $OUT/
cp $target/boot/System.map-${KVERS} $OUT/

# Disable GDM3 suspend causes problems in DB845c
# GDM provides PostLogin hook but dosen't set DISPLAY and dconf.
# gsettings tools cannot be used.
if [ -d $target/etc/gdm3 ]; then
    mkdir -p $target/home/linaro/.config/autostart/
    cat > $target/home/linaro/.config/autostart/nosuspend.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Exec=/usr/bin/dconf write /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type "'nothing'"
Name=Disable suspend
Comment=Disable suspend on GNOME3
Terminal=false
OnlyShowIn=GNOME
Type=Application
StartupNotify=false
X-GNOME-Autostart-enabled=true
EOF

    chroot $target chown -R linaro:linaro /home/linaro/.config
fi