LINUX.ORG.RU

Сообщения metawishmaster

 

не пашет watchdog

Всем доброго дня! :)

Не получаетcя завести watchdog(iTCO_wdt) на десктопе. С пол-пинка завелся на планшете (какой-то SoC с i5-8200Y), но ни в какую не хочет на «десктопе» (i7-7700 на Gigabyte H110-D3)

шаги:
установил пакет watchdog - # apt-get install watchdog
в файле /etc/watchdog.conf раскомментировал строчку watchdog-device = /dev/watchdog
затем в файле /etc/default/watchdog строчку watchdog_module=«none» заменил на watchdog_module=«iTCO_wdt»
потом на планшете

# systemctl start watchdog
# systemctl status watchdog
...
# systemctl enable watchdog

на десктопе просто перезагружаю

скажите, пожалуйста, что я мог пропустить на десктопе? шаги те же , и dmesg говорит одно и то же:
$ dmesg | grep -i wdt
[   15.740676] iTCO_wdt iTCO_wdt: Found a Intel PCH TCO device (Version=4, TCOBASE=0x0400)
[   15.741361] iTCO_wdt iTCO_wdt: initialized. heartbeat=30 sec (nowayout=0)

 ,

metawishmaster
()

правило udev'a не работает

доброй ночи, ЛОР!

а подскажите, пожалуйста, где косяк во втором листинге?
из коммандной строки это работает как нужно

sudo /bin/sh -c '/etc/acpi/headphones.sh none none `/usr/bin/cat \`/usr/bin/find /sys/devices/ -name i2c-ESSX8336:??\`/jack_status`'


а вот это плавило udev'а не хочет... причем один раз у меня получилось, но результат я не сохранил, а решил улучшить. «улучшил» %)
SUBSYSTEM=="i2c", ACTION=="add", DRIVERS=="es8316",RUN+="/usr/bin/bash -c '/etc/acpi/headphones.sh none none `/usr/bin/cat \`/usr/bin/find /sys/devices/ -name i2c-ESSX8336:??\`/jack_status`'"

 ,

metawishmaster
()

по следам «проблемы с es8336»

Всем доброго рабочего времени! :)

безобразия с es8336 продолжаются - патч, который я написал для второй проблемы приводил к тому, что сперва звука не было вообще, но после подключения наушников звух появлялся на них, а после их отключения - на спикере.
я попытался исправить ситуацию патчем ниже, но он нормально работает крайне редко. Чаще приводит к кернел паникам (при загрузке) в самых неожиданных местах... :-\

кто может посмотреть незамыленным взглядом - где тут может происходить неприличное?

diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c
index 09a3ca8d6..6b999a214 100644
--- a/sound/soc/codecs/es8316.c
+++ b/sound/soc/codecs/es8316.c
@@ -24,6 +24,11 @@
 #include <sound/jack.h>
 #include "es8316.h"
 
+struct jack_gpio {
+	struct snd_soc_jack *jack;
+	struct gpio_desc *gpio;
+};
+
 /* In slave mode at single speed, the codec is documented as accepting 5
  * MCLK/LRCK ratios, but we also add ratio 400, which is commonly used on
  * Intel Cherry Trail platforms (19.2MHz MCLK, 48kHz LRCK). */
@@ -590,11 +595,13 @@ static irqreturn_t es8316_irq(int irq, void *data)
 {
 	struct es8316_priv *es8316 = data;
 	struct snd_soc_component *comp = es8316->component;
-	static struct gpio_desc *gpio = NULL;
+//	static struct gpio_desc *gpio = NULL;
 	unsigned int flags;
+	struct jack_gpio *jack_gpio;
 
 	mutex_lock(&es8316->lock);
 
+	jack_gpio = snd_soc_card_get_drvdata(comp->card);
 	regmap_read(es8316->regmap, ES8316_GPIO_FLAG, &flags);
 	if (flags == 0x00)
 		goto out; /* Powered-down / reset */
@@ -617,15 +624,15 @@ static irqreturn_t es8316_irq(int irq, void *data)
 					    SND_JACK_HEADSET | SND_JACK_BTN_0);
 			dev_info(comp->dev, "jack unplugged\n");
 
