BIOS design using PETITBOOT to support SPI booting

Moderators: mdrjr, odroid

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby rooted » Fri Nov 09, 2018 10:42 am

When you clone the kernel with git.

Code: Select all
git clone somekernel


It downloads the source to the directory you are currently in, usually /home/username into a subdirectory generally called linux.

If your username is odroid, it will be /home/odroid/linux and you want the patches to be in /home/odroid/
User avatar
rooted
 
Posts: 5682
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Fri Nov 09, 2018 10:50 am

@rooted thank you that seems clear enough...

also i think that i am making things complex that should be simple..sozz about that..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby rooted » Fri Nov 09, 2018 11:50 am

No worries, most of us know you're a hardware guy.

When it comes to resistors, capacitors, schematics and such I know next to nothing.
User avatar
rooted
 
Posts: 5682
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Sat Nov 10, 2018 3:13 pm

ok so i i built the kernel i think that went ok it finished with no errors

the next steps i had trouble with though modifying to boot arg`s and the emmc args

Code: Select all
i think this is wehere i went wrong maybe i never  included this line in the boot arg`s section as it had an "#" in front of it  meaning it was tellinhg me something  that was a new line added to the  boot arg`s section any way  here it is below i think i should have included it..
i will edit  my  emmc  card later and see if it makes any difference..

Code: Select all
# or lzma format is available -->  load mmc 1:0 ${initrd_addr} uInitrd.igz


i rebooted it to find it came to a blank black screen so somewhere there something i did went wrong....maybe i need to start over i dunno very tired 4 now just had a huge dinner and now am tired might kick back with a bit of zeppelin for an hour or so while my belly settles down..lol.lol

although i would rather fix it rather then start over but maybe petitboot never built properly i dunno..

ok EDIT i added that line to the boot emmc arg`s and now it boots to the desktop but have no Ethernet working it just keeps searching ...any way i may just start over...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Sun Nov 11, 2018 8:32 am

phaseshifter wrote:ok so i i built the kernel i think that went ok it finished with no errors

the next steps i had trouble with though modifying to boot arg`s and the emmc args

i rebooted it to find it came to a blank black screen so somewhere there something i did went wrong....maybe i need to start over i dunno very tired 4 now just had a huge dinner and now am tired might kick back with a bit of zeppelin for an hour or so while my belly settles down..lol.lol

although i would rather fix it rather then start over but maybe petitboot never built properly i dunno..

ok EDIT i added that line to the boot emmc arg`s and now it boots to the desktop but have no Ethernet working it just keeps searching ...any way i may just start over...

Hi phaseshiter,
Glad to hear you keep doing even though you encountered many failures caused by a lack of my descriptions,
and Thank you.

So now do you have petitboot menu after booting, or do you mean you get Debian desktop display?
If you have Debian Desktop, it went wrong.
And it seems you have Debian desktop display because you said "no ethernet working". (It can be in case of normal booting, not with petitboot.)

You should have Petitboot Main Menu as following on your HDMI display.
petitboot_1_mainmenu.png
petitboot_1_mainmenu.png (6.96 KiB) Viewed 650 times


Let's check the mandatory setting to enter petitboot main menu.

1. Build uInitrd.igz and Copy it into vfat filesystem of your eMMC card. ( under /media/boot/uInitrd.gz )
2. Build Image/rk3399-odroidn1-linux.dtb and Replace them with the new Image in vfat filesystem of your eMMC card. ( under /media/boot/Image and /media/boot/rk3399-odroidn1-linux.dtb )
3. Modify boot.ini in vfat filesystem of your eMMC card.
(1) Add console=tty0 in bootrootfs.
Code: Select all
# old one -> setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"

(2) Modify initrd name
Code: Select all
# old one -> load mmc ${bootdev} ${initrd_addr} uInitrd
load mmc ${bootdev} ${initrd_addr} uInitrd.igz

So, the whole boot.ini can be as following.
Code: Select all
ODROIDN1-UBOOT-CONFIG

