Automated ARM installs on Raspberry Pi 2

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
User avatar
maximus
Posts: 141
Joined: 2. Sep 2009, 01:41

Automated ARM installs on Raspberry Pi 2

Post by maximus »

Hi!

I've been playing with a couple raspberry pi 2's, on which I've installed slackwarearm-current following the guide at http://rpi2.fatdog.eu/. I really like them, much more usable than the older B+ model with another 3 cores and 1GB ram.

To automate the process and approximate a Salix 'core' install (which saves a lot of time in comparison to a full slackware installation), I manually created custom tagfiles which match the core package set as closely as possible (setting those packages listed in the 'core' folder of the iso with the ":ADD" tag, and everything else with ":SKP"). This works fairly well, and the goodies such as salixtools are easy enough to install manually after completion.

Now, I'd like to try approximating a 'basic' install in the same way. However, I've found that manually editing the tagfiles is not something I enjoy doing, as well as the fact that there are quite a few extra packages in 'basic' it would take a lot longer in any case, not forgetting that slackware-current is a moving target, with packages potentially being added/removed over time. So, I spent last night working on some bash commands to help automate the process:

Code: Select all

#Mount a salix iso
mkdir salix64
sudo mount -o loop salix64-xfce-14.1.iso salix64

#List packages in core and basic and write to a file
ls salix64/salix/{basic,core} | grep txz | sort -d > basic-install.txt

#Strip everything but the package names from basic-install.txt
#(there must be an easier way to do this, but it works)
sed -i 's/-[^-]*$//' basic-install.txt 
sed -i 's/-[^-]*$//' basic-install.txt 
sed -i 's/-[^-]*$//' basic-install.txt

#Retrieve the necessary directories and tagfiles from a mirror
mkdir -p slackwarearm-currrent/slackware
rsync -rav --include=*/ --include=tagfile --exclude=* ftp.arm.slackware.com::slackwarearm/slackwarearm-current/slackware/ slackwarearm-current/slackware/

#Remove all ADD/REC/OPT tags from tagfiles, and add the :SKP
#flag to every line
for i in `find slackwarearm-current/slackware/ -type f`; do 
sed -i 's/:[^:]*$/:SKP/' $i ; done

#To make the lines in basic-install.txt match what is now in
#the tagfiles, we add :SKP to every line
sed -i "s/$/:SKP/" basic-install.txt

#Now we can match all lines between the tagfiles and 
#basic-install.txt, and set the :ADD flag to those lines
for file in `find slackwarearm-current/slackware/ -type f`; do 
for i in `grep -x -f 'basic-install.txt' $file | tr -d ":SKP"`; do 
sed -i "s/${i}:[^:]*$/${i}:ADD/" $file; 
done; 
done
Now I'm left with tagfiles in the correct directory structure, the contents of which add everything that matches the Salix 'basic' package set, while skipping everything else = "Salixified" automated install. Sort of.

There may be plenty of problems with this approach that I'm not aware of (feel free to share ideas/opinions!), but from what I can see the only problem I have now is if there are entries in basic-install.txt that do not match any entries in the tagfiles, and I haven't found a way to list these entries in an automated fashion via the CLI. Maybe I'm having a mental block from staring at this for so long, or maybe I'm just out of my depth. Well, actually I am :? Can anyone suggest a way to do this?

Thanks in advance :)
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Automated ARM installs on Raspberry Pi 2

Post by gapan »

maximus wrote:

Code: Select all

ls salix64/salix/{basic,core} | grep txz | sort -d > basic-install.txt
You might want to make that:

Code: Select all

grep t[xg]z
There are a few tgz packages as well...
maximus wrote:

Code: Select all

#Strip everything but the package names from basic-install.txt
#(there must be an easier way to do this, but it works)
sed -i 's/-[^-]*$//' basic-install.txt 
sed -i 's/-[^-]*$//' basic-install.txt 
sed -i 's/-[^-]*$//' basic-install.txt
Well, this works too:

Code: Select all

sed "s/\(.*\)-.*-.*-.*/\1/"
maximus wrote:There may be plenty of problems with this approach that I'm not aware of (feel free to share ideas/opinions!)
You can probably use the *settings* packages as well, so configuration will match that of Salix. We also have a slackwarearm repo that includes dependency information:
http://download.salixos.org/arm/slackwarearm-14.1/
(should also be in every other mirror too). If you compile slapt-get using the respective SLKBUILD (the slkbuild package is noarch, so you can use that too), you should be able to use it just fine.
maximus wrote:but from what I can see the only problem I have now is if there are entries in basic-install.txt that do not match any entries in the tagfiles, and I haven't found a way to list these entries in an automated fashion via the CLI. Maybe I'm having a mental block from staring at this for so long, or maybe I'm just out of my depth. Well, actually I am :? Can anyone suggest a way to do this?
Can you give an example?
Image
Image
User avatar
maximus
Posts: 141
Joined: 2. Sep 2009, 01:41

Re: Automated ARM installs on Raspberry Pi 2

Post by maximus »

Thanks for the tips!
gapan wrote: You can probably use the *settings* packages as well, so configuration will match that of Salix. We also have a slackwarearm repo that includes dependency information:
http://download.salixos.org/arm/slackwarearm-14.1/
(should also be in every other mirror too). If you compile slapt-get using the respective SLKBUILD (the slkbuild package is noarch, so you can use that too), you should be able to use it just fine.
I have an earlier B+ Pi (single core, 512MB ram) that is running 14.1, installed following the 'core' package set that follows this approach. I compiled slapt-get, spkg, fakeroot and some others, installed slkbuild etc. Everything works just fine. WIth the Pi 2 however, the installation guide I followed stated that installing slackware-current was necessary:
http://rpi2.fatdog.eu/index.php?p=getslack wrote: To successfully install Slackware ARM on a Raspberry Pi 2 you need to download the current version of the software. Slackware ARM current contains updated files and packages which are required by the system to function properly. So when you are downloading the Slackware source make sure it is Sackware ARM current.
.

