LoginSignup
0
0

More than 1 year has passed since last update.

raspberry pi 4 で EndeavourOS を USBハードディスクのみで起動

Last updated at Posted at 2021-05-17
前回raspberry pi 4B にmanjaroをインストールしましたが、このKDEのplasmaで実に扱いにくい。
そのためEndeavourをいれました。Endeavourは賢人の集まりでスッキリと美しい、しかもubuntuと比べてはっきりと速く動く 
参考は https://archlinuxarm.org/wiki/Raspberry_Pi ですが 難しい 
狭い門から入れ。滅びに通じる門は広く、その道も広々として、そこから入る者が多い。しかし、命に通じる門はなんと狭く、その道も細いことか。それを見いだす者は少ない。   んでEndeavourOSを選択


最終的には 1番慣れ親しんだxfce4にしてます
$ uname -ar
Linux rpi4 5.10.39-2-ARCH #1 SMP Thu May 27 14:24:08 UTC 2021 armv7l GNU/Linux

1.jpg

$ free
               total        used        free      shared  buff/cache   available
Mem:         1909884      314868     1160988       82964      434028     1486332
Swap:        **8191996**           0     8191996



---
$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
dev               819524        0    819524   0% /dev
run               954940     1132    953808   1% /run
/dev/sda2      487772040(約480DB) 22011404 446074576   5% /
tmpfs             954940        0    954940   0% /dev/shm
tmpfs             954944     8028    946916   1% /tmp
/dev/sda1         264024    39584    224440  15% /boot
tmpfs             190988       84    190904   1% /run/user/1000

-------

head /etc/sddm.conf.d/sddm.conf 
[Autologin]
Relogin=false
Session=xfce.desktop
User=arm
[General]



----

$ ./comment-out.bat temp.bat 
while true
do
/opt/vc/bin/vcgencmd measure_temp
sleep 10
done

$ ./temp.bat 
temp=56.4'C





今のRPI4 2GBの姿は
12.jpg

RPI4 4GBの姿は
2.jpg

1) マイクロSDカードの場合

起動風景は はやくない 16GBのマイクロSDカードで 60秒前後だったので
もうちょっと速い 32GBマイクロSDカードにddすると
30秒くらいになりました。
例えば sandiskの extrem いいだろねー

起動風景は以下

2.jpg

https://arm.endeavouros.com/automated-base-install/
のとおりです

自分は
NEC express5800 のうえの  Intel(R) Pentium(R) CPU G3220 @ 3.00GHz
つまり armではない manjaro linux で上のことをしました

./install-image-V2.5.sh

2.jpg

すると


ArchLinuxARM-rpi-aarch64-latest. 100%[========================================================>] 560.86M   526KB/s 時間 25m 43s  