# U-Boot configuration
setenv kernel_addr "0x02000000"
setenv fdt_addr "0x01f00000"
setenv initrd_addr "0x04000000"

# Enable/Disable ODROID-VU7 Touchsreen
setenv disable_vu7 "false" # false

# Kernel cmdline rootfs and misc
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw disable_vu7=${disable_vu7}"

# Load kernel, uInitrd and dtb
load mmc ${bootdev} ${kernel_addr} Image
load mmc ${bootdev} ${initrd_addr} uInitrd.igz
load mmc ${bootdev} ${fdt_addr} rk3399-odroidn1-linux.dtb

# Set the kernel bootargs
setenv bootargs "${bootrootfs}"

# Boot the board
booti ${kernel_addr} ${initrd_addr} ${fdt_addr}

Then, please reboot.
Now you will have petitboot main menu display.

Could you check it again?
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Sun Nov 11, 2018 7:32 pm

ok thank you joy i will do it tonight ..and see how i go

i knew something went wrong but exactly what i don't

however i`ll do it 4 the team tonight..peace out 4 now...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Sun Nov 11, 2018 8:52 pm

ok i have this in this directory ..

Code: Select all
root@odroid:/home/odroid/linux/linux/arch/arm64# ls                             
Kconfig        Kconfig.platforms  boot     configs#  include  kvm  mm   xen     
Kconfig.debug  Makefile           configs  crypto    kernel   lib  net         


your copy code as per instruction is this..
Code: Select all
$ cp arch/arm64/boot/Image /media/boot/Image
$ cp arch/arm64/boot/dts/rockchip/rk3399-odroidn1-linux.dtb /media/boot/rk3399-odroidn1-linux.dtb


i dont se any .igz file anywhere and your said code does not specify copy of an .igz file so
i will implement and see if i get a win on this one ..not shure what will happen..
Pss still getting desktop with no eth but eth port lights are functioning..phase...

ok so i went back to the petitboot build stages and got stuck at step "6" with this step..
Code: Select all
cat << EOF > initramfs/usr/share/udhcpc/default.script
#!/bin/sh

/usr/share/udhcpc/simple.script "\$@"
/usr/sbin/pb-udhcpc "\$@"
EOF

$ chmod 755 initramfs/usr/share/udhcpc/default.script


i have entered it but dont know how to exit the "cat" script writer..i used
Code: Select all
ctrl+c
but i made some mistakes and have done it a few times ..not shure what i have done

now i have this issue at step "10"
Code: Select all
root@odroid:/home/odroid/ramdisk_petitboot# strip initramfs/usr/sbin/*         
strip:initramfs/usr/sbin/pb-exec: File format not recognized                   
strip:initramfs/usr/sbin/pb-plugin: File format not recognized                 
strip:initramfs/usr/sbin/pb-sos: File format not recognized                     
strip:initramfs/usr/sbin/pb-udhcpc: File format not recognized 


i think i will start over i am going to flash a chip and start with it but i wont write over this chip incase it is fixable..i await your answer`s..thank phase peace out...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby mad_ady » Sun Nov 11, 2018 11:38 pm

