-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic recipe for Boundary Devices Nitrogen6SoloX board #18
Open
andhe
wants to merge
10
commits into
go-debos:main
Choose a base branch
from
andhe:nit6sx
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cd751cf
nit6sx: copy rpi3bplus as base
andhe 3f9ae43
nit6sx: initial adaptions for this board
andhe 9ddb58b
nit6sx: console on ttymxc0
andhe dcb493c
nit6sx: drop u-boot-menu
andhe 61be31c
nit6sx: initial bootloader adaptions
andhe d9a198b
nit6sx: Use pre-built u-boot binary from boundarydevices.com
andhe 6b7585c
nit6sx: Make sure ramdiskaddr is set in u-boot script
andhe cfbe3f5
nit6sx: Use template variable for mmc boot device
andhe baf077b
nit6sx: remove unused rpi script
andhe 66cb210
nit6sx: fixes for 'Use template variable for mmc boot device'
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{{- $image := or .image "debian-nit6sx.img" -}} | ||
|
||
architecture: armhf | ||
|
||
actions: | ||
- action: download | ||
description: Download pre-built nit6sx u-boot binary | ||
url: http://linode.boundarydevices.com/u-boot-images/u-boot.nitrogen6sx | ||
name: bootloader | ||
|
||
- action: debootstrap | ||
suite: buster | ||
components: | ||
- main | ||
mirror: https://deb.debian.org/debian | ||
variant: minbase | ||
|
||
- action: apt | ||
description: Install extra packages | ||
packages: | ||
- sudo | ||
- openssh-server | ||
- adduser | ||
- systemd-sysv | ||
- linux-image-armmp | ||
- u-boot-imx | ||
- wget | ||
|
||
- action: run | ||
description: Set up user | ||
chroot: true | ||
script: scripts/setup-user.sh | ||
|
||
- action: run | ||
description: Add hostname | ||
chroot: true | ||
command: echo nit6sx > /etc/hostname | ||
|
||
- action: overlay | ||
source: overlays/networkd | ||
|
||
- action: run | ||
chroot: true | ||
script: scripts/setup-networking.sh | ||
|
||
- action: run | ||
chroot: true | ||
command: echo console=ttymxc0,115200 > /etc/kernel/cmdline | ||
|
||
# Make dtb easy to find (normally flash-kernel does this for us) | ||
- action: run | ||
chroot: true | ||
command: ln -rsf /usr/lib/linux-image-*-armmp/imx6sx-nitrogen6sx.dtb /boot/dtb | ||
|
||
- action: run | ||
description: Generate boot-loader script | ||
script: scripts/gen-bootscript.sh | ||
|
||
- action: image-partition | ||
imagename: {{ $image }} | ||
imagesize: 1GB | ||
partitiontype: msdos | ||
mountpoints: | ||
- mountpoint: / | ||
partition: root | ||
partitions: | ||
- name: root | ||
fs: ext4 | ||
start: 1MB | ||
end: 100% | ||
flags: [ boot ] | ||
|
||
- action: filesystem-deploy | ||
description: Deploying filesystem onto image | ||
|
||
# The nitrogen6sx support is not yet in upstream u-boot, see: | ||
# https://github.com/boundarydevices/u-boot-imx6/tree/boundary-v2018.07 | ||
# (note: must be done after partition table writing or will be wiped!) | ||
|
||
- action: raw | ||
description: Write u-boot binary to raw image load addr | ||
origin: bootloader | ||
source: . | ||
offset: 1024 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Note to self: This could also be written as |
||
|
||
#- action: raw | ||
# description: Write u-boot SPL | ||
# origin: filesystem | ||
# source: /usr/lib/u-boot/nitrogen6sx/SPL | ||
# offset: 1024 # bs=1k seek=1 | ||
|
||
#- action: raw | ||
# description: Write u-boot full version | ||
# origin: filesystem | ||
# source: /usr/lib/u-boot/nitrogen6sx/u-boot.img | ||
# offset: 70656 # bs=1k seek=69 | ||
|
||
- action: run | ||
description: Create block map file | ||
postprocess: true | ||
command: bmaptool create {{ $image }} > {{ $image }}.bmap | ||
|
||
- action: run | ||
description: Compressing final image | ||
postprocess: true | ||
command: gzip -f {{ $image }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Match] | ||
Name=e* | ||
|
||
[Network] | ||
DHCP=yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# Puts below info in a script and generate boot.scr | ||
# This script assumes it's executed from 'artifact directory' (/scratch) | ||
|
||
cat << 'EOF' > bootscr.txt | ||
# debos nit6sx boot script | ||
# loadaddr=0x82000000 | ||
env exists ramdiskaddr || setenv ramdiskaddr 84000000 | ||
# fdt_addr=83000000 | ||
# console=ttymxc0 | ||
# baudrate=115200 | ||
|
||
|
||
setenv prepbootargs 'if test -n "${console}"; then setenv bootargs "${bootargs} console=${console}" ; fi ; setenv bootargs ${bootargs} cma=256M ; setenv bootargs ${bootargs} root=LABEL=root' | ||
#setenv bootargs ${bootargs} quiet | ||
|
||
setenv loadkernel 'load mmc 0 ${loadaddr} /vmlinuz' | ||
setenv loadfdt 'load mmc 0 ${fdt_addr} /boot/dtb' | ||
setenv loadrd 'load mmc 0 ${ramdiskaddr} /initrd.img && setenv rdsize $filesize' | ||
setenv loadall 'run loadkernel; run loadfdt; run loadrd' | ||
|
||
setenv bootmmc 'mmc dev 0; run prepbootargs; run loadall; bootz ${loadaddr} ${ramdiskaddr}:${rdsize} ${fdt_addr}' | ||
|
||
run bootmmc | ||
|
||
EOF | ||
|
||
mkimage -A arm -T script -C none -n "Debos Nitrogen6SoloX script" -d bootscr.txt $ROOTDIR/boot/boot.scr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
wget http://ftp.us.debian.org/debian/pool/main/u/u-boot/u-boot-rpi_2018.09+dfsg-1_arm64.deb | ||
dpkg -i u-boot-rpi_2018.09+dfsg-1_arm64.deb | ||
rm u-boot-rpi_2018.09+dfsg-1_arm64.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Network management | ||
systemctl enable systemd-networkd | ||
# DNS resolving | ||
systemctl enable systemd-resolved | ||
# NTP client | ||
systemctl enable systemd-timesyncd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
adduser --gecos user \ | ||
--disabled-password \ | ||
--shell /bin/bash \ | ||
user | ||
adduser user sudo | ||
echo "user:user" | chpasswd |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See go-debos/debos#77 (downloaded is a file which should be used directly, not an archive.)