| #!/bin/bash |
| set -e |
| |
| cat << EOF > $target/etc/fstab |
| PARTLABEL=${ROOTFS_PARTLABEL} / ext4 rw,relatime,data=ordered 0 1 |
| EOF |
| |
| 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 |
| |
| # 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/ |