-			if (gpio)
-				devm_gpiod_put(comp->dev, gpio);
-			gpio = devm_gpiod_get_optional(comp->dev, "speakers-enable", GPIOD_OUT_LOW);
-			gpiod_set_value_cansleep(gpio, 0);
+			if (jack_gpio->gpio)
+				devm_gpiod_put(comp->dev, jack_gpio->gpio);
+			jack_gpio->gpio = devm_gpiod_get_optional(comp->dev, "speakers-enable", GPIOD_OUT_LOW);
+			gpiod_set_value_cansleep(jack_gpio->gpio, 0);
 
-			if (IS_ERR(gpio))
-				return dev_err_probe(comp->dev, PTR_ERR(gpio), "Get gpiod failed: %ld\n",
-							 PTR_ERR(gpio));
-		} printk("spurious IRQ\n");
+			if (IS_ERR(jack_gpio->gpio))
+				return dev_err_probe(comp->dev, PTR_ERR(jack_gpio->gpio), "Get gpiod failed: %ld\n",
+							 PTR_ERR(jack_gpio->gpio));
+		}
 	} else if (!(es8316->jack->status & SND_JACK_HEADPHONE)) {
 		/* Jack inserted, determine type */
 		es8316_enable_micbias_for_mic_gnd_short_detect(comp);
@@ -646,11 +653,11 @@ static irqreturn_t es8316_irq(int irq, void *data)
 			/* Keep mic-gnd-short detection on for button press */
 		} else {
 			printk("HEADPHONES\n");
-			if (gpio)
-				devm_gpiod_put(comp->dev, gpio);
-			gpio = devm_gpiod_get_optional(comp->dev, "speakers-enable", GPIOD_OUT_HIGH);
+			if (jack_gpio->gpio)
+				devm_gpiod_put(comp->dev, jack_gpio->gpio);
+			jack_gpio->gpio = devm_gpiod_get_optional(comp->dev, "speakers-enable", GPIOD_OUT_HIGH);
 			/* Shorted, headphones */
-			gpiod_set_value_cansleep(gpio, 1);
+			gpiod_set_value_cansleep(jack_gpio->gpio, 1);
 			snd_soc_jack_report(es8316->jack,
 					    SND_JACK_HEADPHONE,
 					    SND_JACK_HEADSET);
diff --git a/sound/soc/intel/avs/boards/es8336.c b/sound/soc/intel/avs/boards/es8336.c
index 141d8b8b9..6cf96f112 100644
--- a/sound/soc/intel/avs/boards/es8336.c
+++ b/sound/soc/intel/avs/boards/es8336.c
@@ -20,7 +20,10 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include <sound/soc-acpi.h>
-
+struct jack_gpio {
+	struct snd_soc_jack *jack;
+	struct gpio_desc *gpio;
+};
 #define ES8336_CODEC_DAI	"ES8316 HiFi"
 
 static const struct acpi_gpio_params speakers_gpio_en_params = { 0, 0, true };
@@ -40,14 +43,14 @@ static int avs_es8336_speaker_power_event(struct snd_soc_dapm_widget *w,
 	bool speaker_en;
 
 	codec_dai = snd_soc_card_get_codec_dai(card, ES8336_CODEC_DAI);
-//	gpio = gpiod_get_optional(codec_dai->dev, "speakers-enable", GPIOD_OUT_LOW);
+	gpio = gpiod_get_optional(codec_dai->dev, "speakers-enable", GPIOD_OUT_LOW);
 	speaker_en = !SND_SOC_DAPM_EVENT_ON(event);
 
 	if (SND_SOC_DAPM_EVENT_ON(event))
 		msleep(70);
 
 //	printk("gpiod_set_value_cansleep(gpio, %d)\n", speaker_en);
-//	gpiod_set_value_cansleep(gpio, speaker_en);
+	gpiod_set_value_cansleep(gpio, speaker_en);
 	return 0;
 }
 
@@ -103,19 +106,19 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
 	struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(runtime, 0);
 	struct snd_soc_component *component = codec_dai->component;
 	struct snd_soc_jack_pin *pins;
-	struct snd_soc_jack *jack;
+//	struct snd_soc_jack *jack;
 	struct snd_soc_card *card = runtime->card;
-	struct gpio_desc *gpio;
+	struct jack_gpio *jack_gpio;
 	int num_pins, ret;
 
-	jack = snd_soc_card_get_drvdata(card);
+	jack_gpio = snd_soc_card_get_drvdata(card);
 	num_pins = ARRAY_SIZE(card_headset_pins);
 
 	pins = devm_kmemdup(card->dev, card_headset_pins, sizeof(*pins) * num_pins, GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
-	ret = snd_soc_card_jack_new_pins(card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, jack,
+	ret = snd_soc_card_jack_new_pins(card, "Headset", SND_JACK_HEADSET | SND_JACK_BTN_0, jack_gpio->jack,
 					 pins, num_pins);
 	if (ret)
 		return ret;
@@ -123,17 +126,17 @@ static int avs_es8336_codec_init(struct snd_soc_pcm_runtime *runtime)
 	if (ret)
 		dev_warn(codec_dai->dev, "Unable to add GPIO mapping table\n");
 
-	printk("%s: jack->status = %x\n", __FUNCTION__, jack->status);
+	printk("%s: jack->status = %x\n", __FUNCTION__, jack_gpio->jack->status);
 
-	if (jack->status) {
-		gpio = devm_gpiod_get_optional(codec_dai->dev, "speakers-enable", GPIOD_OUT_LOW);
-		if (IS_ERR(gpio))
-			return dev_err_probe(codec_dai->dev, PTR_ERR(gpio), "Get gpiod failed: %ld\n",
-						 PTR_ERR(gpio));
+	if (jack_gpio->jack->status) {
+		jack_gpio->gpio = devm_gpiod_get_optional(codec_dai->dev, "speakers-enable", GPIOD_OUT_LOW);
+		if (IS_ERR(jack_gpio->gpio))
+			return dev_err_probe(codec_dai->dev, PTR_ERR(jack_gpio->gpio), "Get gpiod failed: %ld\n",
+						 PTR_ERR(jack_gpio->gpio));
 	}
 
-	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
-	snd_soc_component_set_jack(component, jack, NULL);
+	snd_jack_set_key(jack_gpio->jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+	snd_soc_component_set_jack(component, jack_gpio->jack, NULL);
 
 	card->dapm.idle_bias_off = true;
 
@@ -246,10 +249,10 @@ static int avs_es8336_probe(struct platform_device *pdev)
 	struct snd_soc_dai_link *dai_link;
 	struct snd_soc_acpi_mach *mach;
 	struct snd_soc_card *card;
-	struct snd_soc_jack *jack;
 	struct device *dev = &pdev->dev;
 	const char *pname;
 	int num_routes, ssp_port, ret;
+	struct jack_gpio *jack_gpio;
 
 	printk("inside %s\n", __FUNCTION__);
 	mach = dev_get_platdata(dev);
@@ -268,9 +271,12 @@ static int avs_es8336_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL);
+	jack_gpio = devm_kzalloc(dev, sizeof(struct jack_gpio), GFP_KERNEL);
+	if (!jack_gpio)
+		return -ENOMEM;
+	jack_gpio->jack = devm_kzalloc(dev, sizeof(struct jack_gpio), GFP_KERNEL);
 	card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
-	if (!jack || !card)
+	if (!jack_gpio->jack || !card)
 		return -ENOMEM;
 
 	card->name = "avs_es8336";
@@ -287,7 +293,7 @@ static int avs_es8336_probe(struct platform_device *pdev)
 	card->dapm_routes = routes;
 	card->num_dapm_routes = num_routes;
 	card->fully_routed = true;
-	snd_soc_card_set_drvdata(card, jack);
+	snd_soc_card_set_drvdata(card, jack_gpio);
 
 	ret = snd_soc_fixup_dai_links_platform_name(card, pname);
 	if (ret)
diff --git a/sound/soc/intel/boards/sof_es8336.c b/sound/soc/intel/boards/sof_es8336.c
index 894b6610b..eb09252c2 100644
--- a/sound/soc/intel/boards/sof_es8336.c
+++ b/sound/soc/intel/boards/sof_es8336.c
@@ -64,6 +64,7 @@ struct sof_es8336_private {
 	struct list_head hdmi_pcm_list;
 	bool speaker_en;
 	struct delayed_work pcm_pop_work;
+	struct gpio_desc *gpio;
 };
 
 struct sof_hdmi_pcm {
@@ -302,6 +303,7 @@ static int sof_es8316_init(struct snd_soc_pcm_runtime *runtime)
 	snd_jack_set_key(priv->jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
 
 	snd_soc_component_set_jack(codec, &priv->jack, NULL);
+//	priv->gpio = gpiod_get_optional(codec_dai->dev, "speakers-enable", GPIOD_OUT_LOW);
 
 	return 0;
 }

 , , kernel. sound,

metawishmaster
()

проблемы с es8336 // да гори она синим пламенем

Добрый вечер, ЛОР!
Нежданно-негаданно попалась мне нонеймовкая карточка на чипе ES8336, а вмести с попались и две (боюсь, пока) проблеммки:
1) еле слышный и шипучий звук на левом динамике
2) при подключении наушников не уходит звук с колонок

ни кто с такой какой не сталкивался? хелп нидед!!! :)

p.s. и вопрос, в какую сторону копать? Who's to blame? Драйвер или пульса?

p.p.s.
настройки alsa:

pcm.!default {
type route;
        slave.pcm dmix;
        ttable.0.0 1;
        ttable.1.1 1;
}

pcm.jackplug {
        type plug
        slave { pcm "jack" }
}

pcm.jack {
        type jack
        playback_ports {
                0 alsa_pcm:playback_1
                1 alsa_pcm:playback_2
        }
        capture_ports {
                0 alsa_pcm:capture_1
                1 alsa_pcm:capture_2
        }
}

 es8336,

metawishmaster
()

не получается в IFF_PROMISC

доброго вечера :)
перевожу я свою сетевуху в PROMISCOUS mode, и она, таки да, говорит, что перевелась. Но по-факту ловит только пакеты предназначенные строго ей...

ioctl(args->sock_in, SIOCGIFFLAGS, &ifr_in);                              
ifr_in.ifr_flags |= IFF_PROMISC;                                          
if (ioctl(args->sock_in, SIOCSIFFLAGS, &ifr_in)) {                        
        perror("ioctl");                                                  
        close(args->sock_in);                                             
        free(buffer);                                                     
        return NULL;                                                      
}                                                                                            
ioctl(args->sock_out, SIOCGIFFLAGS, &ifr_in);                                                
printf("ift_in = %x, IFF_PROMISC = %d\n", ifr_in.ifr_flags, !!(IFF_PROMISC & ifr_in.ifr_flags));


или anonymous тут был прав, и нужен hub?

[upd] конечно нужен! тупой вопрос, тему можно закрывать :)

 linuc,

