Показ дописів із міткою Linux. Показати всі дописи
Показ дописів із міткою Linux. Показати всі дописи

вівторок, 28 вересня 2021 р.

Backup btrfs. Transfer snapshots to files on an external drive.


 And yes, we have:

  1. SanDisk 64GB usb3.1 USB stick with exFat partition with the LABEL "sunbeam".
  2. My not very old LinuxBox with usb-port usb2.0.
  3.  /.snapshots/root-2021-09-27 - Snapshot of the partition with the root of the operating system.
  4.  /.snapshots/var-2021-09-27 - Snapshot of the /var partition with OS variables.

To transfer a snapshot to a file on an external USB drive, use the command:


% sudo sh -c "btrfs send /.snapshots/root-2021-09-27 >| /run/media/user/sunbeam/root-2021-09-27.bin ; sync"


or


% sudo sh -c "btrfs send -f /run/media/user/sunbeam/root-2021-09-27.bin /.snapshots/root-2021-09-27 ; sync"


And for a snapshot of the /var partition:


% sudo sh -c "btrfs send /.snapshots/var-2021-09-27 >| /run/media/user/sunbeam/var-2021-09-27.bin ; sync"


or


% sudo sh -c "btrfs send -f /run/media/user/sunbeam/var-2021-09-27.bin /.snapshots/var-2021-09-27 ; sync"


After the operation, we check the availability of the files we need (In my case, transferring a snapshot

 of a root partition to external media took 45 minutes.) :


% ls -lah /run/media/user/sunbeam

-rwxr-xr-x 1 user users 7.7G Sep 27 21:38 root-2021-09-27.bin

-rwxr-xr-x 1 user users 421M Sep 28 10:53 var-2021-09-27.bin


You can now delete these snapshots from linuxbox using the appropriate btrfs subvolume delete 

command. And if necessary, restore them with the command:


% sudo sh -c "btrfs receive -f /run/media/user/sunbeam/root-2021-09-27.bin /.snapshots/ ; sync"


or


% sudo sh -c "cat /run/media/user/sunbeam/root -2021-09-27.bin |btrfs receive /.snapshots/ ; sync"


And accordingly for a /var snapshot:


% sudo sh -c "btrfs receive -f /run/media/user/sunbeam/var-2021-09-27.bin /.snapshots/ ; sync"


or


% sudo sh -c "cat /run/media/user/sunbeam/var-2021-09-27.bin |btrfs receive /.snapshots/ ; sync"


неділя, 2 серпня 2020 р.

Fedora 32 Minimal on the Orange Pi Zero plus.

<< Previos


Orange Pi Zero plus can be configured for use as a wifi router or webcam as a NAS or small CCTV server. For him, there are very few images are FreeBSD, NetBSD, openWRT and Armbian. In my opinion, the most adapted Armbian (My respect for its developers). Most ARM-Linux distributions are limited to images for the raspberri-pi and Pine-64 platforms. I was interested in one thing, I will not name it, it is my secret, which is well done in Fedora Linux. I will not describe everything in detail, I will only say that comparing the codes from Kernel.org and the Armbian repository, the difference was crazy, about 6,000 files differed. Therefore, it was not possible for me to view all this and I limited myself to what is needed for Orange Pi Zero plus. The patches I chose can be found here. The Fedora-32-Minimal disk image I created for Orange Pi Zero plus can be found here.

(md5

f593464dd183b808d83c88e3316bd651 *Fedora-Minimal-32-1.6.OrangePiZeroplus.aarch64.raw.xz

sha256

39c1ed484d6f9957eb9bdf05efe5441d2a257474e0a2240b8933a0d4262dfe21 *Fedora-Minimal-32-1.6.OrangePiZeroplus.aarch64.raw.xz)



 I added WiFi support and CPU recognition. SELinux enabled and secure boot works perfectly. Rpm packages compiled using% fedpkg local are located in the user's home directory. You can try to run the OS on a disk on other platforms with Allwinner a64, H5, H6 (the boot may not work if the Device Tree is radically different).


(write image: 

% sudo sh -c "xzcat Fedora-Minimal-32-1.6.OrangePiZeroplus.aarch64.raw.xz |dd of=/dev/sdX bs=4M iflag=fullblock oflag=direct status=progress; sync" 

replace sdX with the device name of your SD card) 


