Fixed nand-sata-install for Cubieboard 1 , together with kernel upgrading

This commit is contained in:
Igor Pecovnik 2016-01-30 21:47:09 +01:00
parent 0bc48fad95
commit c7055e8798
2 changed files with 8 additions and 1 deletions

View File

@ -169,7 +169,7 @@ index ed7ccdc..4bda948 100644
for script in postinst postrm preinst prerm ; do
mkdir -p "$tmpdir$debhookdir/$script.d"
cat <<EOF > "$tmpdir/DEBIAN/$script"
@@ -149,12 +201,39 @@ set -e
@@ -149,12 +201,40 @@ set -e
# Pass maintainer script parameters to hook scripts
export DEB_MAINT_PARAMS="\$*"
@ -204,6 +204,7 @@ index ed7ccdc..4bda948 100644
+sed -e "s/exit 0//g" -i $tmpdir/DEBIAN/preinst
+cat >> $tmpdir/DEBIAN/preinst <<EOT
+rm -f /boot/System.map* /boot/config* /boot/vmlinuz* /boot/zImage /boot/uImage /boot/initrd*
+if [ "\$(cat /var/run/machine.id)" = "Cubieboard" ]; then umount /boot; fi
+EOT
+echo "exit 0" >> $tmpdir/DEBIAN/preinst
+

View File

@ -74,6 +74,12 @@ extraargs=console=tty1 hdmi.audio=EDID:0 disp.screen0_output_mode=EDID:0 console
EOF
sync
[[ $DEVICE_TYPE = "a20" ]] && echo "machid=10bb" >> /mnt/bootfs/uEnv.txt
# ugly hack becouse we don't have sources for A10 nand uboot
if [[ $(cat /var/run/machine.id) == "Cubieboard" ]]; then
cp /mnt/bootfs/uEnv.txt /mnt/rootfs/boot/uEnv.txt
cp /mnt/bootfs/script.bin /mnt/rootfs/boot/script.bin
cp /mnt/bootfs/uImage /mnt/rootfs/boot/uImage
fi
umountdevice "/dev/nand"
tune2fs -o journal_data_writeback /dev/nand2 >/dev/null 2>&1
tune2fs -O ^has_journal /dev/nand2 >/dev/null 2>&1