metawishmaster
()

а поясните за UDP

привет, ЛОР! Всем доброго вечера :)

а поясните мне плиз за такой кусочек кода:

ehdr =  (struct ethhdr *)buffer;
ip = (struct iphdr *)(ehdr + 1);
udp = (struct udphdr *)(ip + 1);
i = 0;
j = ntohs(udp->len) - sizeof(struct udphdr) - 1;

printf("Received %d bytes, udp->len = %d, udp->uh_ulen = %d\n", data_size, udp->len, udp->uh_ulen);

вывод моей фигни:

Received 118 bytes, udp->len = 12761, udp->uh_ulen = 12761

точнее, почему значение len у структуры такое дикое?

 

metawishmaster
()

github, организовать доступ к репозиторию со второго компа

Добрый вечер, ЛОР!

А подскажите, пожалуйста, можно-ли как-то организовать доступ к совственному репозиторию на github'e с правами записи и со второго компа? Что-то мне подсказывает, что нет, так как у них можно вставить только один ключ ssh... Или мeня проглючило?

 ,

metawishmaster
()

покритикуйте небольшой Makefile, пожалуйста

Добрый вечер, ЛОР!
на ночь глядя решил «проапгрейдить» Makefile, который можно было бы использавать как out-of-tree компиляции, так и in-tree