Which means I can't use slapt-get. It doesn't mention what updated files/packages are needed or why it needs them. Personally I don't see why installing 14.1 shouldn't work so long as I use their updated installer, and their newer RPi2 kernel, but what do I know?! I'll give it a go and see.
maximus wrote:but from what I can see the only problem I have now is if there are entries in basic-install.txt that do not match any entries in the tagfiles, and I haven't found a way to list these entries in an automated fashion via the CLI. Maybe I'm having a mental block from staring at this for so long, or maybe I'm just out of my depth. Well, actually I am :? Can anyone suggest a way to do this?
Can you give an example?
Well, after thinking for a bit longer, I figured that any package on the iso that has your "gv" extension is either modified from the slackware package or not available at all on the slackware repo. "ntp" is one such package, although using the procedure detailed above the default slackware package would be installed in any case. The rest would all be Salix specific packages (spkg, spi etc) which certainly aren't available on the Slackware repos, and would need to be installed after the fact anyway, so I guess this isn't really as big a problem as I originally thought. As long as it boots, I guess anything else can be fixed later.
User avatar
maximus
Posts: 141
Joined: 2. Sep 2009, 01:41

Re: Automated ARM installs on Raspberry Pi 2

Post by maximus »

maximus wrote:Personally I don't see why installing 14.1 shouldn't work so long as I use their updated installer, and their newer RPi2 kernel, but what do I know?! I'll give it a go and see.
After performing the previous operations with 14.1 instead of 'current', it boots... network didn't come up after installation because "eth0" became "eth1" for some reason. I haven't had this problem with slackwarearm-current, so I guess there is some missing file/something else that is there in current. Regardless, after editing /etc/rc.d/rc.inet1.conf to reflect eth1 instead of eth0 and restarting rc.inet1 the network works.

Other than that, I needed to install xf86-video-fbdev and libSM, haven't researched why these were missed yet but after installing those I was able to startx and run xfce.
User avatar
gapan
Salix Wizard
Posts: 6361
Joined: 6. Jun 2009, 17:40

Re: Automated ARM installs on Raspberry Pi 2

Post by gapan »

maximus wrote:After performing the previous operations with 14.1 instead of 'current', it boots... network didn't come up after installation because "eth0" became "eth1" for some reason. I haven't had this problem with slackwarearm-current, so I guess there is some missing file/something else that is there in current. Regardless, after editing /etc/rc.d/rc.inet1.conf to reflect eth1 instead of eth0 and restarting rc.inet1 the network works.
That may be due to slight changes in udev. I've seen it with other PCs as well, where the ethernet interface would switch from eth0 to eth1 and then back again after reboots. You could make it permament by adding a udev rule. But if yours stays at eth1, you've already fixed it.
Image
Image
User avatar
maximus
Posts: 141
Joined: 2. Sep 2009, 01:41

Re: Automated ARM installs on Raspberry Pi 2

Post by maximus »

gapan wrote:You could make it permament by adding a udev rule.
Indeed there is already a rule ( /etc/udev/rules.d/70-persistent-net.rules ) which specifies NAME="eth1". So that explains it!

So far so good, hopefully there won't be any nasty surprises as current is a bit of a pain to keep up with.
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: Automated ARM installs on Raspberry Pi 2

Post by laprjns »

maximus wrote: It doesn't mention what updated files/packages are needed or why it needs them. Personally I don't see why installing 14.1 shouldn't work so long as I use their updated installer, and their newer RPi2 kernel, but what do I know?! I'll give it a go and see.
I talked with Exaga (he is the developer of the Slackware Arm installations instructions on fatdog) on the slackwarearm irc channel and he said that "what it says on the fatdog site is incorrect now" Basically when he first tried 14.1 it crached and he didn't pursue it but rather moved on to current. The problem was with the fatdog installer, not 14.1 itself. He going to rewrite that section of the instruction since he now says that it is misleading.
maximus wrote:... network didn't come up after installation because "eth0" became "eth1" for some reason. I haven't had this problem with slackwarearm-current, so I guess there is some missing file/something else that is there in current. Regardless, after editing /etc/rc.d/rc.inet1.conf to reflect eth1 instead of eth0 and restarting rc.inet1 the network works.
I've seen this problem on occasion also. The rule in /etc/udev/rules.d/ get automatically generated by the udev system at startup if it not there already. Simply deleting the rule usually corrects the problem and on next boot it gets set again with the network interface assign as eth0/
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
User avatar
maximus
Posts: 141
Joined: 2. Sep 2009, 01:41

Re: Automated ARM installs on Raspberry Pi 2

Post by maximus »

laprjns wrote:The problem was with the fatdog installer, not 14.1 itself.
Ah, OK. That's good to know. Thanks!
User avatar
laprjns
Salix Warrior
Posts: 1113
Joined: 28. Aug 2009, 01:30
Location: Connecticut USA

Re: Automated ARM installs on Raspberry Pi 2

Post by laprjns »

Fatdog instructions have been change to include 14.1 now.
http://rpi2.fatdog.eu/index.php?p=getslack
“The past was erased, the erasure was forgotten, the lie became the truth.”
― George Orwell, 1984
Post Reply