add Fedora rootfs installer and first-boot user setup - #56
Conversation
4317143 to
2a559ed
Compare
| echo "Configuring network..." | ||
| ip link set eth0 up | ||
| udhcpc -i eth0 -n -q |
There was a problem hiding this comment.
Since I just discovered https://github.com/analogdevicesinc/br2-external/pull/56/changes#r3715363851
We should be handling both PHYs. Because its not going to work if I use eth1, the other port on the carrier.
Its not in the scope of this PR, so I will open an issue then we can fix it there.
Edit: Actually its in the scope of this PR, since hardcoding end0 can be also problematic. We should detect the links instead of hardcoding the port.
There was a problem hiding this comment.
Keep it simple. We'll eventually move to Systemd as init.
There was a problem hiding this comment.
@pamolloy do you want me to revert the current changes I did about it?
LLM reviewThis series extends the ev-sc598-som bootstrap installer to also flash a run: 30948455226
|
550096a to
dce81c6
Compare
|
In 924608e I replaced all exit calls in the bootstrap init with a rescue_shell() helper that execs /bin/sh. The reason is that init runs as PID 1 in the initramfs, and if PID 1 exits the kernel panics immediately with no useful output. The helper prints what went wrong and tells the user they can run reboot -f or /init to restart the installer and then hands off to a shell. |
A rescue shell sounds great. It is a very common concept from Linux distros, often implemented in the initramfs. In fact you could even give the user the option to switch into the shell at anytime, but don't worry about that for now. |
pamolloy
left a comment
There was a problem hiding this comment.
With the clarification on "eMMC image only" vs. "eMMC image + Fedora rootfs"
After writing U-Boot to SPI flash, prompt for what to install: eMMC image only, eMMC image with Fedora rootfs, or skip. Entering a PC IP address downloads emmc.img.gz and optionally adsp-sc598-rootfs.tar.zst sequentially. The rootfs is extracted to /dev/mmcblk0p2 formatted as ext4. Leaving the IP field empty aborts the install. Network setup iterates all available interfaces and runs udhcpc on each with a 3-second timeout until one gets a lease, supporting both PHYs on the SC598 carrier without hardcoding an interface name. After writing the eMMC image, blockdev --rereadpt forces the kernel to pick up the new partition table immediately before formatting. Enable CONFIG_BLOCKDEV in a bootstrap-specific busybox fragment so the applet is available in the initramfs without affecting other builds. Add BR2_PACKAGE_E2FSPROGS and BR2_PACKAGE_ZSTD to bootstrap.fragment so mkfs.ext4 and zstd are available in the bootstrap initramfs. Signed-off-by: Kateryna Tsaruk <kateryna.tsaruk@analog.com>
Add packages for non-root user management (shadow-utils, passwd, sudo, cracklib-dicts) and general usability (dnf, iputils). On first boot a systemd oneshot service claims /dev/ttySC0 exclusively and prompts for a username and password, creating the user with wheel group membership. systemd-firstboot and the getty generator are masked so nothing else competes for the serial console during setup. IP detection in firstboot-user.sh scans all interfaces instead of hardcoding a name, consistent with how the NM dispatcher script already handles it. A NetworkManager dispatcher script writes the board IP to /etc/issue on each DHCP lease so it is visible at the login prompt. Signed-off-by: Kateryna Tsaruk <kateryna.tsaruk@analog.com>
PID 1 cannot exit — doing so causes a kernel panic. Replace all exit/abort paths with a rescue_shell() helper that prints context (what failed or was skipped) and instructions (reboot -f or /init to restart), then execs /bin/sh so the process stays alive. Signed-off-by: Kateryna Tsaruk <kateryna.tsaruk@analog.com>
924608e to
822a5a2
Compare
Closes #52