diff --git a/drivers/wdt/Makefile b/drivers/wdt/Makefile
index fa0c0d8..c99c548 100644
--- a/drivers/wdt/Makefile
+++ b/drivers/wdt/Makefile
@@ -1,6 +1,22 @@
 #
 # linux/drivers/wdt/Makefile
 #
-obj-$(CONFIG_VXDX3_WDT0_DEVICE) += wdt0-vxdx3.o
-obj-$(CONFIG_VXDX3_WDT1_DEVICE) += wdt1-vxdx3.o
+
+ifneq ($(KERNELRELEASE),)
+       ifeq ($(CONFIG_VXDX3_WDT0_DEVICE),)
+               CONFIG_VXDX3_WDT0_DEVICE := m
+               CONFIG_VXDX3_WDT1_DEVICE := m
+       endif
+       obj-$(CONFIG_VXDX3_WDT0_DEVICE) += wdt0-vxdx3.o
+       obj-$(CONFIG_VXDX3_WDT1_DEVICE) += wdt1-vxdx3.o
+else
+        KERNELDIR ?= /lib/modules/$(shell uname -r)/build/
+        PWD := $(shell pwd)
+
+all:
+       @$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+
+clean:
+       @$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
+endif

в out-of-tree варианте все ок, а in-tree еще не пробовал - пока нет готового варианта
но что скажете, это будет работать? или есть видимые косяки, не замеченые мной?

 , , ,