The loading lasts about 50 seconds, the indicators do not light up, the end of the loading can be observed on the network card when the Network Manager tries to configure the network. Login via SSH over Ethernet. We find the IP address using nmap (for example: # nmap -sP 172.31.255.1/24 where instead of 172.31.255.1 you specify the IP of the router of your local network, and instead of 24 the size of the mask of your subnet) login: poltawer (aka root), password: Fedora.


Original Fedora 32 Minimal aarch64 image , kernel package and uboot 


How do I create the disk image ^^^^^^

понеділок, 27 квітня 2020 р.

How I ran Fedora 31 Minimal on an Orange Pi zero plus.

                                                                                                                                                      next >>

I create image Fedora 31 Minimal for Orange Pi zero plus. Summary of the changes I made during installation Fedora.
  1. Add swap file 2GB
  2. Installing my custom kernel
  3. Disable SELinux
  4. Create administrator (user name: ‘poltawer’, password: ‘Fedora’)
(Warning: I don't know how loaded in kernel a dtb overlays, because something is not working. For example GPIO. I'll be grateful for your help in this matter)

 Download image
Demo
  1. Fedora installer Dracut needs 2GB of RAM, Orange Pi zero plus has only 500MB. IMHO is three variants for solving problems. For the first I do not have enough money, the second is questionable, and the third is what I did, if someone was interested in it then I will describe in the next post.
  2. I get the source from git Armbian and kernel.org and create a patch. Now, these .patch files are a shame to show, I have to clean them, I hope everything will be fine and I'll post them. In the Fedora kernel config file, I made some changes relative to the Orange Pi architecture. And build a kernel.
  3. Secure Boot doesn’t loaded unsigned kernel. Fedora Team or the system owner can sign the kernel. I hope my work is useful for someone, so it would not be ethical to put my private key in someone else's system. So if you need Secure Boot and you trust me, you can sign my kernel with your key or use native kernel or builded your own signed kernel.
  4. To secure your system change the user name and password. And enjoy!

понеділок, 28 грудня 2015 р.

SkyStar 2 eXpress HD w Linux


Zbiórka i instalacja modułów jadra dla dvb-karty SkyStar 2 eXpress HD. Jak to zrobić jest opisano w tym wiki.
Dla SUSE to niczym się nie odróżnia ale ja opisze swój wariant.
Najpierw budujemy swoje środowisko developerskie, dla tego z konta root wykonujemy następne komendy

# zypper in -t pattern devel_C_C++ devel_basis devel_kernel devel_perl devel_rpm_build
# zypper in mercurial



Kiedy zostanie wszystko zainstalowane wracamy do zwykłego użytkownika, ściągamy źródła i budujemy moduł Perl Proc::ProcessTable. Ten moduł nam potrzebny będzie przy zbiórce modułów jadra.


$ wget -P Downloads/ http://search.cpan.org/CPAN/authors/id/J/JW/JWB/Proc-ProcessTable-0.53.tar.gz
$ mkdir stuff
$ cd stuff/
$ tar -zxvf ~/Downloads/Proc-ProcessTable-0.53.tar.gz
$ cd ~/stuff/Proc-ProcessTable-0.53
$ perl Makefile.PL
$ make
$ make test
$ su -
# cd /home/user/stuff/Proc-ProcessTable-0.53
# make install

  Teraz można przestępować do budowania modułów dla dvb-kart
$ cd ~/stuff
$ hg clone http://linuxtv.org/hg/%7Eendriss/media_build_experimental_work
$ cd media_build_experimental_work
$ make download
$ make untar
$ make
$ su -
# cd /home/user/stuff/media_build_experimental_work
# make install 


Po instalacje przeładujemy komputera i u nas musi się zjawić urządzenie /dev/dvb/adapter0


$ ls -R /dev/dvb

/dev/dvb:
adapter0

/dev/dvb/adapter0:
demux0 dvr0 frontend0 net0

.
Żeby to przetestować potrzebujemy oprogramowania dla oglądania telewizji, temu dodajemy repozytorium packman i instalujemy niezbędne pakiety. Tutaj można przeczytać o dodatkowych repozytoriach 



# zypper ar -f -n packman http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_13.2/ packman
# zypper in dvbcut dvbsnoop dvbstream dvb vdr



Najpierw otrzymujemy spisek kanałów przy pomoce dvbscan

$ dvbscan -s 3 /usr/share/dvb/dvb-s/Astra-19.2E > Astra-`date +%F`.conf

using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
ERROR: cannot parse'S2 10729000 V 22000000 2/3 8PSK
'
initial transponder 10744000 H 22000000 5
initial transponder 10759000 V 22000000 5
ERROR: cannot parse'S2 10773000 H 22000000 3/4 8PSK
'
initial transponder 10788000 V 22000000 5
ERROR: cannot parse'S2 10803000 H 22000000 3/4 8PSK
8< ------ 8< ------ 8< ------ 8< ------ 8<
nieco wycięto
8< ------ 8< ------ 8< ------ 8< ------ 8<
DVB-S IF freq is 1841000
Network Name 'ASTRA 1'
0x044e 0x1965: pmt_pid 0x0064 CSAT -- NAT GEO WILD (???, scrambled)
0x044e 0x1966: pmt_pid 0x00c8 CSAT -- MEZZO LIVE (???, scrambled)
0x044e 0x1967: pmt_pid 0x012c CSAT -- M6 MUSIC (???, scrambled)
0x044e 0x1968: pmt_pid 0x0190 CSAT -- DJAZZ.TV (???, scrambled)
0x044e 0x1969: pmt_pid 0x01f4 CSAT -- SERIE CLUB (???, scrambled)
0x044e 0x196a: pmt_pid 0x0258 CSAT -- OCS MAX (???, scrambled)
8< ------ 8< ------ 8< ------ 8< ------ 8<


W rezultacie otrzymujemy plik Astra-2015-12-27.conf, co mieści świeże listę kanałów zdjęte z 4-go portu DiSEqC-a (opcja -s 3). Сzyli liczba idzie od zera, dla przykładu do 1-go portu DiSEqC-a u mnie podłączona głowica naprawiona na satelitę Amos 4W, dla niej będę wykorzystana opcja -s 0.


$ dvbscan -s 0 /usr/share/dvb/dvb-s/Amos-4w > Amos-`date +%F`.conf

U Państwa mogę być ustawione głowicy na inne porty DiSEqC-a, temu opcje -s będę swoje. Pliki z danymi satelitów zawarte w katalogu /usr/share/dvb/dvb-s/, z tego tez trzeba wybrać swój.

Po zakończeniu skanowania przeglądamy otrzymane pliki

$ cat /home/user/Hotbird-2015-12-27.conf

Discovery Channel:10719:v:2:27500:175:140:4416
TVP Regionalna:10719:v:2:27500:170:120:4411
TVP INFO:10719:v:2:27500:169:116:4410
TVS:10719:v:2:27500:162:88:4403
KINO POLSKA:10719:v:2:27500:164:96:4405
TV PULS:10719:v:2:27500:171:124:4462
TV PULS:10719:v:2:27500:171:124:4412
TVP SPORT:10719:v:2:27500:161:84:4402
8< ------ 8< ------ 8< ------ 8< ------ 8<

Widzimy mnóstwo znalezionych kanałów, próbujemy podłączyć się do jednego z nich,do kanału TV PULS za pomocą szap.

$ szap -r -x -c /home/user/Hotbird-2015-12-27.conf TV\ PULS

reading channels from file '/home/user/Hotbird-2015-12-27.conf'
zapping to 6 'TV PULS':
sat 2, frequency = 10719 MHz V, symbolrate 27500000, vpid = 0x00ab, apid = 0x007c sid = 0x116e
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
status 1f | signal 9999 | snr 6058 | ber 00000000 | unc 00000000 | FE_HAS_LOCK

Jeżeli w końcu wyświetlonego wiersza otrzymujemy FE_HAS_LOCK, to kanał jest podłączony, wszystko pracuje i możemy zdejmować video-strumienie i patrzeć telewizje satelitarne. Jak to zrobić napisze następnym razem.


# zypper in tvheadend tvheadend-debuginfo vlc vlc-codecs phonon-backend-gstreamer phonon-backend-vlc
# zypper in kodi kodi-pvr.addons