avafinger / nanopi-a64-firmware

Nano Pi A64 firmware ( u-boot, kernel 3.10.104 / kernel 3.10.105 )
10 stars 5 forks source link

Changes to make it work in Ubuntu #1

Closed michaeldg closed 7 years ago

michaeldg commented 7 years ago

Very nice work!

I have some changes to make it work on Ubuntu 16.04 with a 4.4.0 kernel, the partition number is 'p1' instead of '1'. Shall I make a pull request?

michael@michaellaptop2016:~/nanopi-a64-firmware$ git diff
diff --git a/flash_sd.sh b/flash_sd.sh
index b9cac29..d10648e 100755
--- a/flash_sd.sh
+++ b/flash_sd.sh
@@ -53,20 +53,20 @@ pt_warn "Flashing $SDCARD...."
 dd if=./boot0.bin conv=notrunc bs=1k seek=8 of=${SDCARD}
 dd if=./ub-nanopi-a64.bin conv=notrunc bs=1k seek=19096 of=${SDCARD}

-pt_info "Decompressing rootfs to $SDCARD"2", please wait... (takes some time)"
+pt_info "Decompressing rootfs to $SDCARD"p2", please wait... (takes some time)"
 mkdir -p erootfs
 sudo partprobe ${SDCARD}
 sleep 4
-sudo mount $SDCARD"2" erootfs
+sudo mount $SDCARD"p2" erootfs
 tar -xvpzf rootfs_nanopia64_rc1.tar.gz -C ./erootfs --numeric-ow
 sync
 sudo umount erootfs
 rm -fR erootfs
 sync
-pt_info "Decompressing boot to $SDCARD"1", please wait..."
+pt_info "Decompressing boot to $SDCARD"p1", please wait..."
 set +e
 mkdir eboot
-sudo mount $SDCARD"1" eboot
+sudo mount -t vfat $SDCARD"p1" eboot
 tar -xvpzf boot_nanopia64_rc1.tar.gz -C ./eboot --no-same-owner
 sync
 sudo umount eboot
diff --git a/format_sd.sh b/format_sd.sh
index 6b18a95..0dfdf07 100755
--- a/format_sd.sh
+++ b/format_sd.sh
@@ -81,13 +81,13 @@ sync

 pt_warn "Formating $out ..."
 # Create boot file system (VFAT)
-dd if=/dev/zero bs=1M count=${boot_size} of=${out}1
-mkfs.vfat -n boot -I ${out}1
+dd if=/dev/zero bs=1M count=${boot_size} of=${out}p1
+mkfs.vfat -n boot -I ${out}p1

 # Create ext4 file system for rootfs
-mkfs.ext4 -F -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}2
+mkfs.ext4 -F -b 4096 -E stride=2,stripe-width=1024 -L rootfs ${out}p2
 sync
-sudo tune2fs -O ^has_journal ${out}2
+sudo tune2fs -O ^has_journal ${out}p2
 sync

Cheers, Michaël

avafinger commented 7 years ago

Please, do it. I thought i had fixed this error. Can you push your kernel 4.4 to github so i can build and test your kernel with an ext4 partition? If it is already there pelase give some pointers, thanks

michaeldg commented 7 years ago

I am sorry for the misunderstanding, my amd64 laptop is running Ubuntu with that kernel, I did not compile it for the NanoPI.

The patch provided is to make your scripts work on my system, to write the SD card. I will modify my changes to make it detect 'p1' partitions or not (my systems has the partitions on /dev/mmcblk0p2, I suppose your system has them on /dev/sdc2).

Give me some time though, I am leaving for 2 weeks of holidays tomorrow.

avafinger commented 7 years ago

No problem.

michaeldg commented 7 years ago

Fixed in pull request #4