Giter VIP home page Giter VIP logo

Comments (76)

pyavitz avatar pyavitz commented on August 30, 2024 1

Might be easier to build the debs native on one of the units and then install the required depends and pre-built debs inside the chroot of the builder. Personally, I find building native is faster inside the chroot. But I don't have any x86_64's with that many threads. :)

Yes, it is easy for things to go wrong sometimes.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I'll investigate. In the mean time you can also build using make commands

Is it actually producing an img? If so this may just be a dialog error.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I just ran native and got this.
Screenshot_2023-08-26_21-34-29

That was building for the rootfs only. I have an x86_64 build currently going on all. I'll get back to you.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks for a prompt response.
The first time it did build an image, second time it didn't.
I just did this and it seems to just print a file name:
debian@debian:~/devel/rpi-img-builder-lcnc$ make rootfs board=bcm2711
Root Filesystem
256968 -rw-r--r-- 1 root root 263120456 Aug 27 08:45 debian-bookworm-rootfs-arm64.tar.xz

But that file date is too early for it to be my RT build and I would have expected to see RT in the file name

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

So I might start again with:
make purge-all
make all board=bcm27111
and report back in a few hours

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Nah. It is just telling you the rootfs tarball is already there. I have the builder setup, so if it finds the tarball, it skips the build process. Since it is time and bandwidth consuming.

If you wanna really purge everything, you need to remove the tarball ur self. sudo rm -f *tar*

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

NOw its really crazy. when I say purge all, it starts to build the kernel!
I might reclone

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Recloned. Here is another bug.
When you set MENUCONFIG=1 in build config, the data is wrong. You get this and an error later and menuconfig does not load.

MENUCONFIG="1"01

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Cloned again so Brand new
Does this look right? (loaded su so sudo does not time out)
/install.sh
make config
sudo su
make all board=bcm2711

RT patch from kernel.org in userpatches
deleted all kernel deb files from /output

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Are you back spacing? dialog is a bit silly. So you need to make sure you delete the values listed before entering new ones.

Came right up for me?

Screenshot_2023-08-26_22-08-25

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Cloned again so Brand new Does this look right? (loaded su so sudo does not time out) /install.sh make config sudo su make all board=bcm2711

RT patch from kernel.org in userpatches deleted all kernel deb files from /output

Yes, looks good to me.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks, building now. The patches seemed to be applied and menuconfig came up.
I am hoping to fork this for linuxcnc so they can put it in their buildbot. In the past they used a Pi which failed about once a month. Will be compiling linuxcnc from source. I think I know how to make it do that.

The dialog actually caught me out every time so I check it in a text editor to get it right.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I'm thinking that menuconfig bit might have something to do with this piece of code.

# userdata-txt
if [[ -f "userdata.txt" ]]; then
	sed -i 's/=0/="0"/g' userdata.txt
	sed -i 's/=1/="1"/g' userdata.txt
	sed -i 's/LLVM_IAS="1"/LLVM_IAS=1/g' userdata.txt
	echo -e "userdata file created."
	exit 0
fi

It doesn't know what you entered and is just putting quotes around what it is looking for.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

It actually flagged it as invalid data and said it was ignoring it. First time through, I had no idea what that meant :)

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I just saw what you wrote. And I'm not sure how make purge-all would try and build anything?

Craziness. I even tried to make it happen, which shouldn't work and didn't.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

I just saw what you wrote. And I'm not sure how make purge-all would try and build anything?

Craziness. I even tried to make it happen, which shouldn't work and didn't.