metawishmaster
()

дисконнектится IPSec VPN после работы с X-овыми приложениями

Добрый вечер, ЛОР!

до сих под проблемы с IPSec'ом.
подключаюсь - ок, в консоли разные махинации - тоже ок, но стоит запустить X-овое приложение (на Java), через 10 секунд получаю обрыв соединения VPN и такой лог в /var/log/auth.log

Apr  5 19:44:24 ubuntu ipsec_starter[3136]: Starting strongSwan 5.8.2 IPsec [starter]...
Apr  5 19:44:24 ubuntu ipsec_starter[3136]: Loading config setup
Apr  5 19:44:24 ubuntu ipsec_starter[3136]: Loading conn 'cd93fde2-5752-48af-945e-a1e1e6b00a99'
Apr  5 19:44:24 ubuntu ipsec_starter[3147]: Attempting to start charon...
Apr  5 19:44:24 ubuntu ipsec_starter[3147]: charon (3149) started after 20 ms
Apr  5 19:44:25 ubuntu charon: 11[IKE] initiating Main Mode IKE_SA cd93fde2-5752-48af-945e-a1e1e6b00a99[1] to X.X.X.X
Apr  5 19:44:25 ubuntu charon: 14[IKE] IKE_SA cd93fde2-5752-48af-945e-a1e1e6b00a99[1] established between 172.29.2.14[172.29.2.14]...X.X.X.X[X.X.X.X]
Apr  5 19:44:25 ubuntu charon: 15[IKE] CHILD_SA cd93fde2-5752-48af-945e-a1e1e6b00a99{1} established with SPIs c4bd0ced_i efc28ef6_o and TS 172.29.2.14/32[udp] === X.X.X.X/32[udp/l2f]
Apr  5 19:54:25 ubuntu charon: 10[IKE] CHILD_SA cd93fde2-5752-48af-945e-a1e1e6b00a99{2} established with SPIs cfffa0d4_i ffef5617_o and TS 172.29.2.14/32[udp/l2f] === X.X.X.X/32[udp/l2f]
Apr  5 19:54:49 ubuntu charon: 13[IKE] closing CHILD_SA cd93fde2-5752-48af-945e-a1e1e6b00a99{1} with SPIs c4bd0ced_i (4565290675 bytes) efc28ef6_o (274139202 bytes) and TS 172.29.2.14/32[udp] === X.X.X.X/32[udp/l2f]
Apr  5 19:56:27 ubuntu charon: 00[IKE] closing CHILD_SA cd93fde2-5752-48af-945e-a1e1e6b00a99{2} with SPIs cfffa0d4_i (73264 bytes) ffef5617_o (0 bytes) and TS 172.29.2.14/32[udp/l2f] === X.X.X.X/32[udp/l2f]
Apr  5 19:56:27 ubuntu charon: 00[IKE] deleting IKE_SA cd93fde2-5752-48af-945e-a1e1e6b00a99[1] between 172.29.2.14[172.29.2.14]...X.X.X.X[X.X.X.X]
Apr  5 19:56:27 ubuntu ipsec_starter[3147]: child 3149 (charon) has quit (exit code 0)
Apr  5 19:56:27 ubuntu ipsec_starter[3147]: 
Apr  5 19:56:27 ubuntu ipsec_starter[3147]: charon stopped after 200 ms
Apr  5 19:56:27 ubuntu ipsec_starter[3147]: ipsec starter stopped


