Linux From Scratch

Moderators: mdrjr, odroid

Linux From Scratch

Unread postby ShorTie » Sun Nov 12, 2017 10:22 pm

LFS - Blue light special

I'm try to get SmoothWall to run on the xu4.
It is a Linux From Scratch type build of a Linux firewall.
It is eudev && sysvinit, not systemd.
On a sdcard.

For the rpi3, once I have the root file system built.
I partition up the sdcard and format it.
p1 /boot W95 FAT32
p2 swap swap
p3 /var/log ext4
p4 / ext4
mount p4,p1 & p3, copy the stuff over and all works fine.

For the xu4 I add in u-boot-5422_4.4.4_v5.3 installed into /boot.

I also copy boot.ini & boot.ini.default to /boot, changing bootrootfs too..

bootrootfs=console=tty1 console=ttySAC2,115200n8 root=/dev/mmcblk0p4 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet

Thus giving me in /boot (/dev/mmcblk0p1),

bl1.bin.hardkernel
bl2.bin.hardkernel.720k_uboot
boot.ini
boot.ini.default
exynos5422-odroidxu3.dtb
exynos5422-odroidxu4.dtb
initrd.img-4.9.58+
sd_fusing.sh
System.map-4.9.58+
tzsw.bin.hardkernel
u-boot.bin.hardkernel
uInitrd-4.9.58+
vmlinuz-4.9.58+


The runtimeroot is a custom initramfs CPIO archive built with
@cd tmp; find . | cpio -o -H newc > ../../initrd-4.9.58+

The kernel is compiled from 'make odroidxu3_defconfig', nothing special

mkimage, from u-boot goes into /usr/src

cd distrib/boot; ../../mkimage -A arm -O linux -T ramdisk -a 0x0 -e 0x0 -n initrd.img-4.9.58+ -d initrd.img-4.9.58+ uInitrd-4.9.58+
Image Name: initrd.img-4.9.58+
Created: Thu Nov 9 23:45:29 2017
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 87373312 Bytes = 85325.50 kB = 83.33 MB
Load Address: 00000000
Entry Point: 00000000



then
cd sources/media-sdcard/distrib/boot ./sd_fusing.sh /dev/sda
/dev/sda reader is identified.
signed_bl1_position=1
bl2_position=31
uboot_position=63
tzsw_position=1503
device=/dev/sda
env_position=2015
uboot=./u-boot.bin.hardkernel
BL2 fusing
dd iflag=dsync oflag=dsync if=./bl1.bin.hardkernel of=/dev/sda seek=1
30+1 records in
30+1 records out
15616 bytes (16 kB) copied, 0.0503474 s, 310 kB/s
echo 'BL2 fusing'
BL2 fusing
sudo dd iflag=dsync oflag=dsync if=./bl2.bin.hardkernel.720k_uboot of=/dev/sda seek=31
28+1 records in
28+1 records out
14592 bytes (15 kB) copied, 0.0663689 s, 220 kB/s
echo 'u-boot fusing'
u-boot fusing
sudo dd iflag=dsync oflag=dsync if=./u-boot.bin.hardkernel of=/dev/sda seek=63
1208+1 records in
1208+1 records out
618614 bytes (619 kB) copied, 2.24634 s, 275 kB/s
echo 'TrustZone S/W fusing'
TrustZone S/W fusing
sudo dd iflag=dsync oflag=dsync if=./tzsw.bin.hardkernel of=/dev/sda seek=1503
512+0 records in
512+0 records out
262144 bytes (262 kB) copied, 1.16194 s, 226 kB/s
echo 'u-boot env erase...'
u-boot env erase...
sudo dd iflag=dsync oflag=dsync if=/dev/zero of=/dev/sda seek=2015 bs=512 count=32
32+0 records in
32+0 records out
16384 bytes (16 kB) copied, 0.099524 s, 165 kB/s
echo 'U-boot image is fused successfully.'
U-boot image is fused successfully.
echo 'Eject /dev/sda and insert it again.'
Eject /dev/sda and insert it again.

Preparing...
Make and mount the mount points
root
mkdir: created directory ‘sdcard’
mount: /dev/sda4 mounted on /usr/src/smoothwall-3.2/distrib/build/sdcard.
boot
mkdir: created directory ‘sdcard/boot’
mount: /dev/sda1 mounted on /usr/src/smoothwall-3.2/distrib/build/sdcard/boot.
log
mkdir: created directory ‘sdcard/var’
mkdir: created directory ‘sdcard/var/log’
mount: /dev/sda3 mounted on /usr/src/smoothwall-3.2/distrib/build/sdcard/var/log.

Copying root

