WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Arch-based extension dir (tce/optional32 + tce/optional64)  (Read 2377 times)

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Arch-based extension dir (tce/optional32 + tce/optional64)
« on: July 05, 2015, 10:10:24 AM »
I am flipping back and forth between architectures quite a bit (i686 and x86_64), so I keep both 32-bit and 64-bit extensions in my tce folder. I have optional32 & optional64, then link one to tce/optional. I was swapping manually, but now I've patched tce-setup to let it update the tce/optional link at boot time based upon the kernel architecture.

If you're going to use this, you'll need to unpack/patch/repack both the 32-bit and 64-bit core.gz. One patch for tce-setup in both architectures.

Patch text (or download attachment):

Code: [Select]
--- /usr/bin/tce-setup
+++ tce-setup
@@ -59,6 +59,15 @@
 }
 
 setupExtnDirs() {
+ # link to repository by architecture
+ if [ -d "$MOUNTPOINT"/"$TCE_DIR"/optional32 ] || [ -d "$MOUNTPOINT"/"$TCE_DIR"/optional64 ]; then
+   if [ "$(uname -m)" = "x86_64" ]; then
+     ARCH=64
+   else ARCH=32
+          fi
  [ -d "$MOUNTPOINT"/"$TCE_DIR"/optional"$ARCH" ] || mkdir -p "$MOUNTPOINT"/"$TCE_DIR"/optional"$ARCH"
  ln -snf optional"$ARCH" "$MOUNTPOINT"/"$TCE_DIR"/optional
+ fi
  [ -d "$MOUNTPOINT"/"$TCE_DIR"/optional ] || mkdir -p "$MOUNTPOINT"/"$TCE_DIR"/optional
  [ -d "$MOUNTPOINT"/"$TCE_DIR"/ondemand ] || mkdir -p "$MOUNTPOINT"/"$TCE_DIR"/ondemand
  touch "$MOUNTPOINT"/"$TCE_DIR"/onboot.lst

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: Arch-based extension dir (tce/optional32 + tce/optional64)
« Reply #1 on: July 05, 2015, 10:24:10 AM »
..or you could create two boot entries, one with tce=tce32 and one with tce=tce64?

Offline dentonlt

  • Sr. Member
  • ****
  • Posts: 318
    • the trombone analog
Re: Arch-based extension dir (tce/optional32 + tce/optional64)
« Reply #2 on: July 05, 2015, 10:48:07 AM »
Bwhahaha! Dammit. I've been using tcz= for years now - it doesn't support the directory change.

Yep, tce=sda1/tce32 and tce=sda1/tce64 work fine. Thanks, Juanito.