подскажите, пожалуйста, с чем это может быть связано?

p.s. сервер на 4-ом Devuan'е, клиент на Ubuntu 20.04.4

 , , ,

metawishmaster
()

проблема с iptables при создании VPN-подключения

всем доброго дня!

пытаюсь настроить VPN на <host>, но коннекшин обламывается с криком «NetworkManager[6838]: received UNSUPPORTED_CRITICAL_PAYLOAD error notify» и еще сверзу есть строчка «charon: 13[IKE] KE payload missing in message» (не знаю, имеет ли это значение).

машина, с которой инициируется подключение, сидит за натом, но на серваке сделал так:

$iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
$iptables -A INPUT -p udp --dport 500 -j ACCEPT
$iptables -A INPUT -p udp --dport 4500 -j ACCEPT
$iptables -A INPUT -p esp -j ACCEPT
$iptables -A INPUT -p ah -j ACCEPT
map_port ubuntu.metanet 500 500 
map_port ubuntu.metanet 4500 4500
map_port ubuntu.metanet 1701 1701

еще пытаюсь подменить адрес, как написано тут: https://partners-intl.aliyun.com/help/en/doc-detail/65802.htm
$iptables -t nat -A POSTROUTING -s $LOCAL_NET -o eth0 -m policy --dir out --pol ipsec -j ACCEPT
$iptables -t nat -A POSTROUTING -m policy --pol ipsec --dir out -j ACCEPT
$iptables -t nat -A PREROUTING -i eth1 -p udp -d <host> --dport 500 -j DNAT --to-destination 172.29.2.14
$iptables -t nat -A PREROUTING -i eth1 -p udp -d <host> --dport 4500 -j DNAT --to-destination 172.29.2.14
$iptables -A FORWARD -p udp -d 172.29.2.14 --dport 500 -j ACCEPT
$iptables -A FORWARD -p udp -d 172.29.2.14 --dport 4500 -j ACCEPT
$iptables -t nat -A POSTROUTING -p udp -s 172.29.2.14 --sport 500 -j SNAT --to-source <host>
$iptables -t nat -A POSTROUTING -p udp -s 172.29.2.14 --sport 4500 -j SNAT --to-source <host>

но в дмесге получаю сабжевую ошибку %(

charon: 14[IKE] received UNSUPPORTED_CRITICAL_PAYLOAD error notify

подскажите, плиз, где я налажал?

 ,

metawishmaster
()

подскажите, плиз зарядку от солнечных батарей [нетематический вопрос]

всем добрый день! :)

возникла потребность в походах не оставаться без связи, всвязи с чем решил посмотреть на солнечные зарядные устройства

нашел пока только такое, по количеству выходов (и вариантов потребителей) подходит под требуемые критерии, и вроде как, заряжать может много чего, но может кто знает, какие недостатки/косяки у девайса? или варианты по-лучше?

 

metawishmaster
()

как в bind'e привязать существующие IP к несушествующим именам

добрый день

у меня такая проблема, есть список имён и соответствующие им внешние IPшники класса А, всё дело решается прописыванием в /etc/hosts на каждой машине моей подсети, но это геморно, «неспортивно» и неправильно (раз уж у меня есть собственный сервер с bind)

такое есть в /etc/hosts

IP1    srv.comp.dom
IP1    sub1.srv.comp.dom
...
IP1    sub7.srv.comp.dom
IP2    sub8.srv.comp.dom

т.е., тут и верхний уровень вымышленный

как пытался я:
в /etc/bind/named.conf прописал
zone "dom" {
    type master;
    file "/etc/bind/db.dom";
};


