How to get Debian working


#21

Hi,

Are you using the Linaro rootfs image or the proper Debian one from here: http://blackstar.xs4all.nl/debian-hikey960-public.rootfs.img.gz? The Linaro one was built for the old Hikey board, not the Hikey960, so it doesn’t support the Hikey960 peripherals properly, since (I think) the device tree and modules are wrong.

Try the steps in this message: How to get Debian working

If that doesn’t work, post the output of dmesg.


#22

Yes , that is probably the reason - thank you. I used the rootfs from linaro, because when using the rootfs from blackstar I get a small root (2GB) and even if I add space by deleting other partitions I am unable to add it to root (SInce root is mapped to / and not to /dev/sdd10 as was the case in linaro’s rootfs)


#23

@Omer_Schleifer @siteks

Sorry for the trouble! I’m in the process of building a debian release image based on 4.19.5 kernel for all hikey boards (Hikey+Hikey960+Hikey970). Below are the supported features of the image:

  1. Hikey - SD/MMC, HDMI, USB, WiFi/BT
  2. Hikey960 - UFS, SD/MMC, USB, WiFi/BT, PCI-E, UFS Fix
  3. HiKey970 - UFS, SD/MMC

Please stay tuned.

Regards,
Mani


#24

Ah yes.

I changed the grub command line to point to /dev/sdd13 and burned to userdata.
Re. the HDMI, the hardware cannot generate correct clocks for many modes, if you force a working mode in the kernel command line you can get it working. I’m not using a monitor, but just tried these new instructions and it does now output to HDMI and display on two monitors I tried.

#----------------------
# Change the Debian image to have:
#   UFS patched kernel
#   Old style interface names
#   Basic ethernet
#   Working HDMI mode

# Unpack and mount original image
simg2img debian-hikey960-public.rootfs.img debian-hikey960-public.rootfs.raw.img
mkdir -p tmp
sudo mount debian-hikey960-public.rootfs.raw.img tmp

# Copy in the patched kernel:
sudo cp ../kernels/Image tmp/boot/

# Make basic ethernet setup
cat << EOF |sudo tee -a tmp/etc/network/interfaces
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
EOF

# Change kernel command line for old-style interface names and a working HDMI mode
sudo sed -i 's/rootwait/rootwait net.ifnames=0 video=HDMI-A-1:1280x800@60/' tmp/boot/grub/grub.cfg

# Change root partition
sudo sed -i 's/sdd10/sdd13/' tmp/boot/grub/grub.cfg

# Repack the image
sudo umount tmp
img2simg debian-hikey960-public.rootfs.raw.img debian-hikey960-public.rootfs.repacked.img

# Flash the new image
sudo fastboot erase system
sudo fastboot erase userdata
sudo fastboot flash userdata debian-hikey960-public.rootfs.repacked.img
sudo fastboot reboot

I then resized the file system at the root prompt, strange error first time even with force:

root@hikey960:~# df
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/root        2064208 913192   1046160  47% /
devtmpfs         1983760      0   1983760   0% /dev
tmpfs            1992528      0   1992528   0% /dev/shm
tmpfs            1992528  29064   1963464   2% /run
tmpfs               5120      0      5120   0% /run/lock
tmpfs            1992528      0   1992528   0% /sys/fs/cgroup
tmpfs             398504      0    398504   0% /run/user/0
root@hikey960:~# lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda       8:0    0    4M  0 disk
sdb       8:16   0    4M  0 disk
sdc       8:32   0    8M  0 disk
└─sdc1    8:33   0    7M  0 part
sdd       8:48   0 29.8G  0 disk
├─sdd1    8:49   0    1M  0 part
├─sdd2    8:50   0   12M  0 part
├─sdd3    8:51   0    6M  0 part
├─sdd4    8:52   0   12M  0 part
├─sdd5    8:53   0  256M  0 part
├─sdd6    8:54   0    1M  0 part
├─sdd7    8:55   0   64M  0 part
├─sdd8    8:56   0   16M  0 part
├─sdd9    8:57   0    2M  0 part
├─sdd10   8:58   0  4.6G  0 part
├─sdd11   8:59   0  784M  0 part
├─sdd12   8:60   0    1M  0 part
└─sdd13   8:61   0 24.1G  0 part /
root@hikey960:~# resize2fs -f /dev/sdd13 24G
resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/sdd13 is mounted on /; on-line re[   64.705471] EXT4-fs (sdd13): resizing filesystem from 524288 to 6291456 blocks
sizing required
old_desc_blocks = 1, ne[   64.718563] EXT4-fs (sdd13): resized filesystem to 6291456
w_desc_blocks = 2
resize2fs: Remote I/O error While checking for on-line resizing support
root@hikey960:~# resize2fs -f /dev/sdd13 24G
resize2fs 1.43.4 (31-Jan-2017)
Filesystem at /dev/sdd13 is mounted on /; on-line resizing[   77.673999] EXT4-fs (sdd13): resizing filesystem from 524288 to 6291456 blocks
 required
old_desc_blocks = 1, new_desc_blocks = 2
[   80.487587] EXT4-fs (sdd13): resized filesystem to 6291456
The filesystem on /dev/sdd13 is now 6291456 (4k) blocks long.

root@hikey960:~# df
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/root       24770940 915692  22828152   4% /
devtmpfs         1983760      0   1983760   0% /dev
tmpfs            1992528      0   1992528   0% /dev/shm
tmpfs            1992528  29064   1963464   2% /run
tmpfs               5120      0      5120   0% /run/lock
tmpfs            1992528      0   1992528   0% /sys/fs/cgroup
tmpfs             398504      0    398504   0% /run/user/0

#25

thanks so much. I’m trying to run as you suggested, but get an error while flashing rootfs to userdata:

target reported max download size of 134217728 bytes
erasing 'userdata'...
FAILED (remote: Check device console.)
finished. total time: 0.001s

#26

You’ve changed the partition map though, so you’ll need to reflash (I presume) ptable to get the original map back. I suggest:

sudo fastboot flash ptable prm_ptable.img
sudo fastboot flash fastboot l-loader.bin
sudo fastboot flash fip fip.bin
sudo fastboot reboot-bootloader
sudo fastboot erase boot
sudo fastboot erase system
sudo fastboot erase userdata
sudo fastboot flash boot boot-linaro-stretch-developer-hikey-20180828-19.img

first, before flashing the rootfs to userdata.


#27