blob: 6fcfe399f7c5feab5224997f07e4ea97a8493eb7 [file] [log] [blame]
Riku Voipio0cc70ab2017-10-09 11:54:37 +03001#!/bin/bash
2set -e
3
Riku Voipio61830622017-09-15 15:39:34 +03004cat << EOF > $target/etc/fstab
Niklas Casselb8713332019-10-23 15:51:53 +02005PARTLABEL=${ROOTFS_PARTLABEL} / ext4 rw,relatime,data=ordered 0 1
Riku Voipio61830622017-09-15 15:39:34 +03006EOF
Riku Voipioa4942982017-09-15 13:25:08 +03007
Nicolas Dechesne631d7792017-11-21 13:57:04 +00008if ifclass INSTALLER; then
9 # no need to resize rootfs for SD card boot
10 rm -f $target/lib/systemd/system/resize-helper.service
11
12 # needed by GUI installer
13 cat << EOF >> $target/etc/fstab
14/dev/mmcblk1p9 /mnt vfat defaults 0 0
15EOF
16fi
17
Aníbal Limón63494262019-11-22 13:39:22 -060018# Add tsched=0 on module-udev-detect to fix distorted sound
19sed -i "s|^load-module module-udev-detect|load-module module-udev-detect tsched=0|" $target/etc/pulse/default.pa
20
Riku Voipio0cc70ab2017-10-09 11:54:37 +030021# In case initrd doesn't exist, create it, else update
22if [ -f $target/boot/initrd.img-${KVERS} ]
23then
24 chroot $target /usr/sbin/update-initramfs -u -k ${KVERS}
25else
26 chroot $target /usr/sbin/update-initramfs -c -k ${KVERS}
27fi
Riku Voipio0cc70ab2017-10-09 11:54:37 +030028
Nicolas Dechesnef93e3082018-06-15 14:19:37 +000029# Hold the kernel package to avoid kernel upgrade
30# This is a workaround to avoid upgrade the kernel (hence the modules in /lib/modules)
31# without updating the boot image
32$ROOTCMD apt-mark hold linux-image-${KVERS}
33
Riku Voipiod37f6c32017-10-11 21:59:06 +030034OUT=$FAI/out
35mkdir -p $OUT
Nicolas Dechesne3ca2d292017-10-13 07:27:42 +020036cp $target/boot/vmlinuz-${KVERS} $OUT/
Riku Voipiod37f6c32017-10-11 21:59:06 +030037cp $target/usr/lib/linux-image-${KVERS}/$fdtfile $OUT/
Nicolas Dechesne3ca2d292017-10-13 07:27:42 +020038cp $target/boot/initrd.img-${KVERS} $OUT/
39cp $target/boot/config-${KVERS} $OUT/
40cp $target/boot/System.map-${KVERS} $OUT/
Aníbal Limón23c8fc12020-06-02 15:49:58 -050041
42# Disable GDM3 suspend causes problems in DB845c
43# GDM provides PostLogin hook but dosen't set DISPLAY and dconf.
44# gsettings tools cannot be used.
45if [ -d $target/etc/gdm3 ]; then
46 mkdir -p $target/home/linaro/.config/autostart/
47 cat > $target/home/linaro/.config/autostart/nosuspend.desktop << EOF
48[Desktop Entry]
49Encoding=UTF-8
50Exec=/usr/bin/dconf write /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type "'nothing'"
51Name=Disable suspend
52Comment=Disable suspend on GNOME3
53Terminal=false
54OnlyShowIn=GNOME
55Type=Application
56StartupNotify=false
57X-GNOME-Autostart-enabled=true
58EOF
59
60 chroot $target chown -R linaro:linaro /home/linaro/.config
61fi