longsleep / linux-pine64

Pine64 Linux Kernel
Other
111 stars 107 forks source link

Support distro compilation #9

Closed agraf closed 8 years ago

agraf commented 8 years ago

While trying to package the tree as openSUSE Contrib, I ran into a few problems compiling it. With these patches I can build it successfully (not executed so far).

longsleep commented 8 years ago

Those are nice patches. Do you think i should merge them all? Not sure about the EFI stuff.

agraf commented 8 years ago

The patch "efi: Fix arm64 efi entry" is a real bug fix. With that and 2016.05 you can use the bootefi infrastructure to boot the BSP kernel using the EFI stub (which gives you grub2 boot).

The thing I'm not sure you will want in your tree is

XXX disable efi RTS

that one was a temporary hack to disable runtime services until I figure out why the system crashes on early boot when it tries to relocate them. It works just fine with an upstream kernel...

Alex

On 05.04.16 22:45, Simon Eisenmann wrote:

Those are nice patches. Do you think i should merge them all? Not sure about the EFI stuff.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/longsleep/linux-pine64/pull/9#issuecomment-205979844

longsleep commented 8 years ago

I cherry-picked all except the extra-version remove and the XXX. I would pick the XXX as well or do you have a clue in the meantime what is causing the crash?

umiddelb commented 8 years ago

you may check if your latest kernel still has the ability to get the root= parameter passed via u-boot bootargs:

Debian GNU/Linux 8 p64 ttyS0

p64 login: debian
Password:
Last login: Tue Apr 12 17:05:25 CEST 2016 on ttyS0
Linux p64 3.10.65-4-pine64-longsleep #16 SMP PREEMPT Sun Apr 3 10:56:40 CEST 2016 aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian@p64:~$ cat /proc/cmdline
console=tty0 console=ttyS0,115200n8 earlycon=uart,mmio32,0x01c28000 root=/dev/sdb2 rootwait rw fsck.repair=yes  governor=conservative no_console_suspend
debian@p64:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2   30G   14G   14G  51% /
devtmpfs        961M     0  961M   0% /dev
tmpfs           994M     0  994M   0% /dev/shm
tmpfs           994M  8.4M  986M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           994M     0  994M   0% /sys/fs/cgroup
/dev/mmcblk0p1   50M  136K   50M   1% /bootenv

.

longsleep commented 8 years ago

@umiddelb Why wouldnt the current Kernel have this ability? Seems to work fine for me. I have no clue where your root=/dev/sdb2 comes from (must be from U-Boot). This is what is in the default environment: https://github.com/longsleep/u-boot-pine64/blob/pine64-hacks/include/configs/sun50iw1p1.h#L341

umiddelb commented 8 years ago

I have no clue where your root=/dev/sdb2 comes from (must be from U-Boot).

I've set root=/dev/sdb2 in u-boot bootargs because I wanted the rootfs to be taken from there, but the kernel still uses /dev/mmcblk0p2. This doesn't occur with older kernels (up to commit 5be3aed83522ff7ad7046e363b2e7c04845c1841). You may check it by yourself.

longsleep commented 8 years ago

Mhm, thats strange. I am not using the root= parameter in my initrd at all. Do you use another initrd which mounts root to whatever is configured there?

If i use no initrd, it seems to work just fine

10.009452] Waiting for root device /dev/sda2...
umiddelb commented 8 years ago

I'm creating the initrd on the fly after installing the kernel modules, but with no extra magic added ...

make -j 4 Image sun50i-a64-pine64-plus.dtb modules
kver=`make kernelrelease`
sudo rm -rf /boot/kernel.d/test
sudo mkdir -p /boot/kernel.d/test
sudo cp System.map arch/arm64/boot/Image arch/arm64/boot/dts/*.dtb /boot/kernel.d/test
sudo cp .config /boot/kernel.d/test/${kver}.config
sudo make modules_install
sudo make firmware_install
sudo make headers_install INSTALL_HDR_PATH=/usr
cd /boot
sudo rm -f config-${kver}
sudo ln -s kernel.d/test/config config-${kver}
sudo update-initramfs -c -k ${kver}
sudo mv initrd.img-${kver} kernel.d/test/Initrd
sudo rm config-${kver}
longsleep commented 8 years ago

Ok, can you check where your the initrd init actually gets the rootfs location from.

umiddelb commented 8 years ago

I'm setting the rootfs location in bootargs=... during u-boot and nowhere else. Considering update-initramfs, I have installed the debian package only, nothing more (e.g. nothing added to /etc/initramfs-tools/...).

umiddelb commented 8 years ago

... but as long as this issue doesn't seem to be related to recents commits we may hand over this discussion to a new github issue

longsleep commented 8 years ago

Closing this for now as everything was merged.