2021-05-17 03:46:46 (372 KB/s) - `ArchLinuxARM-rpi-aarch64-latest.tar.gz' へ保存完了 [588107704/588107704]
Untarring the image...may take a few minutes.
syncing files...may take a few minutes.
Almost done! Just a couple of minutes more for the last step.
End of script!
Be sure to use a file manager to umount the device before removing the USB SD reader

The default user is alarm with the password alarm
The default root password is root

となります。

The default user is alarm with the password alarm
The default root password is root

が大事ですね

あとは
https://arm.endeavouros.com/endeavouros-arm-install/
に従います

自分の場合は lxqt でautologin してます
情報を書きます

[root@rpi4 arm]# pacman -Q | grep lightdm
と 古いlightdmは のけ

[root@rpi4 arm]# pacman -Q | grep sddm
sddm 0.19.0-6
と 新しいsddmにしてます
---


head -20 /etc/sddm.conf.d/sddm.conf 
で自動ログイン設定です
[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false
# Name of session file for autologin session (if empty try last logged in)
Session=lxqt.desktop
# Username for autologin session
User=arm
[General]
# Halt command
HaltCommand=/usr/bin/systemctl poweroff
# Input method module
以下略





# df
Filesystem     1K-blocks    Used Available Use% Mounted on
dev              1899160       0   1899160   0% /dev
run              1938036    1024   1937012   1% /run
/dev/mmcblk1p2  14656392 5923008   7967076  43% /
tmpfs            1938036       0   1938036   0% /dev/shm
tmpfs            1938036    7920   1930116   1% /tmp
/dev/mmcblk1p1    264024  100224    163800  38% /boot
tmpfs             387604      56    387548   1% /run/user/1000
と 手元なあった 名も無き16GBのマイクロSDカードでしてます
でも 43% しか使ってませんね


----

top - 04:15:36 up 14 min,  2 users,  load average: 0.02, 0.06, 0.07
Tasks: 155 total,   1 running, 154 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   3785.2 total,   3154.3 free,    255.6 used,    375.2 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   3463.0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND  
   1090 root      20   0   10608   3492   2936 R   0.7   0.1   0:00.05 top      
      1 root      20   0  100600  10008   7656 S   0.0   0.3   0:03.88 systemd  
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd 
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp 
と swap 今はないですが メモリも 3.1GB空いてます


あとは
1-a) fcitx-mozc を導入して日本語入力OK
1-b) gpartedで領域拡張
1-c) /SWAPでファイルスワップの導入でした

こうして 4Gメモリの ラズパイ4で動かした 32GBマイクロSDを
2Gメモリの ラズパイ4 につけたらそのまま動いた

ここでは USB wifiをつけている

---

# ifconfig 
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.188.30  netmask 255.255.255.0  broadcast 192.168.188.255

---

top - 12:04:38 up 8 min,  2 users,  load average: 0.05, 0.22, 0.18
Tasks: 170 total,   1 running, 169 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.0 sy,  0.0 ni, 99.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   1840.1 total,   1101.1 free,    353.5 used,    385.6 buff/cache
MiB Swap:   4000.0 total,   4000.0 free,      0.0 used.   1442.3 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND         
    961 root      20   0       0      0      0 I   0.3   0.0   0:00.17 kworker/u8:4-p+ 
   1739 root      20   0   10748   3520   2928 R   0.3   0.2   0:00.03 top             
      1 root      20   0  100604  10124   7696 S   0.0   0.5   0:04.00 systemd         
      2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd        
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp   

---

# df
Filesystem     1K-blocks     Used Available Use% Mounted on
dev               903260        0    903260   0% /dev
run               942136     1096    941040   1% /run
/dev/mmcblk1p2  30649224 10568180  18678276  37%  / <---ここだ
tmpfs             942136        0    942136   0% /dev/shm
tmpfs             942136        8    942128   1% /tmp
/dev/mmcblk1p1    264024   100224    163800  38% /boot
tmpfs             188424       60    188364   1% /run/user/1000

0-udon.gif


2) USB ハードディスクの場合は

https://forum.endeavouros.com/t/arm-raspberry-pi-4-series-boot-from-usb-device/12135
をみると

1.jpg

なので 特定のものでしか 動かないようです


The 8GB model probably isn’t what you think it is.
The RPi4 SOC (System On a Chip) can only directly address up to 4 GB. 
On the 8 GB model the second 4 GB cannot be directly accessed by the CPU and to utilize it is more involved. The second 4 GB could be used as ram disk, temporary storage for large amounts of data, such as a huge spread sheet, etc.


So at this point, the RPI4 4GB will run a 64 bit OS and the 8GB model will not. 
Although the 64 bit OS is still kinda flakey at times and I recommend the 32 bit OS.

Both 4GB and 8GB will run a 32 bit OS perfectly fine. 
FYI the 32 bit OS will also boot and run from an external USB SSD, the 64 bit OS not so much.

も凄い。

32ビット版だと

2.jpg

とのよし

したがって 32ビット版をトライすべきで これならUSBハードディスクから しかも2Gメモリで成功実績がったゆえやってみたところ、 事実自分も気持ちよく起動できました。

ただ 今の所ボード上のwifi と picameraは使えてまえんが、USB wifi をさせば支障はないです

1)すでに USB ハードディスクから起動できるようにしていた 2GB Rpi4です

2)まず マイクロSDカードに導入

3)これを ddにて USB ハードディスクにクローン

4)fsckを USB ハードディスクの
2つの領域にかける

5)第一領域の
cmdline.txtを
root=/dev/sda2 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200
とする

この後 lxqt立ち上げてから いろいろして以下になりました。

特定の USB ハードディスク スタンドでしかうまく行かないです! ご注意ご注意!


# df
Filesystem     1K-blocks    Used Available Use% Mounted on
dev               819528       0    819528   0% /dev
run               954940    1088    953852   1% /run
/dev/sda2      150556552 7072688 137282404   5% /
## ルートは150GBあります
tmpfs             954940       0    954940   0% /dev/shm
tmpfs             954944    8012    946932   1% /tmp
/dev/sda1         264024   39560    224464  15% /boot
tmpfs             190988      56    190932   1% /run/user/1000



--------------

$ ./comment-out.bat /etc/fstab 

/dev/sda1  /boot    vfat    defaults        0       0
dev/sda3    swap    swap    defaults,noatime 0 1


-------
$ free
               total        used        free      shared  buff/cache   available
Mem:         1909884      264472     1073304       47340      572108     1572360
Swap:        5119828           0     5119828
と Swapは5GB超です


---

ls /boot/
bcm2708-rpi-b.dtb     bcm2835-rpi-b-rev2.dtb    fixup4db.dat
bcm2708-rpi-b-plus.dtb    bcm2835-rpi-cm1-io1.dtb   fixup4x.dat
bcm2708-rpi-b-rev1.dtb    bcm2835-rpi-zero.dtb      fixup_cd.dat
bcm2708-rpi-cm.dtb    bcm2835-rpi-zero-w.dtb    fixup.dat
bcm2708-rpi-zero.dtb      bcm2836-rpi-2-b.dtb       fixup_db.dat
bcm2708-rpi-zero-w.dtb    bcm2837-rpi-3-a-plus.dtb  fixup_x.dat
bcm2709-rpi-2-b.dtb   bcm2837-rpi-3-b.dtb       initramfs-linux.img
bcm2710-rpi-2-b.dtb   bcm2837-rpi-3-b-plus.dtb  kernel7.img
bcm2710-rpi-3-b.dtb   bcm2837-rpi-cm3-io3.dtb   overlays
bcm2710-rpi-3-b-plus.dtb  bootcode.bin          start4cd.elf
bcm2710-rpi-cm3.dtb   cmdline.txt           start4db.elf
bcm2711-rpi-400.dtb   start4.elf
bcm2711-rpi-4-b.dtb   cmdline.txt-OK-0525       start4x.elf
bcm2711-rpi-cm4.dtb   cmdline.txt.pacnew        start_cd.elf
bcm2835-rpi-a.dtb     config.txt            start_db.elf
bcm2835-rpi-a-plus.dtb    config.txt.bkup       start.elf
bcm2835-rpi-b.dtb     fixup4cd.dat          start_x.elf
bcm2835-rpi-b-plus.dtb    fixup4.dat

---
# cat /boot/cmdline.txt
root=/dev/sda2 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200




この起動風景は
https://www.youtube.com/watch?v=V7L_kFBFK1E

https://wiki.archlinux.jp/index.php/SDDM
は sddmの基本情報


 cat image-install/README.md 
# image-install
Install ARM images for select SBC devices.

Currently, this will work on the Odroid N2 / N2+ the Odroid XU4 and the Raspberry Pi 4 series


    On a working Linux computer, the faster the better, insert the USB
    card reader containing the micro SD or eMMC card or external USB SSD enclosure
      Odroid N2 and Odroid XU4 the choices are micro SD card or eMMC card
      Raspberry Pi model 4b 4GB ram 64 bit OS is micro SD card only
      Raspberry Pi model 4 series 32 bit OS the choices are micro SD or external USB SSD

    IMPORTANT: Make sure ALL apps are closed, especially any file manager such as Thunar.

    Open a terminal window, for best results resize the window to 130 x 30 minimum or full screen
    In your home directory, create a Temporary directory

    $ mkdir Temp
    $ cd Temp
    $ git clone https://github.com/endeavouros-arm/image-install.git

    $ cd image-install

    $ ls -l

    Check if install-image-V2.X.sh is executable. If not make it executable.

    $ sudo ./install-image-V2.X.sh

    When completed, use a file manager to unmount the USB card reader.

3) like the Arch Linux way  ( https://www.youtube.com/watch?v=WoiFiak4bYM )

https://forum.endeavouros.com/t/install-endeavouros-on-raspberry-pi-4/14727
な方法もあります

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0