What's new

amtm amtm - the Asuswrt-Merlin Terminal Menu

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Dumb question, why even when installed sometimes typing amtm does not launch the terminal GUI? but ab-solutionterminalngui does?
I have chosen the name amtm for the reason that at the time I coded it, typing am into the terminal and pressing the TAB key, it would auto-complete to amtm.
In Asuswrt-Merlin 384.x that sadly is no longer the case as there are new binaries that start with the same letter combination:
Code:
user@RT-AC1900P:/tmp/home/root# am
amas_bhctrl      amas_lanctrl     amas_wlcconnect  amtm
So now I'm forced to type amt and press the TAB key to auto-complete.
But I'm glad that this is not the case for AB-Solution, ab and TAB still completes to ab-solution.
ab-solutionterminalngui appears to be such a case with auto-completion on your SM-G935FD keyboard.
 
The parted -l output changes from:
Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 30.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  30.8GB  30.8GB  primary  ext2         lba
to
Code:
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 30.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start  End     Size    Type     File system  Flags
 1      512B   30.7GB  30.7GB  primary  ext2
after:
  1. backing up everything on the flash drive (except the swap file)
  2. deleting the only partition on the flash drive with fdisk
  3. turning off the dos compatibility flag in fdisk
  4. creating a new partition with fdisk to span the entire flash drive
  5. formatting that partition with mk2efs (all on the router)
  6. restoring the contents of the flash drive
The disk check script does now work for me; it reports a clean drive:
Code:
 Thu Mar  8 23:27:36 CET 2018 Starting 'e2fsck -p /dev/sda1'
 usb: clean, 653/1876800 files, 140259/7506371 blocks
Additionally verifying the partition with fdisk does no longer complain (it did with the old table).
 
Additionally verifying the partition with fdisk does no longer complain (it did with the old table).
You tried very hard just to see a simple "clean" without a cheat :)
That tells me this function is worth keeping in amtm. I haven't had the time to look into expanding its capability. And maybe it's not even possible with stock binaries. Let's cross our fingers and hope for the best.
 
I installed amtm the other day (total fresh install on new route) usually install scripts manually,

i didn't install entware/pixelserv-tls myself, i let ab-solution do that, dnscrypt and entware says update, i update them via amtm and all looks ok, exit and re enter amtm for example and says update again. Thank you.
 
Last edited:
i didn't install entware/pixelserv-tls myself, i let ab-solution do that, dnscrypt and entware says update, i update them via amtm and all looks ok, exit and re enter amtm for example and says update again. Thank you.
amtm does not check the installed version of scripts. It merely detects the presence. Seeing the "update" option means the presence of these packages or scripts. If not found, it would present you with an "install" option.
You'll also have noticed that some options are green or red, drawing the color scheme from the installed AB-Solution theme setting. I'll let you figure out what the distinction is.
 
ok, i find it confusing it would show as update maybe im stupid but gives me the impression that it means an update is available. Yeah i know you are the creator of both ab-solution and amtm which are amazing btw :)
 
ok, i find it confusing it would show as update maybe im stupid but gives me the impression that it means an update is available. Yeah i know you are the creator of both ab-solution and amtm which are amazing btw :)
Noted.
 
You tried very hard just to see a simple "clean" without a cheat :)
That tells me this function is worth keeping in amtm. I haven't had the time to look into expanding its capability. And maybe it's not even possible with stock binaries. Let's cross our fingers and hope for the best.

The only solution I can see now will be for the partition type to be specified during the script install process either manually or automatically using the parted binary. Without the device being mounted any entware binaries are useless to work this out on the fly.
 
The only solution I can see now will be for the partition type to be specified during the script install process either manually or automatically using the parted binary. Without the device being mounted any entware binaries are useless to work this out on the fly.
I was thinking about this as well but decided against it. The disk check works for properly formatted devices and that is good enough for me.
 
Every boot I get this error:
Code:
usb was not cleanly unmounted, check forced.

(How) Can I prevent this?

(Preventing the dirty unmount, not just the line in the log...)
 
Every boot I get this error:
Code:
usb was not cleanly unmounted, check forced.

(How) Can I prevent this?

(Preventing the dirty unmount, not just the line in the log...)

What I am finding is if I issue the "reboot" command from a ssh session, I get a clean USB once rebooted. If I use the "Reboot" button in the gui I also get a clean USB. If I simply power off the router and then power back on, The USB is dirty once rebooted.

Hope this helps...
 
What I am finding is if I issue the "reboot" command from a ssh session, I get a clean USB once rebooted. If I use the "Reboot" button in the gui I also get a clean USB. If I simply power off the router and then power back on, The USB is dirty once rebooted.

Hope this helps...
Will experiment later.

Most of my reboots are part of a firmware upgrade...
 
Will experiment later.

Most of my reboots are part of a firmware upgrade...

I see what you mean, anytime I do a firmware update I do not get a clean USB until I finally reboot in one of the ways mentioned above.
 
What I am finding is if I issue the "reboot" command from a ssh session, I get a clean USB once rebooted. If I use the "Reboot" button in the gui I also get a clean USB. If I simply power off the router and then power back on, The USB is dirty once rebooted.