Yes, I think by then, it was totally screwed! I must have broken it....
Anyway, a fresh start now I know what I am doing should work... :)

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Hmm,
adduser: Please enter a username matching the regular expression
configured via the NAME_REGEX configuration variable. Use the
`--allow-bad-names' option to relax this check or reconfigure
NAME_REGEX in configuration.
user and PW were both CNC in the userdata.txt

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

OK, must all be lower case..I didn't know that.
Ubuntu only accepts usernames based on the following rules:
Must start with a lowercase letter
May only contain lowercase letters, underscore (_), and dash (-)
May optionally end with a dollar sign ($)

So I changed the userdata.txt to my name and reran

make image board=bcm2711
and I got:
adduser: The user `rodwebster' does not exist.
make: *** [Makefile:136: image] Error 1

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Hmm, adduser: Please enter a username matching the regular expression configured via the NAME_REGEX configuration variable. Use the `--allow-bad-names' option to relax this check or reconfigure NAME_REGEX in configuration. user and PW were both CNC in the userdata.txt

That is interesting, I also didn't know this. I normally don't get complicated with my user information though.

This worked fine for me.

NAME="CNC"
USERNAME="cnc"
PASSWORD="cnc"

Last I checked the only variable you really need to be careful with here is NAME="".

GOOD

NAME="Marvin"

FAIL

NAME="Marvin Martian"

It doesn't like blank spaces.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks I finally got success! I set name = user = password = cnc
I won't get a chance to test it until tomorrow but I have every confidence. :)

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Finally was able to attempt to boot this image. I got a fail as shown below. I figured the boot loader might be old so upgraded it but still got the same error. It appears to not be able to find a FAT32 boot partition.
pi-boot
I noticed in custom.txt there is the following setting
`

Root Filesystem Types: ext4 btrfs xfs

FSTYPE="ext4"
`
But I don't see an option to use FAT. (Is that actually for the the Boot partition?)

Have you got any ideas here?
Using a Pi 4B about 4 years old (pre covid) and a 15gb SD card.
I'm a bit lost on how to resolve this. I am a very occasional Pi user...

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

That wasn't it. There is a FAT16 Boot partition

mmcblk0p1
vfat FAT16 BOOT 0783-4AD5 208.1M 17% /media/debian/BOOT

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I no longer own a Pi4, but I wonder if me turning off LBA has in some way created an issue?

Let us check and see. You'll need a Linux box for this. Put the SD in the CARD reader and plug it in to ur linux box. Now find the /dev/$node and run: sudo parted --script /dev/$node set 1 lba on

Example:

sudo parted --script /dev/sdd set 1 lba on

You can check and make sure if you like.

sudo fdisk -l /dev/sdd
Disk /dev/sdd: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: MassStorageClass
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd29ca7e4

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sdd1         2048   526335   524288  256M  c W95 FAT32 (LBA)
/dev/sdd2       526336 62332927 61806592 29.5G 83 Linux

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Hmm. Apparently this is an issue; https://forums.raspberrypi.com/viewtopic.php?t=278295

I'll investigate. Thanx for the report.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Sorry about all that. This should resolve it: f3f48ad

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

A very interesting article even if its annoying! I might try your LBA tweak, then erase the MBR this way
https://www.cyberciti.biz/faq/linux-clearing-out-master-boot-record-dd-command/
I do remember walking a 12 bit FAT 30 years ago but never again!
Seems like I should be trying to write a standard Rpi image to start with in the hope it corrects the MBR

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks. Just going to bed. so will try tomorrow night.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

It worked!
PREEMPT_RT kernel installed perfectly!
XFCE installed
LinuxCNC dependencies installed (about 2 Gb)
Building LinuxCNC now. That will take a while....
Once I have it all down pat, it will be time to script it in the installer.
Thanks for all your help. I really appreciate the prompt response and guidance.
Perhaps leave the issue open for a few days and I'll report any other issues..

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Excellent! I'm happy we got it figured out.

It appears in my quest to make things better, I broke something, which isn't unusual. :) Thanx for testing and helping to resolve it.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

I break things all the time!
Is there a folder location you can add debs to that are installed when it runs?
That would be a useful shortcut to start with. for me,

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Not a particular location, no. There is a USER_PKGS variable in the user data file you can add your own list of packages to. But beyond that there is only the userscripts.

Using it requires you know bash. Basically you need to create a function or functions and the builder will run them. You'll also need to enable USCRIPTS="1" in the user data file.

The README gives a "basic" run down of how it works, along with some example scripts I've made and used. Two examples to look at, would probs be util-linux and gpac.

If you are adding a large amount of packages, I suggest increasing the size of the img. This can be done via the custom.txt file.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Somehow I am getting this error. I did not see it previously. I skipped past it. Is it a critical patch?

`--------------------------
|diff --git a/net/core/devlink.c b/net/core/devlink.c
|index 5a4a4b34ac15..f0c6fcdb7a3a 100644
|--- a/net/core/devlink.c
|+++ b/net/core/devlink.c