/etc/bind/db.dom:
$TTL    604800
@   IN  SOA srv.comp.dom. root.srv.comp.dom. (
                  2     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
    IN  NS  192.168.2.3
@   IN  A   IP1

;srv                     IN  A   IP1
sub1                    IN  A   IP1
sub2                    IN  A   IP1
sub3                    IN  A   IP1
sub4                    IN  A   IP1
sub5                    IN  A   IP1
sub6                    IN  A   IP1
sub7                    IN  A   IP1
sub8                    IN  A   IP2


p.s.
и вот еще только что увидел:
$ sudo named-checkzone srv.comp.dom /etc/bind/db.dom
/etc/bind/db.dom:36: NS record '192.168.2.3' appears to be an address
zone srv.comp.dom/IN: NS '192.168.2.3.srv.comp.dom' has no address records (A or AAAA)
zone srv.comp.dom/IN: not loaded due to errors.

значит вместо своего внутреннего IPшника я должен прописать внешний с тамошним IP?

p.s. сразу прошу прощения за нубские вопросы :)

 

metawishmaster
()

$$ в C-коде

доброго дня, ЛОР! :)

смотрю примеры из MCUXpresso, но встретился с неизвестной мне конструкцией...
кто знает, что за фигня в «extern uint32_t Image$$RW_m_ncache$$Base[];»?

когда туда завезли «$$», и что это такое? %)

p.s. с виду похоже на какую-то новую фишку препроцессора...

 ,

metawishmaster
()

ssh к виртуалке на selvpc.ru