For step 6, the cat command should have exited when it reached the "EOF" string. This technique is called "here-documents" (https://en.m.wikipedia.org/wiki/Here_document), but it requires that the "EOF" (which stands for end of file, but could be any string) is the only thing on that row. So if copy/pasting make sure that line doesn't have any leading/trailing spaces.

For the 10 step - check if the files that issue the error are not symlinks. An error to the strip command should not be critical. In the worst case you end up with a bigger file.
User avatar
mad_ady
 
Posts: 4718
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Mon Nov 12, 2018 12:34 am

ok so i used the auto install bl elkleate and now i am having trouble building the kerner error her...

Code: Select all
root@odroid:/home/odroid/linux# make Image dtbs -j5
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/asm/bug.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  UPD     include/generated/uapi/linux/version.h
  UPD     include/config/kernel.release
  WRAP    arch/arm64/include/generated/asm/clkdev.h
  WRAP    arch/arm64/include/generated/asm/checksum.h
  WRAP    arch/arm64/include/generated/asm/cputime.h
  WRAP    arch/arm64/include/generated/asm/current.h
  WRAP    arch/arm64/include/generated/asm/delay.h
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/errno.h
  WRAP    arch/arm64/include/generated/asm/ftrace.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  HOSTCC  scripts/basic/bin2c
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/ioctls.h
  WRAP    arch/arm64/include/generated/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/asm/ioctl.h
  WRAP    arch/arm64/include/generated/asm/kmap_types.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/mutex.h
  WRAP    arch/arm64/include/generated/asm/pci.h
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm64/include/generated/asm/poll.h
  WRAP    arch/arm64/include/generated/asm/mman.h
  WRAP    arch/arm64/include/generated/asm/pci-bridge.h
  WRAP    arch/arm64/include/generated/asm/resource.h
  WRAP    arch/arm64/include/generated/asm/preempt.h
  WRAP    arch/arm64/include/generated/asm/sembuf.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/asm/simd.h
  WRAP    arch/arm64/include/generated/asm/sizes.h
  WRAP    arch/arm64/include/generated/asm/socket.h
  WRAP    arch/arm64/include/generated/asm/sockios.h
  WRAP    arch/arm64/include/generated/asm/rwsem.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/termbits.h
  WRAP    arch/arm64/include/generated/asm/termios.h
  WRAP    arch/arm64/include/generated/asm/segment.h
  WRAP    arch/arm64/include/generated/asm/trace_clock.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/user.h
  WRAP    arch/arm64/include/generated/asm/swab.h
  WRAP    arch/arm64/include/generated/asm/topology.h
  WRAP    arch/arm64/include/generated/asm/types.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  WRAP    arch/arm64/include/generated/asm/xor.h
  CHK     include/generated/utsrelease.h
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/sortextable
  MKELF   scripts/mod/elfconfig.h
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/extract-cert
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: No such file or directory
 #include <openssl/bio.h>
                         ^
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/extract-cert' failed
make[1]: *** [scripts/extract-cert] Error 1
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/mod/modpost
  HOSTLD  scripts/dtc/dtc
Makefile:574: recipe for target 'scripts' failed
make: *** [scripts] Error 2
root@odroid:/home/odroid/linux#
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Mon Nov 12, 2018 12:36 am

i`m now wondering if the auto install by ellate was not still made properly dunno..


did i not download the kernel files correctly via wget..etc..should i strip the linux dir and start over..??
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby back2future » Mon Nov 12, 2018 5:45 am

[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:
Code: Select all
ssh odroid at maze.odroid.com -p 2230

cd /tmp/petitboot

for elatll@'s modified all-in-one-script: make-uInitrd.sh
### re-boot is not necessary nor enabled
### "make -j 2"
### <CTRL>+c for exiting script
Code: Select all
watch -n 1 "sensors" && sudo ./make-uInitrd.sh


work-in-progress edit: currently Wed Nov 14, 2018 4:51 am
C2 verified

26910 blocks
Image Name: uInitrd.igz
Created: Tue Nov 13 21:55:08 2018
Image Type: AArch64 Linux RAMDisk Image (lzma compressed)
Data Size: 3807036 Bytes = 3717.81 kB = 3.63 MB
Load Address: 00000000
Entry Point: 00000000
Everything is OK.

dir initramfs
5.6 MiB /usr
5.1 MiB /lib
1.8 MiB /bin
892.0 KiB /sbin
12.0 KiB /var
12.0 KiB /etc
8.0 KiB /run
4.0 KiB /tmp
4.0 KiB /sys
4.0 KiB /proc
4.0 KiB /newroot
4.0 KiB init

Thx@all ]
Last edited by back2future on Wed Nov 14, 2018 7:40 am, edited 4 times in total.
naturally beYOnd spectrum
back2future
 
Posts: 128
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Mon Nov 12, 2018 9:38 am

phaseshifter wrote:i`m now wondering if the auto install by ellate was not still made properly dunno..

I've tested the auto script with very initial card from the N1 Debian image without any update.
And to make sure, it's only for making uInitrd.igz.
phaseshifter wrote:did i not download the kernel files correctly via wget..etc..should i strip the linux dir and start over..??

You don't need to do strip or else for files in linux directory.
Just you need two files ...
Code: Select all
/home/odroid/linux/arch/arm64/boot/Image
/home/odroid/linux/arch/arm64/boot/dts/rockchip/rk3399-odroidn1-linux.dtb
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Mon Nov 12, 2018 9:41 am

phaseshifter wrote:ok so i used the auto install bl elkleate and now i am having trouble building the kerner error her...

Code: Select all
root@odroid:/home/odroid/linux# make Image dtbs -j5
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  WRAP    arch/arm64/include/generated/asm/bug.h
  WRAP    arch/arm64/include/generated/asm/bugs.h
  UPD     include/generated/uapi/linux/version.h
  UPD     include/config/kernel.release
  WRAP    arch/arm64/include/generated/asm/clkdev.h
  WRAP    arch/arm64/include/generated/asm/checksum.h
  WRAP    arch/arm64/include/generated/asm/cputime.h
  WRAP    arch/arm64/include/generated/asm/current.h
  WRAP    arch/arm64/include/generated/asm/delay.h
  WRAP    arch/arm64/include/generated/asm/div64.h
  WRAP    arch/arm64/include/generated/asm/dma.h
  WRAP    arch/arm64/include/generated/asm/emergency-restart.h
  WRAP    arch/arm64/include/generated/asm/errno.h
  WRAP    arch/arm64/include/generated/asm/ftrace.h
  WRAP    arch/arm64/include/generated/asm/hw_irq.h
  HOSTCC  scripts/basic/bin2c
  WRAP    arch/arm64/include/generated/asm/dma-contiguous.h
  WRAP    arch/arm64/include/generated/asm/ioctls.h
  WRAP    arch/arm64/include/generated/asm/ipcbuf.h
  WRAP    arch/arm64/include/generated/asm/irq_regs.h
  WRAP    arch/arm64/include/generated/asm/early_ioremap.h
  WRAP    arch/arm64/include/generated/asm/kdebug.h
  WRAP    arch/arm64/include/generated/asm/kvm_para.h
  WRAP    arch/arm64/include/generated/asm/ioctl.h
  WRAP    arch/arm64/include/generated/asm/kmap_types.h
  WRAP    arch/arm64/include/generated/asm/local64.h
  WRAP    arch/arm64/include/generated/asm/mm-arch-hooks.h
  WRAP    arch/arm64/include/generated/asm/local.h
  WRAP    arch/arm64/include/generated/asm/msgbuf.h
  WRAP    arch/arm64/include/generated/asm/msi.h
  WRAP    arch/arm64/include/generated/asm/mutex.h
  WRAP    arch/arm64/include/generated/asm/pci.h
  WRAP    arch/arm64/include/generated/asm/mcs_spinlock.h
  WRAP    arch/arm64/include/generated/asm/poll.h
  WRAP    arch/arm64/include/generated/asm/mman.h
  WRAP    arch/arm64/include/generated/asm/pci-bridge.h
  WRAP    arch/arm64/include/generated/asm/resource.h
  WRAP    arch/arm64/include/generated/asm/preempt.h
  WRAP    arch/arm64/include/generated/asm/sembuf.h
  WRAP    arch/arm64/include/generated/asm/serial.h
  WRAP    arch/arm64/include/generated/asm/shmbuf.h
  WRAP    arch/arm64/include/generated/asm/simd.h
  WRAP    arch/arm64/include/generated/asm/sizes.h
  WRAP    arch/arm64/include/generated/asm/socket.h
  WRAP    arch/arm64/include/generated/asm/sockios.h
  WRAP    arch/arm64/include/generated/asm/rwsem.h
  WRAP    arch/arm64/include/generated/asm/switch_to.h
  WRAP    arch/arm64/include/generated/asm/termbits.h
  WRAP    arch/arm64/include/generated/asm/termios.h
  WRAP    arch/arm64/include/generated/asm/segment.h
  WRAP    arch/arm64/include/generated/asm/trace_clock.h
  WRAP    arch/arm64/include/generated/asm/unaligned.h
  WRAP    arch/arm64/include/generated/asm/user.h
  WRAP    arch/arm64/include/generated/asm/swab.h
  WRAP    arch/arm64/include/generated/asm/topology.h
  WRAP    arch/arm64/include/generated/asm/types.h
  WRAP    arch/arm64/include/generated/asm/vga.h
  WRAP    arch/arm64/include/generated/asm/xor.h
  CHK     include/generated/utsrelease.h
  WRAP    arch/arm64/include/generated/uapi/asm/kvm_para.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/recordmcount
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/sortextable
  MKELF   scripts/mod/elfconfig.h
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/asn1_compiler
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/extract-cert
scripts/extract-cert.c:21:25: fatal error: openssl/bio.h: No such file or directory
 #include <openssl/bio.h>
                         ^
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/extract-cert' failed
make[1]: *** [scripts/extract-cert] Error 1
make[1]: *** Waiting for unfinished jobs....
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/util.o
  SHIPPED scripts/dtc/dtc-lexer.lex.c
  SHIPPED scripts/dtc/dtc-parser.tab.h
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTLD  scripts/mod/modpost
  HOSTLD  scripts/dtc/dtc
Makefile:574: recipe for target 'scripts' failed
make: *** [scripts] Error 2
root@odroid:/home/odroid/linux#


@phaseshifter,
Could try to install libssl-dev?
Code: Select all
$ sudo apt-get install libssl-dev

It will fix the issue.

Then, please try kernel build again.
Last edited by joy on Mon Nov 12, 2018 9:56 am, edited 1 time in total.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Mon Nov 12, 2018 9:44 am

back2future wrote:[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:
Code: Select all
ssh odroid@maze.odroid.com -p 2230

cd /tmp/petitboot

for elatllat's all-in-one-script: make-uInitrd.sh
### reboot is not necessary nor enabled
### make -j 2
### <CTRL>+c for exiting script
Code: Select all
watch -n 1 "sensors" && sudo ./make-uInitrd.sh


work-in-progress edit: currently Mon Nov 12, 2018 5:47 am
./make-uInitrd.sh: line 256: warning: here-document at line 166 delimited by end-of-file (wanted `EOF')
./make-uInitrd.sh: line 257: syntax error: unexpected end of file

Thx@all ]

Hi back2future,
I've not tried the auto script on ODROID-C2.
Please let me check it on C2 this week.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Mon Nov 12, 2018 9:54 am

I've realized instructions are too complicated to be descried in this forum page... too long descriptions.... too many steps....
and also there is a lack of my descriptions.
I will make a wiki page.
It's very difficult to find which stage my mates are at.

Regardless of it, please keep going and asking anything if you have any trouble.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Mon Nov 12, 2018 1:16 pm

i had issues with step 3 helper binary's some cp commands failed

and step 5 udev rules some cp commands failed

also i had to make an "m4" dir i cannot exactly remember where that was but around those steps some where it was in the early stages

im up to building the kernel now..i`ll add more if needed..phase..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby back2future » Tue Nov 13, 2018 6:03 am

Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?
naturally beYOnd spectrum
back2future
 
Posts: 128
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Tue Nov 13, 2018 8:07 am

back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?

Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Tue Nov 13, 2018 8:29 am

phaseshifter wrote:i had issues with step 3 helper binary's some cp commands failed

and step 5 udev rules some cp commands failed

also i had to make an "m4" dir i cannot exactly remember where that was but around those steps some where it was in the early stages

im up to building the kernel now..i`ll add more if needed..phase..

Thank you for your report, phaseshifter.
I will check them and update instructions once I'm done a wiki page.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby back2future » Tue Nov 13, 2018 12:58 pm

joy wrote:
back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?

Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)


Ok. Your description helps a lot with understanding whole compiling process and troubles or difficulties.
How long does systemd or all uInitrd compiling last on N1? (C2 for systemd with 2 cores is about 1h20minutes).
So far we here try to get the compiling process done. No big optimization efforts so far.

[ and still like AMI bios also ]
naturally beYOnd spectrum
back2future
 
Posts: 128
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Tue Nov 13, 2018 1:57 pm

back2future wrote:
joy wrote:
back2future wrote:Could systemd compilation be reduced in size (requires ~640MB including 35MB source from git)?

Well I haven't tried it. Well... It seems it's not too helpful.
Instead, removing unused features from systemd is effective.... and also eliminating binaries and libraries.

For example, security and network features can be a big part.
But before that, we need to arrange the actual scenario and mandatory features for ODROID product. :)
(about 11MB -> 4MB)


Ok. Your description helps a lot with understanding whole compiling process and troubles or difficulties.
How long does systemd or all uInitrd compiling last on N1? (C2 for systemd with 2 cores is about 1h20minutes).
So far we here try to get the compiling process done. No big optimization efforts so far.

[ and still like AMI bios also ]

Similar. Over 1 hour on N1.

Anyway, when I saw your previous reply in this thread, "Right! C2 must be one of good test benches for petitboot.", I thought. :)
So I'm also planning to arrange instructions for C2,
because I haven't ran full instructions on C2 including uInitrd yet and also have to adjust kernel defconfig
and I'm not sure N1's auto script works on C2.

I hope you can keep this process and share your status and any fault.
I will also join later once I'm done to figure out the know issues I described above.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby mad_ady » Tue Nov 13, 2018 3:32 pm

I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.
User avatar
mad_ady
 
Posts: 4718
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby tobetter » Tue Nov 13, 2018 3:46 pm

mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.

I guess SYSV and UDEV would be fair enough, not sure, but current build seems to be happening in the Ubuntu native environment to copy from it in order to build the ramdisk. Someday, later, it's worth to try SYSV when Petitboot is fine with the current build.
User avatar
tobetter
 
Posts: 2465
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby mad_ady » Tue Nov 13, 2018 4:18 pm

Ok, fair enough :)
User avatar
mad_ady
 
Posts: 4718
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Wed Nov 14, 2018 7:21 am

mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.

Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.
Code: Select all
systemd-udevd &
udevadm hwdb --update
udevadm trigger


As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Wed Nov 14, 2018 7:26 am

back2future wrote:[ results on a C2 (arm64/aarch64) on Hardkernel's original products bench:
Code: Select all
ssh odroid at maze.odroid.com -p 2230

cd /tmp/petitboot

for elatll@'s modified all-in-one-script: make-uInitrd.sh
### re-boot is not necessary nor enabled
### "make -j 2"
### <CTRL>+c for exiting script
Code: Select all
watch -n 1 "sensors" && sudo ./make-uInitrd.sh


work-in-progress edit: currently Mon Nov 12, 2018 x:xx am
C2

26910 blocks
Image Name: uInitrd.igz
Created: Tue Nov 13 21:55:08 2018
Image Type: AArch64 Linux RAMDisk Image (lzma compressed)
Data Size: 3807036 Bytes = 3717.81 kB = 3.63 MB
Load Address: 00000000
Entry Point: 00000000
Everything is OK.

dir initramfs
5.6 MiB /usr
5.1 MiB /lib
1.8 MiB /bin
892.0 KiB /sbin
12.0 KiB /var
12.0 KiB /etc
8.0 KiB /run
4.0 KiB /tmp
4.0 KiB /sys
4.0 KiB /proc
4.0 KiB /newroot
4.0 KiB init

Thx@all ]


Yeah~ The auto script works on C2. :)
Thank you for confirming it and sharing the status here, @back2future.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Wed Nov 14, 2018 3:03 pm

well i have it up and running now i am not exactly shure what i did but i`m using the auto config script..

i do remember copying the .igz file from the prebullt petitboot into media boot and the other two files that the kernel build made..
modding the boot ini file as per what i thought it should be i can post that if you want me to...

so i did this ...after copying the two files from the initial make
Code: Select all
make modules 
make install
sudo cp .config /boot/config-`cat include/config/kernel.release`
sudo update-initramfs -c -k `cat include/config/kernel.release`


and here is my boot.ini file contents

Code: Select all
ODROIDN1-UBOOT-CONFIG

# U-Boot configuration
setenv kernel_addr "0x02000000"
setenv fdt_addr "0x01f00000"
setenv initrd_addr "0x04000000"

# Enable/Disable ODROID-VU7 Touchsreen
setenv disable_vu7 "false" # false

# Kernel cmdline rootfs and misc
setenv bootrootfs "swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait rw"

# Load kernel, uInitrd and dtb
load mmc ${bootdev} ${kernel_addr} Image
load mmc ${bootdev} ${initrd_addr} uInitrd.igz
load mmc ${bootdev} ${fdt_addr} rk3399-odroidn1-linux.dtb

# Set the kernel bootargs
setenv bootargs "${bootrootfs}"

# Boot the board
booti ${kernel_addr} ${initrd_addr} ${fdt_addr}



.but it seems that the petitboot screen wont save any changes i make to it..dunno if i did something else wrong..???

when i high light the ok button and hit enter nothing happens,,in the sub menu's...
Last edited by phaseshifter on Thu Nov 15, 2018 11:33 am, edited 2 times in total.
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby mad_ady » Wed Nov 14, 2018 4:57 pm

joy wrote:
mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.

Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.
Code: Select all
systemd-udevd &
udevadm hwdb --update
udevadm trigger


As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?
Well, sysv is the "legacy" way of starting linux systems, in use from the 1990s, ported from unix. It provides runlevels, /etc/rc*.d and /etc/init.d which are parsed by the init process. It should be easy to set up and consists of init and a bunch of startup scripts which are run serially instead of in parallel like systemd does. The number prefix of the script imposes the order it's executed in.
udev predates systemd, so it works with sysv, but is a different package and needs to be compiled in.
Returning to sysv you lose more advanced features like:
* builtin networking (you'd have to add ifupdown instead of systemd-networkd)
* ntp synchronization
* builtin resolver (you'd need resolvconf)
and probably others.

Denuvian is a debian distro that kept sysv - you could have a look there as well. Busybox-based systems (like openwrt) still use sysv.
User avatar
mad_ady
 
Posts: 4718
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Thu Nov 15, 2018 9:32 am

Hi phaseshifter,
You now have petitboot menu on your screen! :)
phaseshifter wrote:.but it seems that the petitboot screen wont save any changes i make to it..dunno if i did something else wrong..???
when i high light the ok button and hit enter nothing happens,,in the sub menu's...

Did you specify for the 2nd kernel through "n" menu, and have "User Item 1"?
Which storage is connected on your N1 except eMMC? ex) USB? SD card?
It's described in Step 4.
[ Step 4. Add a boot option and Jump to 2nd kernel ]
Code: Select all
Enter 'n'. then specify parameters and enter "OK".
For example, I made one vfat and one ext4 for rootfs on my USB stick
and copy another customized Kernel Image (ex:android) and uInitrd in vfat
and make a new rootfs in USB ext4. (in my case, I wrote a ubuntu minimal rootfs for test.)
so I got the display as following.
I specified the parameters.
Device : sda1
Kernel : Image
Initrd : uInitrd
Boot arguments : swiotlb=1 console=ttyFIQ0,115200n8 console=tty0 root=/dev/sda2 rootwait rw
Now I have "User Item 1" at the 1st line of Main Menu and you can jump to 2nd kernel and rootfs via the menu.


About the setting save...
It's normal now.
When you do reboot, all setting goes to default one.
So we need kboot.conf that petitboot utility provides.
But the conf file is fixed one in uInitrd
so for flexibility, we have to make a new scheme to scan all connected storages and update available lists on petitboot menu automatically.
I will share the scheme. It's on my todo list.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby joy » Thu Nov 15, 2018 10:04 am

mad_ady wrote:
joy wrote:
mad_ady wrote:I wonder - why is there a need for systemd in a initrd? Wouldn't sysv be enough? It's already provided by busybox as far as I know.

Thank you for the input, mad_ady.

Actually, I don't have much knowledge of systemd and sysv, so I didn't consider sysv.
Just it's an easy way to build initrd on native boards.
And for petitboot, the followings are needed.
Code: Select all
systemd-udevd &
udevadm hwdb --update
udevadm trigger


As I expected based on comments you and other mates @back2future, @tobetter mentioned, systemd must be too heavy.
And you mean sysv can substitute for systemd and it's better and lighter way, right?
Well, sysv is the "legacy" way of starting linux systems, in use from the 1990s, ported from unix. It provides runlevels, /etc/rc*.d and /etc/init.d which are parsed by the init process. It should be easy to set up and consists of init and a bunch of startup scripts which are run serially instead of in parallel like systemd does. The number prefix of the script imposes the order it's executed in.
udev predates systemd, so it works with sysv, but is a different package and needs to be compiled in.
Returning to sysv you lose more advanced features like:
* builtin networking (you'd have to add ifupdown instead of systemd-networkd)
* ntp synchronization
* builtin resolver (you'd need resolvconf)
and probably others.

Denuvian is a debian distro that kept sysv - you could have a look there as well. Busybox-based systems (like openwrt) still use sysv.

Thank you for the detailed explanation, mad_ady.
I haven't totally understood because of a lack of my knowledge
but sysv must be an easier way to setup uInitrd and run startup scripts.
Even though we need additional processes to add the missing features like netowrk and resolve, but it must be worthy to try sysv.
I must investigate and study it more, then we can ask advises to adjust the whole design and discuss the better way with you.
joy
 
Posts: 571
Joined: Fri Oct 02, 2015 1:44 pm
languages_spoken: english
ODROIDs: ODROID-C1+, XU4, X

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Thu Nov 15, 2018 12:13 pm

ok if i may add something...

there is no fan support whilst petitboot is up on the screen..i have the tall blue heatsink on my N-1 so if i`m into the petitboot for some time it matters not..
but a normal user using whichever board may find the fan not spinning up quite an issue..

point 2
you may want to add ""consoleblank=0" to the boot args ..
i have multiple machines hooked to my screen and just switch between them via the t.v remote

however the petitboot goes blank after some time and i cannot always bring it up/back on the screen..having to reboot it ..is an issue 4 me...

this my not be an issue for some but others may beg to differ...phase...

EDIT: also i might add that having the uart kit plugged in causes an issue for some reason so disconnect it from the usb end on whatever your using to putt`y into it etc..etc..i found that you just end up with a blank screen if you leave it connected

furthermore...i have used red and orange emmc chips and both work..!!
have not tried it with a blue one as yet prolly later on..phase..

just to add since i have no idea how to put a ubuntu image that will work with the N-1..i am going to flash a copy of fordee`s lightweight linux and see if i can get that to boot up...phase..
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby phaseshifter » Fri Nov 16, 2018 11:06 pm

i thought i would share this is what i have done

got an image from pi and the petiyboot see`s all four partitions ..
i have the light image on sd card and the emmc with the boot system to run p-b

however the p-b program really lacks a lot of features 4 me..maybe it`s just my poor know how

any way i entered in the deatils and i get so far as now it seems p-b cannot read/find the ".dtb" file.. maybe it`s a boot args issue..i dunno..

having a break for a while with some r and r...
Build It And They Will Come...Be Bold And Mighty Forces Will Come To Your Aid..!!!
phaseshifter
 
Posts: 2970
Joined: Fri May 08, 2015 9:12 am
languages_spoken: english
ODROIDs: N-1..c1+ ..c-2..xu3 lite,xu4...u-3..
u-2...other odroid acc`s as well

Re: BIOS design using PETITBOOT to support SPI booting

Unread postby back2future » Sat Nov 17, 2018 1:13 am

naturally beYOnd spectrum
back2future
 
Posts: 128
Joined: Sun Jul 23, 2017 3:19 pm
languages_spoken: english

Previous

Return to Projects

Who is online

Users browsing this forum: No registered users and 1 guest