You are not logged in.
For sake of completeness, here are two variations on the skinny-create-ap script in reply #18. Both are tested and working for me.
Variation 1: nftables instead of iptables
If you would rather use the more modern nftables packet filtering interface for linux, only two tweaks need to be made to the instructions in reply #18.
1. Packages to install:
sudo apt install iproute2 nftables dnsmasq hostapd haveged 2. Replace the script's setup_nat() function with this version:
setup_nat()
{
nft add table ip nat
nft add chain ip nat postrouting { type nat hook postrouting priority 0\; policy accept\; }
nft add rule ip nat postrouting masquerade
}Variation 2: 5 GHz hotspot instead of 2.4 GHz
This assumes your hardware supports it.
For me, creating a 5 GHz hotspot is simply a matter of replacing the script's setup_ap() function with this version:
setup_ap()
{
# create hostapd config file:
echo "
ssid=$ssid
interface=$lan_if
driver=nl80211
country_code=US
channel=44
ignore_broadcast_ssid=0
hw_mode=a
auth_algs=1
wpa=2
wpa_passphrase=$password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# N
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40+][HT40-][SHORT-GI-20][SHORT-GI-40]
" >/tmp/hostapd.conf
# start hostapd:
hostapd /tmp/hostapd.conf
}You may need to tweak the country_code, channel, and ht_capab variables, but the above settings are pretty vanilla.
I hope that reply #18 and this reply #21 provide all you need to setup your own GNU/Linux-powered router ![]()
Happy hacking!
----------
PS1: Regarding range--If you're going to have a GNU/Linux laptop working full-time as a wireless router, you should consider using a USB wifi adapter rather than laptop's built-in wireless card because it will give you much better signal strength/range. I've been using an ALFA AWUS036ACHM for this purpose for years and it has served me well. You can find information about USB wifi adapters on linux here.
PS2: On "router" vs. "wifi repeater"--This seems like a silly distinction. In both cases, the laptop is creating a wireless access point and forwarding packets between two networks. Conceptually, it makes no difference whether your device is sharing a wired or wireless internet connection. Put another way, a "wifi repeater" is just a special kind of router where the networks on both sides of the router have a wireless physical layer.
You might want to disable automatic start of dnsmasq
Hi dzz. My skinny-create-ap script (in reply #18) starts dnsmasq in such a way that there is no clash if another instance of dnsmasq is already running. In general, multiple instances of dnsmasq can happily be running on the same machine as long as no two instances try to bind to the same interface.
Hi mtbvfr. Thanks for the private message with the requested info.
I understand your laptop has a successful internet connection using ethernet cable on the eth0 nic, and you want to share that internet connection wirelessly by creating an access point on wlan0.
Based on the information you provided, it seems wlan0 is ready to be used for this purpose--its driver/firmware is loaded and it supports AP mode.
It seems create_ap is no longer maintained, so let's not bother with it.
I managed to get this working on Devuan Daedalus as follows:
0. No need to uninstall or disable NetworkManager if you have it
1. Install some packages:
sudo apt install iproute2 iptables dnsmasq hostapd haveged 2. Create a script named skinny-create-ap somewhere in your PATH and make it executable. Script should look like this:
#!/bin/sh
# skinny-create-ap v2.3 (February 19, 2024)
# Bruno "GNUser" Dantas (GPLv3)
# Purpose: Turn a GNU/Linux system into a wireless router
# Dependencies: iproute2 iptables dnsmasq hostapd
# Not a dependency but highly recommended: haveged
# Syntax: $ sudo skinny-create-ap <lan_if> <wan_if> <ssid> <passphrase>
# Example usage: $ sudo skinny-create-ap wlan0 eth0 DevuanHotspot TopSecret123
# To turn off the hotspot: $ sudo pkill hostapd; sudo pkill -f 'dnsmasq.*/tmp/dnsmasq.conf'
# user variables:
lan_if="$1"
wan_if="$2"
ssid="$3"
password="$4"
ip_stem=192.168.50
channel=6
#dns_server=1.1.1.1
main()
{
prevent_nm_interference
setup_kernel
setup_nat
setup_dhcp
setup_ap
}
prevent_nm_interference()
{
nmcli dev set "$lan_if" managed no >/dev/null 2>&1
}
setup_kernel()
{
echo 1 >/proc/sys/net/ipv4/conf/"$wan_if"/forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
}
setup_nat()
{
iptables -t nat -A POSTROUTING -o "$wan_if" -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i "$lan_if" -o "$wan_if" -j ACCEPT
}
setup_dhcp()
{
# first, bring up $lan_if and give it a suitable ip address:
if ip link set "$lan_if" up; then
ip addr add $ip_stem.1/24 dev "$lan_if"
else
echo "$lan_if does not exist or cannot be brought up. Make sure necessary driver +/- firmware is installed." >&2
exit 1
fi
# create dnsmasq config file:
echo "
dhcp-leasefile=/tmp/dnsmasq.leases
dhcp-range=$ip_stem.100,$ip_stem.200,255.255.255.0,24h
#dhcp-option-force=option:dns-server,$dns_server
" >/tmp/dnsmasq.conf
# start dnsmasq (with care not to clash with any dnsmasq instances that might already be running):
dnsmasq --interface="$lan_if" --bind-interfaces --except-interface=lo -C /tmp/dnsmasq.conf
}
setup_ap()
{
# create hostapd config file:
echo "
ssid=$ssid
interface=$lan_if
driver=nl80211
channel=$channel
ignore_broadcast_ssid=0
hw_mode=g
auth_algs=1
wpa=2
wpa_passphrase=$password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# N
ieee80211n=1
wmm_enabled=1
" >/tmp/hostapd.conf
# start hostapd:
hostapd /tmp/hostapd.conf &
}
main3. Run the script like this, for example:
sudo skinny-create-ap wlan0 eth0 DevuanHotspot TopSecret123Now your wireless devices (e.g., Android phone) should be able to connect to DevuanHotspot using the password TopSecret123.
Let me know how you fare.
----------
PS1: Regarding radio frequency--the shell script above creates a 2.4 GHz 802.11n ("Wi-Fi 4") access point. 2.4 GHz is a good default because it has better range, simpler configuration, no regulatory issues, and broader hardware support in AP mode. If your wireless nic supports creation of 5 GHz AP and you would prefer 5 GHz, just tweak the "setup_ap" function as appropriate (let me know if you need help).
PS2: Regarding DNS lookups--if you want dnsmasq to tell wireless clients which dns sever to use, just uncomment the two lines where you see dns_server. If you leave those two lines commented, wireless clients will rely on the router (i.e., your laptop) to resolve domain names, which is a perfectly sane default.
PS3: To turn the hotspot off, run this command: sudo pkill hostapd; sudo pkill -f 'dnsmasq.*/tmp/dnsmasq.conf'
Hi, mtbvfr. I'll be happy to try to help you. First, two quick questions, please:
1. Does your laptop have a working internet connection?
2. Does the wireless interface that you want to use to create the access point show up when you run ifconfig -a?
Hi penguin. I would give deepforest a warning for the inappropriate post if I could but, alas, I'm just a fellow user.
Have you tried setxkbmap? Start with setxkbmap -query to see what your current settings are for "model" and "layout". In my case, this is what I see:
$ setxkbmap -query
rules: evdev
model: pc105
layout: usTo set available models, layouts, variants, and options, do this:
$ less /usr/share/X11/xkb/rules/evdev.lstTo change settings, this is the syntax:
$ setxkbmap [-model xkb_model] [-layout xkb_layout] [-variant xkb_variant] [-option xkb_options]So to keep your current keyboard model and change to Russian layout, for example, do:
$ setxkbmap -layout ruYou mentioned that your Russian layout seems to have some characters off position. Maybe you are not using the Russian variant that has the positions you expect? Another possibility is that the keyboard model setting is not correct--look at your keyboard and compare it with internet images of different keyboard models to ensure that setxkbmap's "model" setting is correct for your hardware.
It seems there is no cpu or disk activity during this time, it just stays there and does nothing then continues to start as normal.
I was once affected by a very similar issue, where nothing would happen in the middle of boot process for about 30 seconds, then boot would continue as normal. In my case, the issue turned out to be that UUID of my swap partition had changed (because I deleted the old swap partition and created a new one), but initramfs had a record of the old UUID and was timing out while waiting for it to appear.
Have you changed any of your hardware or partition UUIDs recently? If so, try recreating your initramfs:
1. Boot as usual
2. Run sudo update-initramfs -u
3. Reboot
Yes, I think s2idle uses more battery than deep.
Switching to s2idle is the only fix I ever found that allowed the keyboard on one of my laptops to work after suspend. Sorry I couldn't help you find a satisfactory fix. Happy hacking!
Your mem_sleep is set to deep. s2idle is listed as a valid option but is not selected. If you run the command I suggested, you should see [s2idle] deep
Hi, rechvs. I once had a similar problem, where laptop keyboard was unresponsive after resuming from suspend. Laptop in question ran Devuan (I don't remember which version) and did have pm-utils installed.
The problem/solution may vary depending on exact hardware. For me, changing suspend method from the default "deep" (i.e., suspend-to-RAM) to "s2idle" (i.e., suspend-to-idle) solved the problem:
$ sudo sh -c "echo s2idle >/sys/power/mem_sleep"For completion's sake, here is the output of inxi -Gx in the three configurations I mentioned in original post:
#1: Laptop's default configuration. Result: Xorg consistently crashes when visiting certain webpages using chromium-based web browsers.
$ inxi -Gx
Graphics:
Device-1: Intel Core Processor Integrated Graphics vendor: Sony driver: i915
v: kernel arch: Gen-5.75 bus-ID: 00:02.0
Device-2: Microdia Webcam type: USB driver: uvcvideo bus-ID: 1-1.2:3
Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: modesetting
unloaded: fbdev,vesa dri: crocus gpu: i915 resolution: 1366x768~60Hz
API: OpenGL v: 2.1 Mesa 22.3.6 renderer: Mesa Intel HD Graphics (ILK)
direct-render: Yes#2: Workaround using nomodeset kernel boot parameter. Result: No Xorg crashes at the price of an inactive GPU.
$ inxi -Gx
Graphics:
Device-1: Intel Core Processor Integrated Graphics vendor: Sony driver: N/A
arch: Gen-5.75 bus-ID: 00:02.0
Device-2: Microdia Webcam type: USB driver: uvcvideo bus-ID: 1-1.2:3
Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: vesa
unloaded: fbdev,modesetting dri: swrast gpu: N/A resolution: 1366x768
API: OpenGL v: 4.5 Mesa 22.3.6 renderer: llvmpipe (LLVM 15.0.6 128 bits)
direct-render: Yes#3: Current configuration, achieved with /usr/share/X11/xorg.conf.d/09-force-intel-driver.conf and no special kernel boot parameters. Result: No Xorg crashes, GPU is active.
$ inxi -Gx
Graphics:
Device-1: Intel Core Processor Integrated Graphics vendor: Sony driver: i915
v: kernel arch: Gen-5.75 bus-ID: 00:02.0
Device-2: Microdia Webcam type: USB driver: uvcvideo bus-ID: 1-1.2:3
Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: intel
dri: crocus gpu: i915 resolution: 1366x768~60Hz
API: OpenGL v: 2.1 Mesa 22.3.6 renderer: Mesa Intel HD Graphics (ILK)
direct-render: YesOther than this one strange issue on this one laptop, upgrade from Chimaera to Daedalus was smooth for all my machines. Thank you, Devuan team!
Happy hacking!
In short: screen numbers start at 0.
Maybe so, but the affected laptop only has one (built-in) screen and the config file has no effect unless I use Device1.
It seems that Xorg's latest modesetting driver does not play nice with old-ish (5th generation) integrated Intel graphics. One solution is to force Xorg to use its intel driver instead of the default modesetting driver.
If all of these are true for you:
1. You are experiencing seemingly random Xorg crashes (e.g., while using a chromium-based web browser such as Brave or Chrome) after upgrading to Daedalus
2. After an Xorg crash, /var/log/Xorg.0.log.old shows Fatal server error: (EE) GLSL compile failure
3. Your machine has 5th generation Intel integrated graphics (use inxi -Gx to find out. In my case, command output shows arch: Gen-5.75)
Then try creating /usr/share/X11/xorg.conf.d/09-force-intel-driver.conf with this in it (you may have to change Device1 to Device0):
Section "Device"
Identifier "Device1"
Driver "intel"
EndSectionand then reboot. In my case, all Xorg crashes went away.
I hope this helps someone with the same issue.
----------
Some additional details:
In my case, crashes could be reliably triggered by visiting certain product pages on amazon.com while using Brave or Chrome browser (e.g., "Risk: Lord of the Rings Trilogy edition"). Disabling "Use hardware acceleration when available" in the browser did not help. Building, installing, and using mesa-amber as described in this post did not help. Using nomodeset kernel boot parameter does make the crashes go away, but seemingly at the expense of disabling the GPU and losing hardware graphics acceleration.
Here is what I see at the end of /var/log/Xorg.0.log.old after a crash:
vec2 rel_tex_coord(vec2 texture, vec4 wh, int repeat)
{
vec2 rel_tex;
rel_tex = texture * wh.xy;
if (repeat == RepeatFix + RepeatNone)
return rel_tex;
else if (repeat == RepeatFix + RepeatNormal)
rel_tex = floor(rel_tex) + (fract(rel_tex) / wh.xy);
else if (repeat == RepeatFix + RepeatPad) {
if (rel_tex.x >= 1.0)
rel_tex.x = 1.0 - wh.z * wh.x / 2.;
else if (rel_tex.x < 0.0)
rel_tex.x = 0.0;
if (rel_tex.y >= 1.0)
rel_tex.y = 1.0 - wh.w * wh.y / 2.;
else if (rel_tex.y < 0.0)
rel_tex.y = 0.0;
rel_tex = rel_tex / wh.xy;
} else if (repeat == RepeatFix + RepeatReflect) {
if ((1.0 - mod(abs(floor(rel_tex.x)), 2.0)) < 0.001)
[ 63.908] (EE)
Fatal server error:
[ 63.908] (EE) GLSL compile failure
[ 63.908] (EE)
[ 63.908] (EE)
Please consult the The X.Org Foundation support
at http://wiki.x.org
for help.
[ 63.909] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[ 63.909] (EE)
[ 63.909] (II) AIGLX: Suspending AIGLX clients for VT switch
[ 63.968] (EE) Server terminated with error (1). Closing log file.P.S. My other laptop, which has integrated Intel graphics Gen-7, is not affected by this problem.
Thank you, HoaS. I found this thread and your excellent instructions while investigating Xorg crashes on an old Sony Vaio after upgrading from Chimaera to Daedalus.
For completion's sake, these are the steps I needed to follow after your instructions:
0. The debuild -us -uc step generates six new .deb packages.
1. Install the six new packages with sudo apt install *.deb. These new packages do not conflict with any of the currently-installed graphics packages, so there is no need to uninstall anything.
2. Add this line to /etc/environment: MESA_LOADER_DRIVER_OVERRIDE=i965
3. Reboot
After rebooting, inxi -G shows that mesa-amber is being used (i.e., you'll see that dri = i965 and mesa version = 21).
P.S. In my specific case, it seems mesa version 22 has nothing to do with the Xorg crashes, so mesa-amber unfortunately did not fix the problem. I'll describe my problem and its solution in a separate thread.
Yesterday I upgraded from Chimaera to Daedalus without any issues. Here are the steps I followed:
Edit /etc/apt/sources.list to point to daedalus
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade # at the end there are some errors having to do with old version of linux kernel
$ sudo apt-get autoremove --purge # this removes the packages that caused errors
$ sudo apt-get dist-upgrade # now it completes without any errors
$ sudo apt-get autoclean
RebootI only use the main component of the repository. In other words, my /etc/apt/sources.list now looks like this:
deb http://deb.devuan.org/merged daedalus mainSince I don't have packages from contrib or non-free, I cannot comment on the current upgrade experience if your Chimaera system includes packages from those components.
Rant: Did you actually read this?
Option "DontZap" "boolean"
This disallows the use of the Terminate_Server XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options). This action is normally used to terminate the Xorg server. When this option is enabled, the action has no effect. Default: off.
This illustrates exactly what I dislike about Xorg. Everything is overly complicated. This is not a human-friendly description. The header says the DontZap option is boolean, so expected default values would be "true" or "false", not "off" (what exactly is off?).
But all's well that ends well. Thanks to lightdm and sxhkd I don't have to deal with this ![]()
I am familiar with the XY Problem, thank you. Not the case here, as the goal was to reimplement the old behavior with a shell script (or a simple shell command, as it turned out), not by tweaking Xorg config files. I love shell scripts and actually quite dislike Xorg, which I tolerate only out of necessity.
I use sxhkd for keyboard hotkeys. Binding sudo pkill Xorg to control + alt + BackSpace does exactly what I was looking for. Thanks again for the help.
I figured it out. I just needed to add a line to /etc/lightdm/lightdm.conf. Now instead of just this in the relevant section:
[SeatDefaults]
autologin-user=bruno
autologin-user-timeout=0I have this:
[SeatDefaults]
autologin-user=bruno
autologin-user-timeout=0
session-cleanup-script=service lightdm restartWith that added line, now all I need to restart Xorg is sudo pkill Xorg. Thanks for pointing me in the right direction, HoaS!
If you set up autologin for your user ... then killing X should do what you want.
If I run sudo pkill Xorg, then lightdm presents me with a login screen. This is unexpected, since lightdm is configured for autologin and does, in fact, automatically log me at every boot.
Can you help me configure lightdm so that it also automatically logs me in when Xorg is killed?
I do have autologin enabled for my user, with this in /etc/lightdm/lightdm.conf:
[SeatDefaults]
autologin-user=bruno
autologin-user-timeout=0I'd rather not ditch lightdm, since I would have to reconfigure multiple machines.
There's no actual problem. A few years ago, Xorg disabled Control+Alt+Backspace as the keyboard shortcut for restarting X (supposedly for security reasons). I liked having that shortcut because it was useful for the rare instances when X would freeze. If X acts up, I'd rather simply restart it than doing a full reboot. So the goal is to bring back that functionality by creating a script that works as intended, then binding it to Control+Alt+Backspace.
Wanting to get this script to work is mostly an exercise in getting my computer to do what I want it to do.
Hello, Devuan friends. I'm on Devuan Chimaera x86_64 with SysVinit, lightdm, Xorg 7.7, and MATE. I'm trying to write a shell script that restarts Xorg. Let's call it RestartX.sh
I already tried several variations of this:
#!/bin/sh
sudo service lightdm stop
sleep 1
sudo service lightdm startI also tried:
#/bin/sh
sudo chvt 1
sudo pkill -f lightdm
sleep 1
sudo service lightdm startAnd I also tried:
#!/bin/sh
sudo pkill Xorg
sleep 1
startxI run the script in a terminal emulator like so: $ ./RestartX.sh & exit
X seems easy to stop but difficult to start from a shell script. Any ideas on how to make it work?
Thank you, HoaS. Yes, that's helpful. I'll give patching caja a shot sometime.
Meanwhile, I'll let the MATE developers know about the issue and patch so that they can consider adopting it. It would be nice to have this without having to recompile anything.
I'm on Chimaera with MATE 1.24.1 and caja 1.24.0. When I used older Devuan ASCII + MATE, caja would not show bind mounts on the deskop. This is the desired, expected behavior (I used bind mounts extensively and having every one of them show up on the desktop creates clutter).
Does anyone know how to hide bind mounts from the MATE desktop? I found the org.mate.caja.desktop volumes-visible setting in dconf but I do not want to hide mounted devices from the desktop, I just want to hide bind mounts.
Hi, viverna. Anything sold on thinkpenguin.com (their prices are high but the customer service is excellent) will have universal GNU/Linux compatibility because they only sell free software-friendly devices. Here's something they sell:
https://www.thinkpenguin.com/gnu-linux/ … 1394bapcie
Also, the FSF maintains the helpful h-node.org database. To see the firewire adapters in their database, go to duckduckgo.com and enter this search query: firewire site:h-node.org. If the "does it work with free software?" line says "yes" then the device will have universal GNU/Linux compatibility.
Hi, viverna.
All available external/loadable kernel modules are listed in the file /lib/modules/<kernel_version>/modules.order. Another way to see which ones are available on your system is to list the .ko files. Something like this would work: find /lib/modules -name '*.ko'.
Built-in kernel modules (which are statically linked into the kernel image and are therefore always "loaded") are listed in the file /lib/modules/<kernel_version>/modules.builtin. These built-in modules are invisible to tools such as lsmod and modprobe.
Whether external or built-in, every kernel module that's currently in active use will have a corresponding directory under /sys/module/.
I'm on Devuan ASCII with a custom kernel and I didn't pay any attention to firewire during compilation. I have several firewire-related external modules available:
$ find /lib/modules -name '*.ko' | grep firewire
/lib/modules/4.16.2-gnu/kernel/drivers/firewire/firewire-ohci.ko
/lib/modules/4.16.2-gnu/kernel/drivers/firewire/nosy.ko
/lib/modules/4.16.2-gnu/kernel/drivers/firewire/firewire-net.ko
/lib/modules/4.16.2-gnu/kernel/drivers/firewire/firewire-core.ko
/lib/modules/4.16.2-gnu/kernel/drivers/firewire/firewire-sbp2.ko
/lib/modules/4.16.2-gnu/kernel/drivers/staging/fwserial/firewire-serial.ko
/lib/modules/4.16.2-gnu/kernel/drivers/media/firewire/firedtv.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/digi00x/snd-firewire-digi00x.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/motu/snd-firewire-motu.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/fireface/snd-fireface.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/bebob/snd-bebob.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/snd-firewire-lib.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/tascam/snd-firewire-tascam.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/dice/snd-dice.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/fireworks/snd-fireworks.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/oxfw/snd-oxfw.ko
/lib/modules/4.16.2-gnu/kernel/sound/firewire/snd-isight.koI hope that helps troubleshoot your issue.
Hi, Devuman. Sorry for leading you on a wild goose chase trying to ssh into R2. It seems ralph.ronnquist was right and your router does not offer ssh access into it.
I'm glad you were able to achieve what you needed by setting up a "virtual server" on R2.
P.S. In the future, if you ever have to choose between ralph.ronnquist's advice and someone else's, save yourself some trouble and just go with ralph.ronnquist's ![]()