NSA-325 - Can archlinuxarm boot from usb stick instead HDD?

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

NSA-325 - Can archlinuxarm boot from usb stick instead HDD?

Postby nickmihai » Sat Jan 15, 2022 8:38 pm

Hello,

Can archlinuxarm boot from usb stick instead left HDD?

I mean to run finally archlinux from USB stick, so to use my 2xHDD to make RAID with mdadm.
I think all I have to do is to replace into usb_key_func.sh.2 (from the "installation" stick) the sda1/2 with sdb1/2 (or sdc I think?) the other USB stick? Hope not to erase the "installation" stick if I mess the dev name.


$this->bbcode_second_pass_code('', '#!/bin/sh

#####
# Created By: Jason Plum <jplum@archlinuxarm.org>
# Prepared for: Arch Linux ARM
# ----------
# Automation to convert NSA-325 to Arch Linux ARM on /dev/sda
# : /dev/sda is sata port 1, left side of enclosure.
#####
echo "Automatic Installation of Arch Linux ARM"

###
# setup u-boot environment
echo "- set bootloader"
fw_setenv arcNumber 4495
fw_setenv mainlineLinux yes
fw_setenv bootargs_stock 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/nfs rw init=/init'
fw_setenv bootargs_linux 'console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/sda2 rw rootwait loglevel=8'
fw_setenv bootcmd_linux 'setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)'
fw_setenv bootcmd_stock 'setenv bootargs $(bootargs_stock); nand read.e $(loadaddr) $(kernel_addr) 0xA00000; bootm $(loadadr)'
fw_setenv to_stock "setenv mainlineLinux no; setenv bootcmd \'run bootcmd_stock\'; saveenv; reset"
fw_setenv to_linux "setenv mainlineLinux yes; setenv bootcmd \'run bootcmd_linux\'; saveenv; reset"

###
# setup the partitions on the disk (sda)
# : 16M 1st partition, ext2/3
echo "- parition sda"
fdisk /dev/sda <<EOF
o
n
p
1

+16M

n
p
2


p
w

EOF
echo " * pause for ioctl to re-sync partitions"
sleep 5
###
# make filesystems
echo "- make filesystems"
# ext2 makes u-boot happy.
mkfs.ext2 -L "boot" /dev/sda1
# stock does not know how to make ext4!
mkfs.ext4 -L "rootfs" /dev/sda2

###
# make dirs & mount
echo "- mount destination"
mkdir -p /tmp/boot
mount -t ext2 /dev/sda1 /tmp/boot
mkdir -p /tmp/rootfs
mount -t ext4 /dev/sda2 /tmp/rootfs

###
# prepare the system
# extract the rootfs
echo "- extract rootfs"
tar xzf /mnt/parnerkey/rootfs.tgz -C /tmp/rootfs/

# copy the uImage to the boot partition
echo "- prepare boot partition"
cp -aR /tmp/rootfs/boot/* /tmp/boot/

# always make sure you're sync'd!
sync

###
# prepare for first boot
# set the bootcmd to run the steps to convert.
fw_setenv bootcmd 'run to_linux'
###
# we're done here
echo "- REBOOTING!"
sync
reboot')
Last edited by moonman on Sun Jan 16, 2022 7:39 pm, edited 1 time in total.
Reason: code tags
nickmihai
 
Posts: 3
Joined: Sat Jan 15, 2022 8:32 pm

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby moonman » Sat Jan 15, 2022 9:13 pm

Yeah it can, but viewtopic.php?f=3&t=15721
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby nickmihai » Sun Jan 16, 2022 7:14 am

Thanks but... This will not help. Any sugestions? :)
nickmihai
 
Posts: 3
Joined: Sat Jan 15, 2022 8:32 pm

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby moonman » Sun Jan 16, 2022 7:28 pm

All I'm saying is armv5 devices are EOL in a couple of weeks so you will spend time getting it to work, and updates will stop.

If you still want to go ahead, If you update U-Boot after the initial install, the newer U-Boot scans for rootfs on USB, and sata drives so it will work automatically. You may be able to get it to work with the version that gets installed initially too, but I'm not familiar with it.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby nickmihai » Sun Jan 16, 2022 8:25 pm

Thanks a lot moonman.

Cheers!
nickmihai
 
Posts: 3
Joined: Sat Jan 15, 2022 8:32 pm

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby technosf » Mon Jan 17, 2022 5:08 am

$this->bbcode_second_pass_quote('', 'A')ll I'm saying is armv5 devices are EOL in a couple of weeks so you will spend time getting it to work, and updates will stop.


I've been thinking about if, say, a expressobin can be swapped into the NSA-325 chassis (as the chasis is pretty much useless now) and the SATA extension boards hooked up :)
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 130
Joined: Sat Jan 08, 2011 10:54 pm

Re: NSA-325 - Can archlinuxarm boot from usb stick instead H

Postby moonman » Tue Jan 18, 2022 6:12 am

$this->bbcode_second_pass_quote('technosf', 'I')'ve been thinking about if, say, a expressobin can be swapped into the NSA-325 chassis (as the chasis is pretty much useless now) and the SATA extension boards hooked up :)


That works if you are looking for a little fun project. Otherwise I wouldn't say it's dead. You can still use Debian or OpenWRT on these devices. armv5 has been progressively becoming slower with newer toolchain, and those distros are still using older toolchains so shouldn't have any issues for the next couple of years (hopefully).
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 6 guests