Creating /sys/block/mmcblk0/mmcblk0boot0/force_ro
mkdir: created directory ‘sdcard/sys/block’
mkdir: created directory ‘sdcard/sys/block/mmcblk0’
mkdir: created directory ‘sdcard/sys/block/mmcblk0/mmcblk0boot0’
syncing


sdcard states
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 2.6G 532M 1.9G 22% /usr/src/smoothwall-3.2/distrib/build/sdcard
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 256M 180M 77M 71% /usr/src/smoothwall-3.2/distrib/build/sdcard/boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 3.9G 8.1M 3.6G 1% /usr/src/smoothwall-3.2/distrib/build/sdcard/var/log
umount: /usr/src/smoothwall-3.2/distrib/build/sdcard/var/log (/dev/sda3) unmounted
umount: /usr/src/smoothwall-3.2/distrib/build/sdcard/boot (/dev/sda1) unmounted
umount: /usr/src/smoothwall-3.2/distrib/build/sdcard (/dev/sda4) unmounted
rmdir: removing directory, ‘sdcard’

And all I get is a solid blue light .. :(~
ShorTie
 
Posts: 9
Joined: Sun Jun 28, 2015 2:29 am
languages_spoken: english
ODROIDs: Odroid-C1

Re: Linux From Scratch

Unread postby odroid » Mon Nov 13, 2017 10:10 am

"the blue LED is solid on" means XU4 couldn't start the kernel and stuck at the u-boot stage.
You might need a USB-UART kit to monitor/debug the kernel booting process.

Or refer this repo which has an XU4 buildroot example.
https://github.com/bkrepo/buildroot/tree/verium_miner
User avatar
odroid
Site Admin
 
Posts: 25841
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux From Scratch

Unread postby ShorTie » Mon Nov 13, 2017 11:50 am

Whelp, that "XU4 buildroot example" is of not value as it does not even work.

Code: Select all
root@odroid-jessie:/usr/src/buildroot# make odroidxu4_defconfig
make: *** No rule to make target 'odroidxu4_defconfig'.  Stop.


This is so so so frustrating !!
Been playing with this for months and months on a c1 and xu4 with no luck.

I have no idea how to use the "USB-UART kit".
Got a good working guide some where ??

I don't mind playing, but this is redickulous.
With the kernel config being yours, I do not understand why it will not work.
Must be some voodoo magic your not passing along as very very few peeps can get it, imho.

Oh well, off to play .. :/~
ShorTie
 
Posts: 9
Joined: Sun Jun 28, 2015 2:29 am
languages_spoken: english
ODROIDs: Odroid-C1

Re: Linux From Scratch

Unread postby odroid » Mon Nov 13, 2017 12:02 pm

Refer this link to learn how to use the USB-UART kit.
https://wiki.odroid.com/accessory/devel ... b_uart_kit

Did you try Buildroot on XU4?
Normally, we are using x86 Ubuntu machine to build the Buildroot.
viewtopic.php?f=138&t=20662
User avatar
odroid
Site Admin
 
Posts: 25841
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux From Scratch

Unread postby ShorTie » Mon Nov 13, 2017 5:52 pm

Yes, I tried it on the xu4.
But what difference does that make when there is no odroidxu4_defconfig ??

Code: Select all
root@odroid-jessie:/usr/src/buildroot# make odroidxu4_defconfig
make: *** No rule to make target 'odroidxu4_defconfig'.  Stop.
ShorTie
 
Posts: 9
Joined: Sun Jun 28, 2015 2:29 am
languages_spoken: english
ODROIDs: Odroid-C1

Re: Linux From Scratch

Unread postby odroid » Mon Nov 13, 2017 6:19 pm

I had no issue while doing "make odroidxu4_defconfig".
Did you download the code from a correct branch?
Code: Select all
git clone --depth 1 https://github.com/bkrepo/buildroot.git -b verium_miner
User avatar
odroid
Site Admin
 
Posts: 25841
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Linux From Scratch

Unread postby ShorTie » Mon Nov 13, 2017 9:54 pm

Sorry, No I had not check bkrepo/buildroot for different branches.
There is a xu4 only there too...
Code: Select all
remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/odroidxu4
  remotes/origin/verium_miner


I'll try the remotes/origin/verium_miner 1st.
I've also just ordered a USB-UART kit from ameridroid.
Normally it take a week to get across the country, So be a couple for that.
ShorTie
 
Posts: 9
Joined: Sun Jun 28, 2015 2:29 am
languages_spoken: english
ODROIDs: Odroid-C1


Return to Projects

Who is online

Users browsing this forum: No registered users and 1 guest