OpenWRT and Solaris: Difference between pages

From Smithnet Wiki
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
== Regulatory Domains ==
== Installation ==


iw reg set GB
* [https://blogs.oracle.com/solaris/post/announcing-the-first-oracle-solaris-114-cbe Oracle CBE] (Common Build Environmnet) : Not for production
iw reg get
* SRU (Support Repository Update) for production


Regulatory domains defined in:
CBE does not install a desktop. To do this after a text install, change the repository location:
  /lib/firmware/regulatory.db
  pkg set-publisher -G'*' -g http://pkg.oracle.com/solaris/release/ solaris


* [https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git Regulatory Database Github]
Check the online package, then install:
pkg info -r solaris-desktop
pkg install solaris-desktop


See [https://openwrt.org/docs/guide-user/network/wifi/wifi_countrycode here] for explanation of format.
=== VirtualBox ===


To build:
pkg install runtime/python-39
* Install: python-m2crypro
pkgadd -d VirtualBox-7.0.8-SunOS-amd64-r156879.pkg
* Edit db.txt as required
* python db2bin.py regulatory.db db.txt


== Channels ==
== General ==


Taken from output of:
* [https://blogs.oracle.com/solaris/ Oracle Solaris Blog]
iw list


=== 2.4 GHz ===
=== Booting: x86 ===


CA
Into single-user mode:
* '''2412 MHz [1] (30.0 dBm)'''
* In grub menu, edit entry
* 2417 MHz [2] (30.0 dBm)
* On $multiboot line, add "-s" to end
* 2422 MHz [3] (30.0 dBm)
* CTRL-X to boot
* 2427 MHz [4] (30.0 dBm)
* 2432 MHz [5] (30.0 dBm)
* 2437 MHz [6] (30.0 dBm)
* 2442 MHz [7] (30.0 dBm)
* 2447 MHz [8] (30.0 dBm)
* 2452 MHz [9] (30.0 dBm)
* 2457 MHz [10] (30.0 dBm)
* 2462 MHz [11] (30.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)


IN, SA
Show Grub boot options:
* 2412 MHz [1] (20.0 dBm)
bootadm list-menu
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* 2462 MHz [11] (20.0 dBm)
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (disabled)


TW
Set default menu option to second one:
* 2412 MHz [1] (24.0 dBm)
bootadm set-menu default=1
* 2417 MHz [2] (24.0 dBm)
* 2422 MHz [3] (24.0 dBm)
* 2427 MHz [4] (24.0 dBm)
* 2432 MHz [5] (24.0 dBm)
* 2437 MHz [6] (24.0 dBm)
* 2442 MHz [7] (24.0 dBm)
* 2447 MHz [8] (24.0 dBm)
* 2452 MHz [9] (24.0 dBm)
* 2457 MHz [10] (24.0 dBm)
* 2462 MHz [11] (24.0 dBm)
* 2467 MHz [12] (disabled)
* 2472 MHz [13] (disabled)
* 2484 MHz [14] (disabled)


UK
Set the timeout:
* 2412 MHz [1] (20.0 dBm)
bootadm set-menu timeout=10
* 2417 MHz [2] (20.0 dBm)
* 2422 MHz [3] (20.0 dBm)
* 2427 MHz [4] (20.0 dBm)
* 2432 MHz [5] (20.0 dBm)
* 2437 MHz [6] (20.0 dBm)
* 2442 MHz [7] (20.0 dBm)
* 2447 MHz [8] (20.0 dBm)
* 2452 MHz [9] (20.0 dBm)
* 2457 MHz [10] (20.0 dBm)
* '''2462 MHz [11] (20.0 dBm)'''
* 2467 MHz [12] (20.0 dBm)
* 2472 MHz [13] (20.0 dBm)
* 2484 MHz [14] (disabled)


=== 5 GHz ===
=== Booting: OpenBoot ===


CA
* ok> prompt: STOP-A or BRK
* 5180 MHz [36] (23.0 dBm)
banner
* 5200 MHz [40] (23.0 dBm)
reset-all
* 5220 MHz [44] (23.0 dBm)
probe-ide
* 5240 MHz [48] (23.0 dBm)
probe-scsi
* 5260 MHz [52] (24.0 dBm) (radar detection)
devaliases
* 5280 MHz [56] (24.0 dBm) (radar detection)
printenv boot-device
* 5300 MHz [60] (24.0 dBm) (radar detection)
setenv boot-device disk
* 5320 MHz [64] (24.0 dBm) (radar detection)
reset
* 5500 MHz [100] (24.0 dBm) (radar detection)
* 5520 MHz [104] (24.0 dBm) (radar detection)
* 5540 MHz [108] (24.0 dBm) (radar detection)
* 5560 MHz [112] (24.0 dBm) (radar detection)
* 5580 MHz [116] (24.0 dBm) (radar detection)
* 5600 MHz [120] (disabled)
* 5620 MHz [124] (disabled)
* 5640 MHz [128] (disabled)
* 5660 MHz [132] (24.0 dBm) (radar detection)
* 5680 MHz [136] (24.0 dBm) (radar detection)
* 5700 MHz [140] (24.0 dBm) (radar detection)
* 5720 MHz [144] (24.0 dBm) (radar detection)
* 5745 MHz [149] (30.0 dBm)
* 5765 MHz [153] (30.0 dBm)
* 5785 MHz [157] (30.0 dBm)
* 5805 MHz [161] (30.0 dBm)
* 5825 MHz [165] (30.0 dBm)
* 5845 MHz [169] (disabled)
* 5865 MHz [173] (disabled)


IN
=== Package Management ===
* 5180 MHz [36] (30.0 dBm)
* 5200 MHz [40] (30.0 dBm)
* 5220 MHz [44] (30.0 dBm)
* 5240 MHz [48] (30.0 dBm)
* 5260 MHz [52] (24.0 dBm)
* 5280 MHz [56] (24.0 dBm)
* 5300 MHz [60] (24.0 dBm)
* 5320 MHz [64] (24.0 dBm)
* 5500 MHz [100] (24.0 dBm)
* 5520 MHz [104] (24.0 dBm)
* 5540 MHz [108] (24.0 dBm)
* 5560 MHz [112] (24.0 dBm)
* 5580 MHz [116] (24.0 dBm)
* 5600 MHz [120] (24.0 dBm)
* 5620 MHz [124] (24.0 dBm)
* 5640 MHz [128] (24.0 dBm)
* 5660 MHz [132] (24.0 dBm)
* 5680 MHz [136] (24.0 dBm)
* 5700 MHz [140] (24.0 dBm)
* 5720 MHz [144] (24.0 dBm)
* 5745 MHz [149] (30.0 dBm)
* 5765 MHz [153] (30.0 dBm)
* 5785 MHz [157] (30.0 dBm)
* 5805 MHz [161] (30.0 dBm)
* 5825 MHz [165] (30.0 dBm)
* 5845 MHz [169] (30.0 dBm)
* 5865 MHz [173] (30.0 dBm)


SA
Show package publisher:
* 5180 MHz [36] (20.0 dBm)
pkg publisher
* 5200 MHz [40] (20.0 dBm)
* 5220 MHz [44] (20.0 dBm)
* 5240 MHz [48] (20.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (27.0 dBm) (radar detection)
* 5520 MHz [104] (27.0 dBm) (radar detection)
* 5540 MHz [108] (27.0 dBm) (radar detection)
* 5560 MHz [112] (27.0 dBm) (radar detection)
* 5580 MHz [116] (27.0 dBm) (radar detection)
* 5600 MHz [120] (27.0 dBm) (radar detection)
* 5620 MHz [124] (27.0 dBm) (radar detection)
* 5640 MHz [128] (27.0 dBm) (radar detection)
* 5660 MHz [132] (27.0 dBm) (radar detection)
* 5680 MHz [136] (27.0 dBm) (radar detection)
* 5700 MHz [140] (27.0 dBm) (radar detection)
* 5720 MHz [144] (disabled)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)
* 5845 MHz [169] (disabled)
* 5865 MHz [173] (disabled)


TW
Show us only the packages for which newer versions are available:
* 5180 MHz [36] (23.0 dBm)
pkg info -u
* 5200 MHz [40] (23.0 dBm)
* 5220 MHz [44] (23.0 dBm)
* 5240 MHz [48] (23.0 dBm)
* 5260 MHz [52] (23.0 dBm) (radar detection)
* 5280 MHz [56] (23.0 dBm) (radar detection)
* 5300 MHz [60] (23.0 dBm) (radar detection)
* 5320 MHz [64] (23.0 dBm) (radar detection)
* 5500 MHz [100] (23.0 dBm) (radar detection)
* 5520 MHz [104] (23.0 dBm) (radar detection)
* 5540 MHz [108] (23.0 dBm) (radar detection)
* 5560 MHz [112] (23.0 dBm) (radar detection)
* 5580 MHz [116] (23.0 dBm) (radar detection)
* 5600 MHz [120] (23.0 dBm) (radar detection)
* 5620 MHz [124] (23.0 dBm) (radar detection)
* 5640 MHz [128] (23.0 dBm) (radar detection)
* 5660 MHz [132] (23.0 dBm) (radar detection)
* 5680 MHz [136] (23.0 dBm) (radar detection)
* 5700 MHz [140] (23.0 dBm) (radar detection)
* 5720 MHz [144] (23.0 dBm) (radar detection)
* 5745 MHz [149] (30.0 dBm)
* 5765 MHz [153] (30.0 dBm)
* 5785 MHz [157] (30.0 dBm)
* 5805 MHz [161] (30.0 dBm)
* 5825 MHz [165] (30.0 dBm)
* 5845 MHz [169] (disabled)
* 5865 MHz [173] (disabled)


UK
Update:
* 5180 MHz [36] (23.0 dBm)
pkg update
* 5200 MHz [40] (23.0 dBm)
* 5220 MHz [44] (23.0 dBm)
* 5240 MHz [48] (23.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (26.0 dBm) (radar detection)
* 5520 MHz [104] (26.0 dBm) (radar detection)
* 5540 MHz [108] (26.0 dBm) (radar detection)
* 5560 MHz [112] (26.0 dBm) (radar detection)
* 5580 MHz [116] (26.0 dBm) (radar detection)
* 5600 MHz [120] (26.0 dBm) (radar detection)
* 5620 MHz [124] (26.0 dBm) (radar detection)
* 5640 MHz [128] (26.0 dBm) (radar detection)
* 5660 MHz [132] (26.0 dBm) (radar detection)
* 5680 MHz [136] (26.0 dBm) (radar detection)
* 5700 MHz [140] (26.0 dBm) (radar detection)
* 5720 MHz [144] (26.0 dBm) (radar detection)
* 5745 MHz [149] (20.0 dBm) (radar detection)
* 5765 MHz [153] (20.0 dBm) (radar detection)
* 5785 MHz [157] (20.0 dBm) (radar detection)
* 5805 MHz [161] (20.0 dBm) (radar detection)
* 5825 MHz [165] (20.0 dBm) (radar detection)
* 5845 MHz [169] (20.0 dBm) (radar detection)
* 5865 MHz [173] (20.0 dBm) (radar detection)


ZA
Show SRU installed (look at Branch and Packaging Date):
* 5180 MHz [36] (20.0 dBm)
pkg info entire
* 5200 MHz [40] (20.0 dBm)
* 5220 MHz [44] (20.0 dBm)
* 5240 MHz [48] (20.0 dBm)
* 5260 MHz [52] (20.0 dBm) (radar detection)
* 5280 MHz [56] (20.0 dBm) (radar detection)
* 5300 MHz [60] (20.0 dBm) (radar detection)
* 5320 MHz [64] (20.0 dBm) (radar detection)
* 5500 MHz [100] (30.0 dBm)
* 5520 MHz [104] (30.0 dBm)
* 5540 MHz [108] (30.0 dBm)
* 5560 MHz [112] (30.0 dBm)
* '''5580 MHz [116] (30.0 dBm)'''
* 5600 MHz [120] (30.0 dBm)
* 5620 MHz [124] (30.0 dBm)
* 5640 MHz [128] (30.0 dBm)
* 5660 MHz [132] (30.0 dBm)
* 5680 MHz [136] (30.0 dBm)
* 5700 MHz [140] (30.0 dBm)
* 5720 MHz [144] (disabled)
* 5745 MHz [149] (disabled)
* 5765 MHz [153] (disabled)
* 5785 MHz [157] (disabled)
* 5805 MHz [161] (disabled)
* 5825 MHz [165] (disabled)
* 5845 MHz [169] (disabled)
* 5865 MHz [173] (disabled)


== Devices ==
Search for a package matching "ucb":
# pkg search ucb
INDEX      ACTION VALUE                                  PACKAGE
basename  file  usr/share/groff/1.22.3/font/devlj4/UCB pkg:/text/groff@1.22.3-11.4.0.0.1.14.0
basename  dir    usr/ucb                                pkg:/legacy/compatibility/ucb@11.4-11.4.0.0.1.15.0
pkg.fmri  set    solaris/compatibility/ucb              pkg:/compatibility/ucb@11.4-11.4.0.0.0.11.0
pkg.fmri  set    solaris/legacy/compatibility/ucb      pkg:/legacy/compatibility/ucb@11.4-11.4.0.0.1.15.0
# pkg install pkg:/compatibility/ucb@11.4-11.4.0.0.0.11.0


=== TP-Link Archer C2600 ===
=== Services ===


* [https://openwrt.org/toh/tp-link/archer_c2600_v1 Device page]
List all enabled services (-a also shows disabled):
* 1.4 GHz CPU, 32 MiB flash, 512 MiB RAM
svcs
* Currently Installed: 23.05.3


=== TP-Link Archer C7 v4 ===
Show long list about one service:
<pre>
# svcs -l apache24
fmri        svc:/network/http:apache24
name        Apache 2.4 HTTP server
enabled      true
state        online
next_state  none
state_time  Mon Nov 12 16:22:58 2018
logfile      /var/svc/log/network-http:apache24.log
restarter    svc:/system/svc/restarter:default
contract_id  2017
manifest    /lib/svc/manifest/network/http-apache24.xml
dependency  optional_all/error svc:/system/filesystem/autofs:default (online)
dependency  require_all/none svc:/system/filesystem/local:default (online)
dependency  require_all/error svc:/milestone/network:default (online)
</pre>


* [https://openwrt.org/toh/tp-link/archer_c7 Device page]
Enable a service:
* 775 MHz CPU, 16 MiB flash, 128 MiB RAM
svcadm enable apache24
* Currently Installed: 23.05.3


=== HooToo TripMate Nano (HT-TM02) ===
=== User Management ===


* [https://openwrt.org/toh/hootoo/tripmate-nano Device page]
To give user ability to su to root:
* 360 MHz CPU, 8 MiB flash, 32 MiB RAM
* /etc/user_attr.d/local-entries
* Currently Installed: 19.07.10
* Initial installation [https://forum.archive.openwrt.org/viewtopic.php?id=53014 here]
* Can remove kernel PPP packages


==== Mode on Startup ====
To show status and unlock:
passwd -s
passwd -u someuser


Read status of buttons:
To stop account lockout:
usermod -K lock_after_retries=no someuser


root@wifi-ht:~# cat /sys/kernel/debug/gpio
== iSCSI initiator (Static) ==
  gpiochip0: GPIOs 0-21, parent: platform/10000600.gpio, 10000600.gpio:
  gpio-7  (                   |ht-tm02:blue:wlan  ) out lo   
  gpio-10  (                    |reset              ) in  hi   
  gpio-12  (                    |ht-tm02:green:lan  ) out lo   
  gpio-14  (                    |modeswitch          ) in  lo   
root@wifi-ht:~#


For modeswitch, "lo" is Wired, "hi" is WiFi position.
Check initiator service is up:
svcs network/iscsi/initiator


Could also use [https://github.com/jefferyto/openwrt-slide-switch slide-switch] package. Biggest advantage of this is that it triggers at boot time, not just a switch change.
Add IP of storage system (use default port 3260):
opkg install slide-switch
iscsiadm add static-config iqn.2000-01.com.example:initiator01, 192.0.2.2:3260


On startup On mode (button) change, copy files from /etc/config/config-wired or config-wireless to /etc/config with:
Check targets:
* etc/rc.d/S15config-mode -> /etc/config/config-mode
iscsiadm list static-config


  #!/bin/sh
CHAPS enable:
  #
  iscsiadm modify initiator-node --authentication CHAP
  # Set mode according to slide switch
 
#
Set user, and secret (password):
  iscsiadm modify initiator-node --CHAP-name someuser
  iscsiadm modify initiator-node --CHAP-secret
  Enter CHAP secret: ************
  Re-enter secret: ************
   
   
CONFIG=/etc/config
state=$(grep modeswitch /sys/kernel/debug/gpio | sed 's/.*\(lo\|hi\).*/\1/')
case "$state" in
        lo)
                mode="wired"
                ;;
        hi)
                mode="wireless"
                ;;
        *)
                echo "unknown"
                return 1
                ;;
esac
message="Using config mode: $mode"
echo $message
logger $message
config="$CONFIG/config-$mode"
for file in $(ls $config)
do
        echo $file
        cp "$config/$file" $CONFIG
done


== Package Management ==
Enable:
iscsiadm modify discovery --static enable
 
Show initiator status:
iscsiadm list initiator-node
iscsiadm list target
iscsiadm list target-param -v
 
Show iSCSI disks:
iscsiadm list target -S | grep "OS Device Name"
 
 
See also: [https://docs.oracle.com/cd/E53394_01/html/E54792/iscsi-1.html#scrolltoc Oracle Docs]
 
== Kerberos ==
 
Client: kclient
 
== Networking ==
 
[https://www.oracle.com/technetwork/articles/servers-storage-admin/s11-network-config-1632927.html networking]
 
Check status:
dladm show-link
 
Show hostname:
svccfg -s system/identity:node listprop config
 
Set hostname:
svccfg -s system/identity:node setprop config/nodename="my-sol-host"
svccfg -s system/identity:node setprop config/loopback="localhost
 
== NTP ==
 
Client:
cd /etc/inet; cp ntp.client > ntp.conf
 
(edit file)
 
svcadm enable ntp
svcadm start ntp
 
== Reset root password ==
 
* Boot from CD
* Select option 3: Shell
 
Check availability of rpool (none expected):
zpool list
 
Import rpool:
zpool import -f -R /a rpool
 
df -h should show some filesystems under /a
 
Show zfs filesystems, check for root/ROOT/...
zfs list
 
Set mount point for root filesystem:
zfs set mountpoint=/mnt_tmp rpool/ROOT/11.4-11.4.31.0.1.88.5
 
Check new entry under /mnt/tmp has been added:
zfs list
 
Mount filesystem:
zfs mount rpool/ROOT/11.4-11.4.31.0.1.88.5
 
Remove password hash from /a/mnt_tmp/etc/shadow


opkg update
Reset mount point:
  opkg list
  zfs umount rpool/ROOT/11.4-11.4.31.0.1.88.5
  opkg list-installed
  zfs set mountpoint=/ rpool/ROOT/11.4-11.4.31.0.1.88.5
opkg install blah
  zpool export rpool
  opkg remove blah


=== Useful Additional Packages ===
* Reboot server
* edit grub menu ("e")
* on line starting $multiboot, append "-s" option for single-user mode
* enter "root" and once in shell, change root password
* reboot


* ?
== Resource Pools ==


== Reset ==
Disks can be listed and formatted with:
format


* Controlled by /etc/rc.button/reset
Will show at least the root pool (rpool):
* Quick press of reset button reboots
zpool list
* Failsafe (long press) forces network to:
zpool status
** 192.168.1.1 / 255.255.255.0
** SSH open with root / no password
** "firstboot" command to revert to factory defaults
** Hard factory reset (to 192.168.1.1.): umount /overlay && jffs2reset && reboot now
** "mount_root" to mount root partition


== Configuration and Commands ==
Show zfs file systems:
zfs list


=== Misc ===
Create a new pool from one device (file, or disk device):
zpool create pool1 /root/disk1
zpool list pool1
zfs list pool1


* [https://busybox.net/downloads/BusyBox.html Busybox]
Add a second disk, and zfs capacity expands automatically:
* [https://openwrt.org/docs/guide-user/base-system/uci UCI Configuration System]
zpool add pool1 /root/disk2
* Show logging: logread -f
* wifi up


In /etc/config:
Remove a pool:
* wireless
zpool destroy pool1
* dhcp
* system
* network
* firewall


Custom startup scripts:
Create a mirror:
* /etc/rc.local
zpool create pool1 mirror /root/disk1 /root/disk2


In /etc:
Check for errors:
* sysupgrade.conf
zpool scrub pool1


=== DHCP ===
Remove a disk:
zpool detatch pool1 /root/disk1


Custom options may be given per network, eg: for NTP:
Add a new disk ("silver" the mirror disk2 > 1):
* 42, 192.168.1.1
zpool attach pool1 /root/disk2 /root/disk1


=== DNS ===
Make a bigger RAID:
zpool create pool1 raidz /root/disk1 /root/disk2 /root/disk3 /root/disk4


* resolv.conf symlinked to /tmp/resolv.conf which points to local dnsmasq service which delivers from its cache or via DNS servers pointed to by proxies resolv.conf.auto (DHCP client updated)
== Role Based Authentication ==
* See also [https://openwrt.org/docs/guide-user/base-system/dns_configuration here]


=== Wifi commands ===
List profiles for a user:
profiles -l user1


  iw phy0 info
Create a new profile (local files, not LDAP):
  iw reg get
profile -p ChangePasswords -S files
  iw reg set GB
> set desc="Allow changing of passwords"
  > set auth=solaris.passwd.assign,solaris.account.activate
> info
  > verify
  > exit


See other [http://wireless.kernel.org/en/users/Documentation/iw#Scanning iw] commands and [http://git.kernel.org/cgit/linux/kernel/git/linville/wireless-regdb.git/tree/db.txt?id=HEAD Reg Database].
Update a user to be assigned the new profile:
usermod +P ChangePasswords user1


=== USB and File sharing ===
Profiles are stored locally in:
* /etc/security/prof_attr


Add packages:
== Zones ==
opkg install kmod-usb-core kmod-usb-storage usbutils block-mount luci-app-minidlna


Show device:
Oracle Docs:
ls /dev/sd*
* [https://docs.oracle.com/cd/E37838_01/html/E61037/zonesoverview.html#scrolltoc Zones Overview]
lsusb -t
* [https://www.oracle.com/technetwork/articles/servers-storage-admin/o11-092-s11-zones-intro-524494.html Getting Started]


Driver USB 1, 2, 3: uhci/ohci, ehci, xhci
Check zfs:
zfs list | grep zones


Show device:
Configuring a zone:
# block info /dev/sda1
<pre>
/dev/sda1: UUID="9814-E49A" LABEL="2" VERSION="FAT16" TYPE="vfat"
root@npgs-solaris:~# zonecfg -z zone1
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
create: Using system default template 'SYSdefault'
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set bootargs="-m verbose"
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
root@npgs-solaris:~#
</pre>


Mount FAT32 USB stick:
List config:
  /sbin/block mount
<pre>
cd /mnt/sda1
root@npgs-solaris:~# zoneadm list -cv
  ID NAME            STATUS      PATH                        BRAND      IP
  0 global          running    /                            solaris    shared
  - zone1            configured /system/zones/zone1          solaris    excl
</pre>


See also [https://openwrt.org/docs/guide-user/storage/usb-drives here]
Install zone:
<pre>
root@npgs-solaris:~# zoneadm -z zone1 install
The following ZFS file system(s) have been created:
    rpool/VARSHARE/zones/zone1
Progress being logged to /var/log/zones/zoneadm.20181109T163221Z.zone1.install
      Image: Preparing at /system/zones/zone1/root.


=== LEDs ===
Install Log: /system/volatile/install.25403/install_log
AI Manifest: /tmp/manifest.xml.5c4vcb
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: zone1
Installation: Starting ...
          Creating IPS image
Startup linked: 1/1 done
        Installing packages from:
            solaris
                origin:  http://pkg.oracle.com/solaris/release/
DOWNLOAD                                PKGS        FILES    XFER (MB)  SPEED
Completed                            415/415  65388/65388  428.2/428.2  507k/s


* Panel LEDS: [https://openwrt.org/start?id=docs/guide-user/base-system/led_configuration LED Config]
PHASE                                          ITEMS
* [https://openwrt.org/docs/techref/hardware/port.gpio GPIO]
Installing new actions                  89400/89400
Updating package state database                Done
Updating package cache                          0/0
Updating image state                            Done
Creating fast lookup database                  Done
Updating package cache                          1/1
Installation: Succeeded
done.


=== Buttons ===
        Done: Installation completed in 1328.592 seconds.


* Panel buttons: [https://openwrt.org/docs/guide-user/hardware/hardware.button Button Config].


procd interface:
  Next Steps: Boot the zone, then log into the zone console (zlogin -C)


root@hootoo:/etc/rc.button# ls
              to complete the configuration process.
BTN_0    failsafe  power    reset    rfkill
root@hootoo:/etc/rc.button#


scripts need to be named according to the button name, like "BTN_0" or "wps" (see [https://openwrt.org/docs/guide-user/hardware/hardware.button here]). They receive values:
Log saved in non-global zone as /system/zones/zone1/root/var/log/zones/zoneadm.20181109T163221Z.zone1.install
* $BUTTON: Name of button
</pre>
* $ACTION: "pressed", "timeout" or "released". For released, script returns timeout seconds (for hold down).
* $SEEN: number of seconds


root@wifi-ht:/etc/rc.button# cat BTN_0
Start the zone:
#!/bin/sh
  zoneadm -z zone1 boot
logger "Button $BUTTON: $ACTION (Seen $SEEN)"
  return 0
root@wifi-ht:/etc/rc.button#


==== C2600 ====
Login to the zone console (disconnect with ~.) and finish setup with UI:
zlogin -C zone1


Has an additional "lights_toggle":
Check status:
zoneadm list -v


[ "${ACTION}" = "released" ] || exit 0
Show config:
  zonecfg -z zone1 info -a
led="c2600:white:general"
device="wifinet3"
logger "Button $ACTION, will toggle Guest Wifi"
echo 1 > /sys/class/leds/$led/brightness
case $(uci get wireless.$device.disabled) in
    0)
        uci set wireless.$device.disabled=1
        logger "Wifi disabled"
    ;;
    1)
        uci set wireless.$device.disabled=0
        logger "Wifi enabled"
    ;;
esac
wifi reload
service network reload
sleep 1
echo 0 > /sys/class/leds/$led/brightness
  return 0


=== 6in4 ===
Dedicated CPUs (set min 1, max 3) to a zone:
<pre>
# zonecfg -z zone1
zonecfg:zone1> add dedicated-cpu
zonecfg:zone1:dedicated-cpu> set ncpus=1-3
zonecfg:zone1:dedicated-cpu> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
</pre>


Requires packages: 6in4 luci-proto-ipv6 and used tunnel from [https://tunnelbroker.net/ Hurricane Electric].
("select" to enter a resource once it exists. "remove" to delete)
* Restart network
* In LUCI, edit wan6 and change protocol from DHCPv6 to RFC4213
* Set Remote IPv4 address (eg 74.82.46.6)
* Set Local IPv6 address
* Set IPv6 routed prefix (Routed /48)
* Dynamic tunnel
** Tunnel ID
** HE username/password


ping ipv6.google.com
Set Memory cap:
<pre>
zonecfg:zone1> add capped-memory
zonecfg:zone1:capped-memory> set physical=512m
zonecfg:zone1:capped-memory> set swap=1024m
zonecfg:zone1:capped-memory> set locked=128m
zonecfg:zone1:capped-memory> end
</pre>


Manual Config:
[https://www.thegeekdiary.com/resource-management-in-solaris-zones-capped-memory/ Capped Memory]


opkg install 6in4
Set CPU cap (proportion guaranteed if there is contention), eg 50%:
<pre>
# zonecfg -z zone1
zonecfg:zone1> add capped-cpu
zonecfg:zone1:capped-cpu> set ncpus=0.5
zonecfg:zone1:capped-cpu> end
</pre>


uci set network.henet=interface
[https://www.thegeekdiary.com/resource-management-in-solaris-zones-cpu-shares-capped-cpu-dedicated-cpu-assignment/ Capped CPU]
uci set network.henet.proto=6in4
uci set network.henet.peeraddr=[get IPv4 of HE gateway]
uci set network.henet.ip6addr='[IPv6 from HE]'
uci set network.henet.tunnelid=[HE tunnel ID]
uci set network.henet.username=[HE username]
uci set network.henet.password='[HE password]'
uci commit network
uci set firewall.@zone[1].network='wan henet'
uci commit firewall
ifup henet
/etc/init.d/firewall restart

Revision as of 17:18, 5 July 2023

Installation

  • Oracle CBE (Common Build Environmnet) : Not for production
  • SRU (Support Repository Update) for production

CBE does not install a desktop. To do this after a text install, change the repository location:

pkg set-publisher -G'*' -g http://pkg.oracle.com/solaris/release/ solaris

Check the online package, then install:

pkg info -r solaris-desktop
pkg install solaris-desktop

VirtualBox

pkg install runtime/python-39
pkgadd -d VirtualBox-7.0.8-SunOS-amd64-r156879.pkg

General

Booting: x86

Into single-user mode:

  • In grub menu, edit entry
  • On $multiboot line, add "-s" to end
  • CTRL-X to boot

Show Grub boot options:

bootadm list-menu

Set default menu option to second one:

bootadm set-menu default=1

Set the timeout:

bootadm set-menu timeout=10

Booting: OpenBoot

  • ok> prompt: STOP-A or BRK
banner
reset-all
probe-ide
probe-scsi
devaliases
printenv boot-device
setenv boot-device disk
reset

Package Management

Show package publisher:

pkg publisher

Show us only the packages for which newer versions are available:

pkg info -u

Update:

pkg update

Show SRU installed (look at Branch and Packaging Date):

pkg info entire

Search for a package matching "ucb":

# pkg search ucb
INDEX      ACTION VALUE                                  PACKAGE
basename   file   usr/share/groff/1.22.3/font/devlj4/UCB pkg:/text/groff@1.22.3-11.4.0.0.1.14.0
basename   dir    usr/ucb                                pkg:/legacy/compatibility/ucb@11.4-11.4.0.0.1.15.0
pkg.fmri   set    solaris/compatibility/ucb              pkg:/compatibility/ucb@11.4-11.4.0.0.0.11.0
pkg.fmri   set    solaris/legacy/compatibility/ucb       pkg:/legacy/compatibility/ucb@11.4-11.4.0.0.1.15.0

# pkg install pkg:/compatibility/ucb@11.4-11.4.0.0.0.11.0

Services

List all enabled services (-a also shows disabled):

svcs

Show long list about one service:

# svcs -l apache24
fmri         svc:/network/http:apache24
name         Apache 2.4 HTTP server
enabled      true
state        online
next_state   none
state_time   Mon Nov 12 16:22:58 2018
logfile      /var/svc/log/network-http:apache24.log
restarter    svc:/system/svc/restarter:default
contract_id  2017
manifest     /lib/svc/manifest/network/http-apache24.xml
dependency   optional_all/error svc:/system/filesystem/autofs:default (online)
dependency   require_all/none svc:/system/filesystem/local:default (online)
dependency   require_all/error svc:/milestone/network:default (online)

Enable a service:

svcadm enable apache24

User Management

To give user ability to su to root:

  • /etc/user_attr.d/local-entries

To show status and unlock:

passwd -s
passwd -u someuser

To stop account lockout:

usermod -K lock_after_retries=no someuser

iSCSI initiator (Static)

Check initiator service is up:

svcs network/iscsi/initiator

Add IP of storage system (use default port 3260):

iscsiadm add static-config iqn.2000-01.com.example:initiator01, 192.0.2.2:3260

Check targets:

iscsiadm list static-config

CHAPS enable:

iscsiadm modify initiator-node --authentication CHAP

Set user, and secret (password):

iscsiadm modify initiator-node --CHAP-name someuser
iscsiadm modify initiator-node --CHAP-secret
 Enter CHAP secret: ************
 Re-enter secret: ************

Enable:

iscsiadm modify discovery --static enable

Show initiator status:

iscsiadm list initiator-node
iscsiadm list target
iscsiadm list target-param -v

Show iSCSI disks:

iscsiadm list target -S | grep "OS Device Name"


See also: Oracle Docs

Kerberos

Client: kclient

Networking

networking

Check status:

dladm show-link

Show hostname:

svccfg -s system/identity:node listprop config

Set hostname:

svccfg -s system/identity:node setprop config/nodename="my-sol-host"
svccfg -s system/identity:node setprop config/loopback="localhost

NTP

Client:

cd /etc/inet; cp ntp.client > ntp.conf

(edit file)

svcadm enable ntp
svcadm start ntp

Reset root password

  • Boot from CD
  • Select option 3: Shell

Check availability of rpool (none expected):

zpool list

Import rpool:

zpool import -f -R /a rpool

df -h should show some filesystems under /a

Show zfs filesystems, check for root/ROOT/...

zfs list

Set mount point for root filesystem:

zfs set mountpoint=/mnt_tmp rpool/ROOT/11.4-11.4.31.0.1.88.5

Check new entry under /mnt/tmp has been added:

zfs list

Mount filesystem:

zfs mount rpool/ROOT/11.4-11.4.31.0.1.88.5

Remove password hash from /a/mnt_tmp/etc/shadow

Reset mount point:

zfs umount rpool/ROOT/11.4-11.4.31.0.1.88.5
zfs set mountpoint=/ rpool/ROOT/11.4-11.4.31.0.1.88.5
zpool export rpool
  • Reboot server
  • edit grub menu ("e")
  • on line starting $multiboot, append "-s" option for single-user mode
  • enter "root" and once in shell, change root password
  • reboot

Resource Pools

Disks can be listed and formatted with:

format

Will show at least the root pool (rpool):

zpool list
zpool status

Show zfs file systems:

zfs list

Create a new pool from one device (file, or disk device):

zpool create pool1 /root/disk1
zpool list pool1
zfs list pool1

Add a second disk, and zfs capacity expands automatically:

zpool add pool1 /root/disk2

Remove a pool:

zpool destroy pool1

Create a mirror:

zpool create pool1 mirror /root/disk1 /root/disk2

Check for errors:

zpool scrub pool1

Remove a disk:

zpool detatch pool1 /root/disk1

Add a new disk ("silver" the mirror disk2 > 1):

zpool attach pool1 /root/disk2 /root/disk1

Make a bigger RAID:

zpool create pool1 raidz /root/disk1 /root/disk2 /root/disk3 /root/disk4

Role Based Authentication

List profiles for a user:

profiles -l user1

Create a new profile (local files, not LDAP):

profile -p ChangePasswords -S files
> set desc="Allow changing of passwords"
> set auth=solaris.passwd.assign,solaris.account.activate
> info
> verify
> exit

Update a user to be assigned the new profile:

usermod +P ChangePasswords user1

Profiles are stored locally in:

  • /etc/security/prof_attr

Zones

Oracle Docs:

Check zfs:

zfs list | grep zones

Configuring a zone:

root@npgs-solaris:~# zonecfg -z zone1
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create
create: Using system default template 'SYSdefault'
zonecfg:zone1> set autoboot=true
zonecfg:zone1> set bootargs="-m verbose"
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
root@npgs-solaris:~#

List config:

root@npgs-solaris:~# zoneadm list -cv
  ID NAME             STATUS      PATH                         BRAND      IP
   0 global           running     /                            solaris    shared
   - zone1            configured  /system/zones/zone1          solaris    excl

Install zone:

root@npgs-solaris:~# zoneadm -z zone1 install
The following ZFS file system(s) have been created:
    rpool/VARSHARE/zones/zone1
Progress being logged to /var/log/zones/zoneadm.20181109T163221Z.zone1.install
       Image: Preparing at /system/zones/zone1/root.

Install Log: /system/volatile/install.25403/install_log
 AI Manifest: /tmp/manifest.xml.5c4vcb
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: zone1
Installation: Starting ...
          Creating IPS image
Startup linked: 1/1 done
        Installing packages from:
            solaris
                origin:  http://pkg.oracle.com/solaris/release/
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                            415/415   65388/65388  428.2/428.2  507k/s

 PHASE                                          ITEMS
Installing new actions                   89400/89400
Updating package state database                 Done
Updating package cache                           0/0
Updating image state                            Done
Creating fast lookup database                   Done
Updating package cache                           1/1
Installation: Succeeded
 done.

        Done: Installation completed in 1328.592 seconds.


  Next Steps: Boot the zone, then log into the zone console (zlogin -C)

              to complete the configuration process.

Log saved in non-global zone as /system/zones/zone1/root/var/log/zones/zoneadm.20181109T163221Z.zone1.install

Start the zone:

zoneadm -z zone1 boot

Login to the zone console (disconnect with ~.) and finish setup with UI:

zlogin -C zone1

Check status:

zoneadm list -v

Show config:

zonecfg -z zone1 info -a

Dedicated CPUs (set min 1, max 3) to a zone:

# zonecfg -z zone1
zonecfg:zone1> add dedicated-cpu
zonecfg:zone1:dedicated-cpu> set ncpus=1-3
zonecfg:zone1:dedicated-cpu> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit

("select" to enter a resource once it exists. "remove" to delete)

Set Memory cap:

zonecfg:zone1> add capped-memory
zonecfg:zone1:capped-memory> set physical=512m
zonecfg:zone1:capped-memory> set swap=1024m
zonecfg:zone1:capped-memory> set locked=128m
zonecfg:zone1:capped-memory> end

Capped Memory

Set CPU cap (proportion guaranteed if there is contention), eg 50%:

# zonecfg -z zone1
zonecfg:zone1> add capped-cpu
zonecfg:zone1:capped-cpu> set ncpus=0.5
zonecfg:zone1:capped-cpu> end

Capped CPU