Skip to content

Instantly share code, notes, and snippets.

@markVnl
Last active October 22, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markVnl/7adf25cebfdce5d5009d93b7b4caae96 to your computer and use it in GitHub Desktop.
Save markVnl/7adf25cebfdce5d5009d93b7b4caae96 to your computer and use it in GitHub Desktop.
Prerequisite
A running arm device to do this,
distro / kernel should not mater
Prepare Sources
Download Centos-Uboot-Community-kernel-img.raw.xz
https://drive.google.com/open?id=1PvLxWVwvK9H2zJTnBF2rKlA7IDmbpa7s
To download it from the command line:
nano curl_Centos-Uboot-Community-kernel-img.sh
--------------------------------------------------------------------------------------------------
#!/bin/bash
# thanks to Brett McLain
# http://blog.mclain.ca/download-large-files-from-google-drive-via-curl/
filename="Centos-Uboot-Community-kernel-img.raw.xz"
file_id="1PvLxWVwvK9H2zJTnBF2rKlA7IDmbpa7s"
query=`curl -c ./cookie.txt -s -L "https://drive.google.com/uc?export=download&id=${file_id}" \
| perl -nE'say/uc-download-link.*? href="(.*?)\">/' \
| sed -e 's/amp;//g' | sed -n 2p`
url="https://drive.google.com$query"
curl -b ./cookie.txt -L -o ${filename} $url
rm -f cookie.txt
-------------------------------------------------------------------------------------------------------
chmod +x curl_Centos-Uboot-Community-kernel-img.sh
./curl_Centos-Uboot-Community-kernel-img.sh
(w)get early boot bin's from (and signed by) Hardkernel:
wget https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/sd_fusing.sh \
https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/bl1.bin.hardkernel \
https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/bl2.bin.hardkernel.720k_uboot \
https://raw.githubusercontent.com/hardkernel/u-boot/odroidxu4-v2017.05/sd_fuse/tzsw.bin.hardkernel
chmod a+x sd_fusing.sh
As always: **Be sure you got the right device (/dev/.....) pointing to your sd-card** :
export sdcard="/dev/sdX"
xzcat Centos-Uboot-Community-kernel-img.raw.xz | sudo dd of=${sdcard} status=progress bs=4M && sudo sync
Mount the sd-card:
sudo mount ${sdcard}2 /mnt
sudo mount ${sdcard}1 /mnt/boot
Get u-boot and flash all boot blobs to the sd-card
cp /mnt/usr/share/uboot/odroid-xu3/u-boot.bin .
sudo ./sd_fusing.sh ${sdcard}
Add to the kernel commandline in extlinux.conf
cpuidle.off=1 console=tty1 console=ttySAC2,115200n8 rd.driver.pre=ledtrig-heartbeat,xhci-plat-hcd no_bL_switcher
sudo nano /mnt/boot/extlinux/extlinux.conf
-------------------------------------------------------------------------------------------------------
# extlinux.conf generated by appliance-creator
ui menu.c32
menu autoboot Welcome to Centos-Uboot-Community-kernel. Automatic boot in # second{,s}. Press a key for options.
menu title Centos-Uboot-Community-kernel Boot Options.
menu hidden
timeout 20
totaltimeout 600
label Centos-Uboot-Community-kernel (4.18.16-200.el7.armv7hl)
kernel /vmlinuz-4.18.16-200.el7.armv7hl
append cpuidle.off=1 console=tty1 console=ttySAC2,115200n8 rd.driver.pre=ledtrig-heartbeat,xhci-plat-hcd no_bL_switcher ro root=UUID=<your_uiid>
initrd /initramfs-4.18.16-200.el7.armv7hl.img
--------------------------------------------------------------------------------------------------
add / remove modules / drivers to creation of initramfs by dracut
sudo nano /mnt/etc/dracut.conf.d/odroid_hc1.conf
--------------------------------------------------------------------------------------------------
add_dracutmodules+=" dm "
omit_dracutmodules+=" network ifcfg plymouth "
add_drivers+=" exynosdrm exynos_bus exynos_trng exynos_nocp exynos_rng phy_exynos_dp_video "
add_drivers+=" phy_exynos_mipi_video dwc3_exynos clk_exynos_audss i2c_exynos5 dw_mmc_exynos "
add_drivers+=" dw_mmc_pltfm dw_mmc phy_exynos_usb2 phy_exynos5_usbdrd pwm_samsung "
add_drivers+=" dwc3 ledtrig-heartbeat "
--------------------------------------------------------------------------------------------------
Create new initramfs with specific drivers:
sudo chroot /mnt
dracut -v -f /boot/initramfs-4.18.16-200.el7.armv7hl.img 4.18.16-200.el7.armv7hl
exit
sudo umount -R /mnt
This sould boot, check if your usb network and uas (sata) are connectect as usb3 device:
yum install usbutils
lsusb -t
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M
Note the 5000M @ Driver=r8152 (=network) and Driver=uas (=sata)
Check if all 8 cores are up:
lscpu
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 2
Model: 3
Model name: ARMv7 Processor rev 3 (v7l)
CPU max MHz: 1300.0000
CPU min MHz: 200.0000
BogoMIPS: 66.00
Flags: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment