blob: 6c30d6ae1b06cafa201eb3d9051918da03fa8493 [file] [log] [blame]
#!/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"
# 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
# Rebuild all initramfs/initrd
rm -f $target/boot/initrd.img-*
chroot $target /usr/sbin/update-initramfs -c -k all
OUT=$FAI/out
mkdir -p $OUT
cp $target/boot/vmlinuz-* $OUT/
cp -a $target/usr/lib/linux-image-*/ $OUT/dtbs
cp $target/boot/initrd.img-* $OUT/
cp $target/boot/config-* $OUT/
cp $target/boot/System.map-* $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