File to patch:
`
So I added a user script and it ran last night fine until it ran out of space right at the end (with 6 gb).
Then I increased the size and accidentally added some spurious characters to uscript so it errored. Fixed that this morning, then got this error.
I am also seeing it at home on a different PC. Odd.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

It is a good idea to work with commits or at least know the commit you are working out of, when using RT patches. They are very tricky and revision specific. You can sometimes get away with going up a revision or two, but it isn't the best practice.

In your case I believe rpi-linux has taken to many steps forward to support the patch you are using. So use the commit feature of the builder: make commit board=bcm2711

Paste commit: 655fc658a15ae7a6f37103754adb39ba52a9a14e

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

As for the size, the builder only knows what we tell it. If you wanna play it safe and not math out the build, give it an exaggerated image size. I usually go with 8GB or 10GB and just let it shrink the img down when it is done.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks, Its all a learning process. I looked at the kernel version in the beginning and it was 6.1.47 vs the RT patch at 6.1.46. I did not know how to change it back but I figured it would be close enough.
I did not realise the Pi kernel is marching forward so its now up to 6.1.50!

Thanks for explaining how to get an earlier version.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Paste commit: 655fc658a15ae7a6f37103754adb39ba52a9a14e

Can you explain where you got this commit from. I tried using the commit fot Linux 6.1.46 but its different to this (and did not work)

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Paste commit: 655fc658a15ae7a6f37103754adb39ba52a9a14e

Can you explain where you got this commit from. I tried using the commit fot Linux 6.1.46 but its different to this (and did not work)

Didn't apply correctly or the RT aspect of the kernel isn't working? I built the kernel to make sure it compiled but I never ran it.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I git cloned the repo and ran git log --merges -n 2 Which gave me the last two merge remote tracking tags. The foundation also keeps tags in their github under releases, but unfortunately the last tag is really old.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Ok. So this is what I just did:

marvin: rpi-linux git:( rpi-6.1.y ✓ ) $ git log --merges -n 4
commit 9b79cb06ad370cfd5fc52f7d85d82bdcff701828
Merge: 9d9586dc0c0d a2943d2d9a00
Author: Dom Cobley <[email protected]>
Date:   Thu Aug 31 18:58:24 2023 +0100

    Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y

commit 655fc658a15ae7a6f37103754adb39ba52a9a14e
Merge: e89e7655a197 802aacbbffe2
Author: Dom Cobley <[email protected]>
Date:   Fri Aug 25 13:04:30 2023 +0100

    Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y

commit 9ed4f05ba2e2bcd9065831674e97b2b1283e866d
Merge: 19a1b0352936 6c44e13dc284
Author: Dom Cobley <[email protected]>
Date:   Mon Aug 21 17:44:22 2023 +0100

    Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y

commit 19a1b03529363945fbbb4b9160fe8645809a9dce
Merge: 0917a6caec99 1321ab403b38
Author: Dom Cobley <[email protected]>
Date:   Fri Aug 11 14:39:56 2023 +0100

    Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y

This gives the last four they did. I then check the dates against kernel.org here: https://cdn.kernel.org/pub/linux/kernel/v6.x/

I see this: linux-6.1.46.tar.xz 16-Aug-2023 16:39 129M

Now assuming that logic still works, I go with the following commit: 9ed4f05ba2e2bcd9065831674e97b2b1283e866d

With that said, don't always assume logic is a thing when it comes to linux :) and there may be a better way to go about it? This is just the approach I am taking. If we were dealing with mainline and pulling from kernel.org this would be really straight forward.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Awesome. That makes sense too. Shown here in github

Screenshot 2023-09-02 11 35 09 AM

I'm a bit in between here as I am trying to set up a PC here at home (18 core i7) With Debian 12 on it to make this a bit faster... Just not sure if I'm going to overwrite a windows partition

I think you could aso search the log for "6.1.46" and compare with your merges. Its also complicated becasue the Pi does not track the mainline at kernel.org but matching up the RT patch version with mainline is always an issue to consider.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Finally got a working image with all our apps that matches the RT patch! Thanks for all your help so far. Don't ask me how long it takes to build!
A couple of final questions.

  1. After we have run menuconfig once, if we set MENUCONFIG="0", does that keep the kerenel config with preempt_rt set?
  2. Can you change the code so the commit number can be stored in userdata.txt so we can use this in a buildbot situation? That would be awesome!

Some observations:

  1. The user can use sudo without entering a password (we don't want to add a root user)
  2. We are getting a locale error. I ended up changing the config to use my local Australia/Brisbane setting but I'm sure it is happens with the defaults.
    perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_AU:en", LC_ALL = (unset), LANG = "en_AU.UTF-8" are supported and installed on your system.
    Thanks again for being so helpful.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Finally got a working image with all our apps that matches the RT patch! Thanks for all your help so far. Don't ask me how long it takes to build! A couple of final questions.

  1. After we have run menuconfig once, if we set MENUCONFIG="0", does that keep the kerenel config with preempt_rt set?

No it doesn't. That feature just allows you to run the interface and save the defconfig. Once you have a defconfig you like you can use the custom_defconfig feature in the userdata.txt. https://github.com/pyavitz/rpi-img-builder#user-defconfig

### CUSTOM
CUSTOM_DEFCONFIG="1"
MYCONFIG="cnc_defconfig"
  1. Can you change the code so the commit number can be stored in userdata.txt so we can use this in a buildbot situation?

I could do this or something equivalent to it.

That would be awesome!

Some observations:

  1. The user can use sudo without entering a password (we don't want to add a root user)

This can currently be disabled using menu-config or you can manually delete the file sudo rm -f /etc/sudoers.d/010_*-nopasswd. I suppose I could also add a switch to have this feature disabled by default during img creation?

  1. We are getting a locale error. I ended up changing the config to use my local Australia/Brisbane setting but I'm sure it is happens with the defaults.
    perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_AU:en", LC_ALL = (unset), LANG = "en_AU.UTF-8" are supported and installed on your system.

After firstboot you either need to run setup -r or use menu-config to set the locales, timezone and other bits.

Thanks again for being so helpful.

You are welcome.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Well, I think its about done.

The one thing I forgot to ask was how to add boot parameters the right way. I need to add
processor.max_cstate=1 isolcpus=2,3

The new commit method works perfectly. Much appreciated as we can now set and forget it!

I deleted the sudoers no password files in my stage 2 uscript. (I hope!)

So just to clarify re defconfig. I ran it once with menuconfig and copied the generated defconfig file to /defconfig and renamed it. Seems to be working.

Just getting to the end of another image build now.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Well, I think its about done.

The one thing I forgot to ask was how to add boot parameters the right way. I need to add processor.max_cstate=1 isolcpus=2,3

The new commit method works perfectly. Much appreciated as we can now set and forget it!

I deleted the sudoers no password files in my stage 2 uscript. (I hope!)

So just to clarify re defconfig. I ran it once with menuconfig and copied the generated defconfig file to /defconfig and renamed it. Seems to be working.

Just getting to the end of another image build now.

We can go about this two three ways.

    1. Edit the lib/boards/bcm2711 file and add to variable EXTRA="" under # cmdline.
    1. Edit the /boot/cmdline.txt file using uscript.
if [[ -f "/boot/cmdline.txt" ]]; then
	sed -i 's/net.ifnames=0/net.ifnames=0 processor.max_cstate=1 isolcpus=2,3/g' /boot/cmdline.txt
fi

I would go with option one, as the builder will sometimes generate a new /boot/cmdline.txt file under certain circumstances, as does the firstboot script. Putting it in the $BOARD file will insure it will always be there, as that file gets installed on the img at /etc/opt/board.txt.

EDIT:
Actually there is a third option that should also work. Add to uscript a run_function0:

run_function0 (){
if [[ -f "board.txt" ]]; then
	sed -i 's/net.ifnames=0/net.ifnames=0 processor.max_cstate=1 isolcpus=2,3/g' board.txt
fi
}

That should edit the file before it ever gets sourced and used by the builder and install the edited file on the img.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks. Option 1 seemed to be the cleanest way anyway but function0 seems safer again!

We seem to be wasting some space with redundant kernels and headers
Selecting previously unselected package linux-headers-bcm2711-rpi-4. (Reading database ... 168835 files and directories currently installed.) Preparing to unpack linux-headers-bcm2711-rpi-4_6.1.50-rt13-1_arm64.deb ... Unpacking linux-headers-bcm2711-rpi-4 (6.1.50-rt13-1) ... Selecting previously unselected package linux-image-bcm2711-rpi-4. Preparing to unpack linux-image-bcm2711-rpi-4_6.1.50-rt13-1_arm64.deb ... Unpacking linux-image-bcm2711-rpi-4 (6.1.50-rt13-1) ... Setting up linux-headers-bcm2711-rpi-4 (6.1.50-rt13-1) ... Compiling headers ... Setting up linux-image-bcm2711-rpi-4 (6.1.50-rt13-1) ... update-initramfs: Generating /boot/initrd.img-6.1.50-rt13n
I have seen some people suggest to use rm to remove them after the one you want is installed. Any thoughts on that? Not sure how to do it though!

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

If you don't need the headers, rm -f /root/linux-headers-*.deb using uscripts. Probs the easier way, as the builder won't even run stage1 without running a check to make sure they are there. Just know, you won't be able to compile out-of-tree drivers with out them.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Its OK. We need headers for some out of tree stuff but its offically not something we can include due to obscure licensing so I will just add their repos which I do in my x86 installer.

Just did a final commit to my fork!
Well hope its final!

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Oops, whats this?

debian@debian:~/devel/rpi-img-builder-lcnc$ make commit kernel board=bcm2711
Compiling kernel
board.txt: line 36: unexpected EOF while looking for matching `"'

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

