Riku Voipio | 0cc70ab | 2017-10-09 11:54:37 +0300 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
Riku Voipio | 6183062 | 2017-09-15 15:39:34 +0300 | [diff] [blame] | 4 | cat << EOF > $target/etc/fstab |
Niklas Cassel | b871333 | 2019-10-23 15:51:53 +0200 | [diff] [blame] | 5 | PARTLABEL=${ROOTFS_PARTLABEL} / ext4 rw,relatime,data=ordered 0 1 |
Riku Voipio | 6183062 | 2017-09-15 15:39:34 +0300 | [diff] [blame] | 6 | EOF |
Riku Voipio | a494298 | 2017-09-15 13:25:08 +0300 | [diff] [blame] | 7 | |
Nicolas Dechesne | 631d779 | 2017-11-21 13:57:04 +0000 | [diff] [blame] | 8 | if 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 |
| 15 | EOF |
| 16 | fi |
| 17 | |
Aníbal Limón | 6349426 | 2019-11-22 13:39:22 -0600 | [diff] [blame] | 18 | # Add tsched=0 on module-udev-detect to fix distorted sound |
| 19 | sed -i "s|^load-module module-udev-detect|load-module module-udev-detect tsched=0|" $target/etc/pulse/default.pa |
| 20 | |
Riku Voipio | 0cc70ab | 2017-10-09 11:54:37 +0300 | [diff] [blame] | 21 | # In case initrd doesn't exist, create it, else update |
| 22 | if [ -f $target/boot/initrd.img-${KVERS} ] |
| 23 | then |
| 24 | chroot $target /usr/sbin/update-initramfs -u -k ${KVERS} |
| 25 | else |
| 26 | chroot $target /usr/sbin/update-initramfs -c -k ${KVERS} |
| 27 | fi |
Riku Voipio | 0cc70ab | 2017-10-09 11:54:37 +0300 | [diff] [blame] | 28 | |
Nicolas Dechesne | f93e308 | 2018-06-15 14:19:37 +0000 | [diff] [blame] | 29 | # 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 Voipio | d37f6c3 | 2017-10-11 21:59:06 +0300 | [diff] [blame] | 34 | OUT=$FAI/out |
| 35 | mkdir -p $OUT |
Nicolas Dechesne | 3ca2d29 | 2017-10-13 07:27:42 +0200 | [diff] [blame] | 36 | cp $target/boot/vmlinuz-${KVERS} $OUT/ |
Riku Voipio | d37f6c3 | 2017-10-11 21:59:06 +0300 | [diff] [blame] | 37 | cp $target/usr/lib/linux-image-${KVERS}/$fdtfile $OUT/ |
Nicolas Dechesne | 3ca2d29 | 2017-10-13 07:27:42 +0200 | [diff] [blame] | 38 | cp $target/boot/initrd.img-${KVERS} $OUT/ |
| 39 | cp $target/boot/config-${KVERS} $OUT/ |
| 40 | cp $target/boot/System.map-${KVERS} $OUT/ |
Aníbal Limón | 23c8fc1 | 2020-06-02 15:49:58 -0500 | [diff] [blame^] | 41 | |
| 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. |
| 45 | if [ -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] |
| 49 | Encoding=UTF-8 |
| 50 | Exec=/usr/bin/dconf write /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type "'nothing'" |
| 51 | Name=Disable suspend |
| 52 | Comment=Disable suspend on GNOME3 |
| 53 | Terminal=false |
| 54 | OnlyShowIn=GNOME |
| 55 | Type=Application |
| 56 | StartupNotify=false |
| 57 | X-GNOME-Autostart-enabled=true |
| 58 | EOF |
| 59 | |
| 60 | chroot $target chown -R linaro:linaro /home/linaro/.config |
| 61 | fi |