подскажите, плиз, реально ли присобачить нормальный ssh доступ к сабжевой виртуалке? так, чтоб без богонеугодного веб-интерфейса, а сразу из консоли коннектиться с ssh? я потыкался часик, и мне всё показалось совсем уж безысходно %(

 

metawishmaster
()

как проверить 9bit на lpuart

доброй ночи, ЛОР!

а подскажите, пожалуйстта, как из user space можно проверить передачу/приём данных, когда размер байта равен 9-ти битам?
и как этот размер установить?
// насколько я понял, речь идёт не о «простом» использовании бита чётности в качестве девятого, или я не прав?

 ,

metawishmaster
()

MDB и lpuart

Добрый вечер, ЛОР!

а расскажите, плиз, про MultiDrop Bus на lpuart (9bit mode)
например, как получить список адресов устройств? пока что вижу только вариант с попыткой поочередно обратиться по адресам 00h, 08h, 10h...D8h, но как и какого ответа ждать?

 ,

metawishmaster
()

undefined reference to `fork'

доброй ночи, форумчане!

на ночь глядя столкнулся с такой проблемой, при сборке drobear'a для arm-uclibc, получаю такую фигню:

arm-v7-linux-uclibceabi-gcc  -o dropbear dbutil.o buffer.o dss.o bignum.o signkey.o rsa.o random.o queue.o atomicio.o compat.o  fake-rfc2553.o common-session.o packet.o common-algo.o common-kex.o common-channel.o common-chansession.o termcodes.o loginrec.o tcp-accept.o listener.o process-packet.o common-runopts.o circbuffer.o svr-kex.o svr-algo.o svr-auth.o sshpty.o svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o svr-tcpfwd.o svr-authpam.o  libtomcrypt/libtomcrypt.a libtommath/libtommath.a -lutil  -lcrypt
svr-main.o: In function `main_noinetd':
svr-main.c:(.text+0x43c): undefined reference to `fork'
dbutil.o: In function `spawn_command':
dbutil.c:(.text+0x908): undefined reference to `fork'
svr-chansession.o: In function `sessioncommand.part.0':
svr-chansession.c:(.text+0x748): undefined reference to `fork'
collect2: error: ld returned 1 exit status
make: *** [Makefile:158: dropbear] Error 1


кто скажет в чем засада?

 , ,

metawishmaster
()

apache2 + SSL Let's Encrypt == нехотитъ

Добрый день, ЛОР!

есть сабжевая проблемка, которую уже сутки как не могу решить... вот что я сделал:

sbauer@blackbox ~$ sudo certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: blackbox.su
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blackbox.su
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/000-default-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/000-default-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/apache2/sites-enabled/000-default.conf to ssl vhost in /etc/apache2/sites-available/000-default-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://blackbox.su

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=blackbox.su
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/blackbox.su-0002/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/blackbox.su-0002/privkey.pem
   Your cert will expire on 2021-08-21. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le


вот содержимое получившихся файликов:
000-default-le-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost blackbox.su:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
    SCGIMount /RPC2 127.0.0.1:5000

    SuexecUserGroup dspam dspam
    Addhandler cgi-script .cgi
    Options +ExecCGI -Indexes

    Alias /dspam /var/www/dspam/
    <Directory /var/www/dspam/>
        Addhandler cgi-script .cgi
        Options +ExecCGI -Indexes
        DirectoryIndex dspam.cgi

        AuthType Basic
        AuthName "DSPAM Control Center"
        AuthUserFile /etc/dspam/webfrontend.htpasswd
        Require valid-user

        AllowOverride None
    </Directory>


ServerName blackbox.su
SSLCertificateFile /etc/letsencrypt/live/blackbox.su-0002/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/blackbox.su-0002/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>


и 000-default.conf
<VirtualHost blackbox.su:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
    SCGIMount /RPC2 127.0.0.1:5000

    SuexecUserGroup dspam dspam
    Addhandler cgi-script .cgi
    Options +ExecCGI -Indexes

    Alias /dspam /var/www/dspam/
    <Directory /var/www/dspam/>
        Addhandler cgi-script .cgi
        Options +ExecCGI -Indexes
        DirectoryIndex dspam.cgi

        AuthType Basic
        AuthName "DSPAM Control Center"
        AuthUserFile /etc/dspam/webfrontend.htpasswd
        Require valid-user

        AllowOverride None
    </Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =blackbox.su
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<Directory "/var/www/dspam">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AddHandler cgi-script .pl
    Order allow,deny
    allow from all
</Directory>
<Files ~ "\.(pl|cgi)$">
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    Options +ExecCGI
    PerlSendHeader On
</Files>

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory "/var/www/dspam" >
####(The Perl/CGI scripts can be stored out of the cgi-bin directory, but that's a story for another day. Let's concentrate on washing out the issue at hand)
####
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

#ScriptAlias /cgi-bin/ "/var/www/dspam"

<Directory "/var/www/dspam">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AddHandler cgi-script .pl
    Order allow,deny
    allow from all
</Directory>

<Files ~ "\.(pl|cgi)$">
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    Options +ExecCGI
    PerlSendHeader On
</Files>



но ssllabs говорит, что все мои скромные потуги тщетны,


No secure protocols supported - if you get this message, but you know that the site supports SSL, wait until the cache expires on its own, then try again, making sure the hostname you enter uses the «www» prefix (e.g., "http://www.ssllabs.com", not just «ssllabs.com»).


но такая же фигня и с одним http://www.blackbox.su, и с парой «sudo certbot --apache -d blackbox.su,http://www.blackbox.ru»

порты 80 и 443 открыты, апачевские моды ssl и gnutls включены, но
что еще мог упустить из виду такой хреновый админ локалхоста??

 

metawishmaster
()

из visa.so сделать visa.a

доброй ночи всем.

а возможно-ли провернуть сабжевый финт ушами? а-то статическая библиотека не распростаняется и код (от National Intruments) проприетарный...

 

metawishmaster
()

непонятки с clock_getres

доброй ночи, ЛОР! не подскажете, что за непонятки с clock_getres? программка такая:

#define _POSIX_C_SOURCE 199309L                                                     
#include <stdio.h>                                                                  
#include <time.h>                                                                   
                                                                                    
int main()                                                                          
{                                                                                   
    struct timespec ts;                                                             
                                                                                    
    clock_getres(CLOCK_REALTIME, &ts);                                              
    printf("CLOCK_REALTIME resolulion is %d.%09ld\n", ts.tv_sec, ts.tv_nsec);       
                                                                                    
    clock_getres(CLOCK_MONOTONIC, &ts);                                             
    printf("CLOCK_MONOTONIC resolulion is %d.%09ld\n", ts.tv_sec, ts.tv_nsec);   
}
и ее выхлоп: $ ./clock_getres

CLOCK_REALTIME resolulion is 0.000000001

CLOCK_MONOTONIC resolulion is 0.000000001

что за мизерное значение? не может же прерывание от таймера работать с такой частотой, или это всё из-за «CONFIG_NO_HZ=y»?

 ,

metawishmaster
()

RSS подписка на новые темы