board.txt

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Oops, whats this?

debian@debian:~/devel/rpi-img-builder-lcnc$ make commit kernel board=bcm2711
Compiling kernel
board.txt: line 36: unexpected EOF while looking for matching `"'

You are missing a quote.

EXTRA="loglevel=5 net.ifnames=0 firmware_class.path=/lib/firmware/updates/brcm

Should be.

EXTRA="loglevel=5 net.ifnames=0 firmware_class.path=/lib/firmware/updates/brcm"

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Ahh Its being overridden by the function0 script.
At least we know that works!
Not sure on sed. Just used it on this project for the first time

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

or overwritten with something

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I only ran a basic test, but looks right?

marvin: ~  $ sed 's/net.ifnames=0/net.ifnames=0 processor.max_cstate=1 isolcpus=2,3/g' board.txt
#!/bin/bash

# architecture
ARCH="arm64"
ARCH_EXT="arm64"
DEBARCH=""
CROSS_COMPILE="aarch64-linux-gnu-"
ROOTFS_ARCH="rootfs-${ARCH_EXT}"
STATIC="qemu-aarch64-static"

# menu
PRETTY_BOARD="Raspberry Pi 4/400		BCM2711 / ARM64"

# misc
FAMILY="broadcom"
FAMILY_EXT=""

# default config
LINUX_DEFCONFIG="bcm2711_defconfig"

# partitions
OFFSET="8192"
P_VALUE="p2"

# output
BOARD="bcm2711"
BOARD_EXT="rpi-4"
OUTPUT="output/${BOARD}"
IMG_EXP="${BOARD_EXT}-*.img*"

# cmdline
CONSOLE="console=serial0,115200 console=tty1"
EXTRA="loglevel=5 net.ifnames=0 processor.max_cstate=1 isolcpus=2,3 firmware_class.path=/lib/firmware/updates/brcm"

# packaging
KERNEL_IMG="kernel8.img"
SERIES="bcm2711-${BOARD_EXT}"

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Sorted. Missing a " in lib/boards. I must have done that before you suggested function0 and deleted too much!
Building again now

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

good good... I was gonna say, I just ran a real test and sed worked just fine.
Screenshot_2023-09-02_23-09-11

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Great, Still building function2 here but far enough along to see that cmdline.txt is perfect!
console=serial0,115200 console=tty1 root=PARTUUID=3adbfbbd-02 rootfstype=ext4 fsck.repair=yes loglevel=5 net.ifnames=0 processor.max_cstate=1 isolcpus=2,3 firmware_class.path=/lib/firmware/updates/brcm rootwait

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

WHere should this go? I don't think it stuck. I had it in function2

#remove sudo no password
sudo rm -f /etc/sudoers.d/010_*-nopasswd.

Hmm, it was not commented out. Do you need to do it on the pi? (works there)

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

If you have it in uscripts you don't need to use sudo.

Try:

rm -f /etc/sudoers.d/010_${USERNAME}-nopasswd

If for some reason that doesn't work, comment out the lines in stage2.
https://github.com/pyavitz/rpi-img-builder/blob/master/scripts/stage2#L169

# Sudoers file
#if [ $USERACCT -eq 0 ]; then
#	echo ""
#	tee /etc/sudoers.d/010_${USERNAME}-nopasswd <<EOF
#${USERNAME} ALL=(ALL) NOPASSWD: ALL
#EOF
#fi

That should be it?

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

I'll see how I go. I am rebuilding without the sudo. I might leave it to the user to decide how he wants to do sudo.. Main thing I want to get sorted is to get more cores building the Linuxcnc debs. They are masssive! I have had one go at it a while ago and it errored. Hoping this will add another 15 threads into play to the build (-j'nproc' failed)
dpkg-buildpackage -b -uc -j$(nproc)

The last image I built failed to boot. Maybe becasue I did not purge-all, so trying again with a clean purge-all
If it fails this time, I'll go back to redo menuconfig. SO easy to get a step wrong

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Hi again.

There is one thing I don't understand is how to create a defconfig. On a normal kernel build it seems this is done with make savedefconfig.

Does CUSTOM_DEFCONFIG save the defconfig? There is no mention of it being saved in the docs.
If there is no feature for this, could we add one? Maybe it creates one after menuconfig completes and then copies the defconfig to the defconfig folder?

I've had a wierd data corruption here with a 699 byte userdata.txt file that showed no data in the file. That has held me up for a few days but a couple of other linuxcnc users are working with this too. Finally burning what I hope is a good image again right now! It would be good to be able to lock in the defconfig settings.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Grr, my build failed again, going to try one someone els has built.

Also, does COMPRESS_IMG compress the image? My image is 6.4 gb and my mates is 2 gb for the same thing!

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Yes, it compresses the img to an img.xz so it can be easily uploaded or transferred.

As for the defconfig, it looks like I didn't add the save to output/$BOARD directory yet. I'll add the feature and fix the ccache compiles today or tomorrow.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks for the new commit. Sounds like it will be a great enhancement.
I'm glad my feedback is finding bugs and improving your solution!
It seems like I have a problem with mi Pi. Known good imgs are not running on my hardware. I just have not got a lot of time these next few days to check it out.

Thanks again for working with me.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

One more question. my stage2 script builds the linuxcnc debs in /tmp and installs them.
Last night I copied them to the user's home directory so they don't get overwritten in /tmp

How can I save them into the output directory? I thought it was outside of the chroot. That is the most logical place to put them.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Thanks for the new commit. Sounds like it will be a great enhancement. I'm glad my feedback is finding bugs and improving your solution! It seems like I have a problem with mi Pi. Known good imgs are not running on my hardware. I just have not got a lot of time these next few days to check it out.

Thanks again for working with me.

I tend to neglect this builder, as I also have another one, which is where most of my focus goes. But yes, you have found a couple bugs I wasn't aware of, which I appreciate and have prompted me to back port features from the other builder into this one.

One more question. my stage2 script builds the linuxcnc debs in /tmp and installs them.
Last night I copied them to the user's home directory so they don't get overwritten in /tmp

How can I save them into the output directory? I thought it was outside of the chroot. That is the most logical place to put them.

Technically, you could copy them out before the img is unmounted using the stage1 script.
https://github.com/pyavitz/rpi-img-builder/blob/master/scripts/stage1#L184
The "." being the /root/ of the builder, so cp -fr p2/tmp/*.deb output/${BOARD}/ I thinks should work.

Super generic way to do it.

if [[ `ls p2/tmp/*.deb` ]]; then
	cp -fr p2/tmp/*.deb output/${BOARD}/
	rm -f p2/tmp/*.deb
fi

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks,
You may regret telling me about your other builder!
I have an Odroid N2+ which I wouild like to get Linuxcnc running on. Several others have tried other Armbian supported boards.

I have worked with Armbian, with limited sucess with the RT kernel even with the help of an Armbian RT guy.

Should we use the other builder for the Pi? I tackled this specific board becasue Linuxcnc has an existing but quite broken 32 bit Pi image.

PS I have another builder too. For linuxcnc on X86 hardware. Its a lot easier as there is buildbot for all the debs. I need to finish this one and get back to it.
https://github.com/rodw-au/linuxcnc-live-build

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

I don't use RT kernels, but with the other builder, it should be a lot easier to get that compiled.

I focus most of my attention on Amlogic and the current AML patch set I'm using seems pretty solid. At least on a headless level... I don't mess around with GUI's on ARM all that much.

As for Pis and that builder. No, not really. Any personal Pi builds I create for my self, I use this builder as the other one is primarily mainline centric.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Back at it again.
After merging your upstream changes, I went to build with menuconfig I got an error stating:
No rule to make menuconfig (I tried a couple of time)
So I ran it on the mainline with make kernel and that opened the menu
Restarted and ran it with make commit and it had a rule to make menuconfig
But when I built the kenrel I got V 6.1.51 not 6.1.46
So I am stuck here.
I noticed this error after extracting archive
gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now lib/function/rpi-commit: line 85: cd: linux-rpi-6.1.y: No such file or directory

Is there anything I need to do to enable caching on future runs?

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

looks like rpi-commit is opening the wrong folder. Should be the commit number.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Should be fixed... Enable ccache ->
Screenshot_2023-09-06_07-17-22

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Thanks, that seems to be working now thanks.
I'll see how I go with some function 1 scripts.
In an automated build, is there a way to pipe "1" etc into bash to accept your continue/exit menu option?

I will say I'm easilly confused tonight. A friend who is building with this flat out calls himself Cornholio on our forum and you are C0rnelius on your emails. I think I should just call myself Confused :)

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

Thanks, that seems to be working now thanks. I'll see how I go with some function 1 scripts. In an automated build, is there a way to pipe "1" etc into bash to accept your continue/exit menu option?

I will say I'm easilly confused tonight. A friend who is building with this flat out calls himself Cornholio on our forum and you are C0rnelius on your emails. I think I should just call myself Confused :)

Why would you want too? All that does is save the defconfig(s) to output/$BOARD dir and give you the option to continue on or quit. If you actually wanna use the defconfig in future builds going forward you need to enable it in the userdata file and put the defconfig in the defconfig dir.

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

One more question. my stage2 script builds the linuxcnc debs in /tmp and installs them.
How can I save them into the output directory? I thought it was outside of the chroot. That is the most logical place to put them.

Technically, you could copy them out before the img is unmounted using the stage1 script. https://github.com/pyavitz/rpi-img-builder/blob/master/scripts/stage1#L184 The "." being the /root/ of the builder, so cp -fr p2/tmp/*.deb output/${BOARD}/ I thinks should work.

Super generic way to do it.

if [[ `ls p2/tmp/*.deb` ]]; then
	cp -fr p2/tmp/*.deb output/${BOARD}/
	rm -f p2/tmp/*.deb
fi

Is this a Stage 1 function?
ref: https://github.com/rodw-au/rpi-img-builder-lcnc/blob/linuxcnc/files/userscripts/uscripts#L10
I build linuxcnc in Stage 2
Should that be built in stage 1 too?
Or can this suggested script be moved to stage 2?
I'm abit confused about the stages

In an automated build, is there a way to pipe "1" etc into bash to accept your continue/exit menu option?

The ultimate goal is to have a fully automated process. Once we have run menuconfig once and created a custom defconfig (saved in my repo), we don't need to touch anything .
Debian 12 is on kernel 6.1. Its probably going to be a long time (if ever) before a new PreemptRT patch is issued. So our commit will stay the same. There is no need for users to then touch any settings. Plus if we want to run on a linuxcnc buildbot, it needs to be hands off..

from rpi-img-builder.

rodw-au avatar rodw-au commented on August 30, 2024

Don't worry about the automated build. It does what I want now.

I will try using stage1 scripts. I finally get the difference in file paths between the stages :)

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

One more question. my stage2 script builds the linuxcnc debs in /tmp and installs them.
How can I save them into the output directory? I thought it was outside of the chroot. That is the most logical place to put them.

Technically, you could copy them out before the img is unmounted using the stage1 script. https://github.com/pyavitz/rpi-img-builder/blob/master/scripts/stage1#L184 The "." being the /root/ of the builder, so cp -fr p2/tmp/*.deb output/${BOARD}/ I thinks should work.
Super generic way to do it.

if [[ `ls p2/tmp/*.deb` ]]; then
	cp -fr p2/tmp/*.deb output/${BOARD}/
	rm -f p2/tmp/*.deb
fi

Is this a Stage 1 function? ref: https://github.com/rodw-au/rpi-img-builder-lcnc/blob/linuxcnc/files/userscripts/uscripts#L10 I build linuxcnc in Stage 2 Should that be built in stage 1 too? Or can this suggested script be moved to stage 2? I'm abit confused about the stages

In an automated build, is there a way to pipe "1" etc into bash to accept your continue/exit menu option?

The ultimate goal is to have a fully automated process. Once we have run menuconfig once and created a custom defconfig (saved in my repo), we don't need to touch anything . Debian 12 is on kernel 6.1. Its probably going to be a long time (if ever) before a new PreemptRT patch is issued. So our commit will stay the same. There is no need for users to then touch any settings. Plus if we want to run on a linuxcnc buildbot, it needs to be hands off..

OK. So you run menuconfig and when done it saves the configs in output/$BOARD and then either continues building the kernel with the new config you made or gives you the option to quit. From that point forward "if you are happy with the defconfig you made" you place either the FULL or MINIMAL defconifg inside the defconfig/ directory.

Now edit the userdata.txt file nano userdata.txt and tell the builder to use the defconfig.

### CUSTOM
CUSTOM_DEFCONFIG="1"
MYCONFIG="bcm2711_defconfig"

NOTICE: The file must end in _defconfig. The kernel doesn't accept bcm2711_defconfig.config or .txt or anything like that. So you can name the file whatever you want linuxcnc_defconfig as long as it ends in _defconfig.

from rpi-img-builder.

pyavitz avatar pyavitz commented on August 30, 2024

As an aside you can also ask questions or report bugs on IRC or Discord.

Libera; #arm-img-builder
https://discord.gg/mypJ7NW8BG

from rpi-img-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.