Hope this helps...
I wish this worked for me. I have two USB thumb drives, one for all SNB scripts (amtm, AB-S, Skynet, Entware) and one for backups - NVRAM save/restore (now unused with 384+ code) and /jffs and others from Skynet and AB-S.

Whether using the GUI reboot, SSH reboot, or router power button, my SNB drive is always "not cleanly unmounted" and the backup drive is always clean. I suspect that since it is running jffs scripts is why.

Even during router firmware upgrades when I disable jffs scripts in the GUI, reboot, upgrade, reboot, enable jffs scripts, reboot. I still get the SNB drive "not cleanly unmounted".

edit - (post above while typing this)
Like @XIII most reboots are FW upgrades. I'll try issuing reboots via SSH only next time since Merlin's firmware runs fine for extended periods with no need to reboot. I'm an old school Linux long runtime enthusiast.
 
I wish this worked for me. I have two USB thumb drives, one for all SNB scripts (amtm, AB-S, Skynet, Entware) and one for backups - NVRAM save/restore (now unused with 384+ code) and /jffs and others from Skynet and AB-S.

Whether using the GUI reboot, SSH reboot, or router power button, my SNB drive is always "not cleanly unmounted" and the backup drive is always clean. I suspect that since it is running jffs scripts is why.

Even during router firmware upgrades when I disable jffs scripts in the GUI, reboot, upgrade, reboot, enable jffs scripts, reboot. I still get the SNB drive "not cleanly unmounted".

edit - (post above while typing this)
Like @XIII most reboots are FW upgrades. I'll try issuing reboots via SSH only next time since Merlin's firmware runs fine for extended periods with no need to reboot. I'm an old school Linux long runtime enthusiast.
If you use entware and or a swap file you need to consider these two before the OS calls for them to umount. What I do is ab-solution checks in services-stop if entware is started and shuts it down but you need a swap off command as well or the drive never gets cleanly unmounted.
 
If you use entware and or a swap file you need to consider these two before the OS calls for them to umount. What I do is ab-solution checks in services-stop if entware is started and shuts it down but you need a swap off command as well or the drive never gets cleanly unmounted.
Ah ha! This is why these forums are so helpful, thank you!

I have both Entware and swap (created with Skynet, mandatory with a AC86U).
More searching led me to this post.
https://www.snbforums.com/threads/swap-file-mount-unmount.44425/#post-378494
in this thread
https://www.snbforums.com/threads/swap-file-mount-unmount.44425/

Now I see this in the unmount file.
Code:
#!/bin/sh

awk '/SwapTotal/ {if($2>0) {system("swapoff /opt/swap")} else print "Swap not mounted"}' /proc/meminfo
Seeing my SNB drive "not cleanly unmounted" tells me that does not work. Not sure if I should replace that "swapoff /opt/swap" with
Code:
swapoff /tmp/mnt/SNB/myswap.swp
or add the command after?
 
Ah ha! This is why these forums are so helpful, thank you!

I have both Entware and swap (created with Skynet, mandatory with a AC86U).
More searching led me to this post.
https://www.snbforums.com/threads/swap-file-mount-unmount.44425/#post-378494
in this thread
https://www.snbforums.com/threads/swap-file-mount-unmount.44425/

Now I see this in the unmount file.
Code:
#!/bin/sh

awk '/SwapTotal/ {if($2>0) {system("swapoff /opt/swap")} else print "Swap not mounted"}' /proc/meminfo
Seeing my SNB drive "not cleanly unmounted" tells me that does not work. Not sure if I should replace that "swapoff /opt/swap" with
Code:
swapoff /tmp/mnt/SNB/myswap.swp
or add the command after?
I use your second idea myself.
Code:
swapoff /tmp/mnt/SNB/myswap.swp
 
If you use entware and or a swap file you need to consider these two before the OS calls for them to umount.
Ah, that's not already handled by the scripts?

I'll add turning off swap to the unmount script.

What do I need to for Entware? (which runs Unbound and pixelserv-tls as services on my configuration)
 
Ah, that's not already handled by the scripts?

I'll add turning off swap to the unmount script.

What do I need to for Entware? (which runs Unbound and pixelserv-tls as services on my configuration)
Your services stop should include this:
Code:
# DO NOT EDIT this part of the file #
# generated by AB-Solution 3.11
/opt/etc/init.d/rc.unslung stop
# end of DO NOT EDIT #
 
/jffs/scripts/unmount  # shuts down swap
The unmount script should have this in it.
Code:
#!/bin/sh
#
# /jffs/scripts/unmount
#
# stop entware prior to attempting to unmount the "entware volume"
#

# determine if this is the entware volume by comparing the '/opt' mountpoint to $1
OPT=$(dirname $(readlink /tmp/opt))
if [ "$1" == "$OPT" ] ; then
        # this should be the same code as in 'services-stop', so you could just call services-stop instead
        /opt/etc/init.d/rc.unslung stop
        swapoff /opt/swap
fi


logger "End of unmount"
Disregard the logger code if it's not needed.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top