qemu-user-static
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
Raspiでx86バイナリを動かす
https://thepi.io/how-to-run-x86-programs-on-the-raspberry...
Step 1: Run this command
#
apt-get update && apt-get install qemu qemu-user qemu-us...
Step 2: Create a folder for your chroot.
Tip: Use mount –bind for proper df support within the en...
#
mkdir /chroot
mkdir /tmp/mnt/
mount –bind /chroot /tmp/mnt/
Step 3: Run debootstrap in the chroot dir. This can be d...
#
cd /tmp/mnt/
debootstrap –foreign –arch i386 sid ./ http://httpredir....
Step 4: The previous step only ran the first half of deb...
#
mount -t sysfs sys sys/
mount -t proc proc proc/
mount –bind /dev dev/
mount –bind /dev/pts dev/pts/
mount –bind /dev/shm dev/shm/
cp /usr/bin/qemu-i386-static usr/bin/
Step 5: Now we execute the chroot for the first time and...
#
chroot . /debootstrap/debootstrap –second-stage
Step 6: The environment is complete! Now we enter the en...
#
chroot ./ /bin/bash –login -i
Tips:
A few environment variables may be set wrong when first ...
#
export LANGUAGE=”C”
export LC_ALL=”C”
unset HOME
export HOME=/root/
source ~/.bashrc
source ~/.profile
The easiest way to do this so you don’t have to set thos...
chroot ./ /usr/sbin/sshd
Then just SSH localhost with the alternate port. Keep in...
#
ssh -xY root@localhost -p myportnumber
You will have to remount the chroot + special directorie...
To make the script:
#
nano /usr/bin/chrootmount
This will open nano and tell it to create a file in /usr...
#!/bin/bash
mkdir /tmp/mnt/
mount –bind /chroot /tmp/mnt/
mount -t sysfs sys /tmp/mnt/sys/
mount -t proc proc /tmp/mnt/proc/
mount –bind /dev /tmp/mnt/dev/
mount –bind /dev/pts /tmp/mnt/dev/pts/
mount –bind /dev/shm /tmp/mnt/dev/shm/
chroot /tmp/mnt/ /usr/sbin/sshd
Now save the script (Ctrl+X, Y) and chmod it to 755 so i...
If you created the script in the previous tip and want t...
#
nano /etc/systemd/system/chrootmount.service
This will open nano once more. Now add the following:
[Unit]
Description = mounts chroot on boot
[Service]
Type=one-shot
ExecStart=/usr/bin/chrootmount
[Install]
WantedBy=multi-user.target
Save the script (Ctrl+X, Y) and enable it with
#
systemctl enable chrootmount.service
Now the system will automatically execute the chroot mou...
ssh -xY root@localhost -p myportnumber
If you want to access your main filesystem from within t...
mkdir /tmp/mnt/mainfs
mount –bind / /tmp/mnt/mainfs/
終了行:
Raspiでx86バイナリを動かす
https://thepi.io/how-to-run-x86-programs-on-the-raspberry...
Step 1: Run this command
#
apt-get update && apt-get install qemu qemu-user qemu-us...
Step 2: Create a folder for your chroot.
Tip: Use mount –bind for proper df support within the en...
#
mkdir /chroot
mkdir /tmp/mnt/
mount –bind /chroot /tmp/mnt/
Step 3: Run debootstrap in the chroot dir. This can be d...
#
cd /tmp/mnt/
debootstrap –foreign –arch i386 sid ./ http://httpredir....
Step 4: The previous step only ran the first half of deb...
#
mount -t sysfs sys sys/
mount -t proc proc proc/
mount –bind /dev dev/
mount –bind /dev/pts dev/pts/
mount –bind /dev/shm dev/shm/
cp /usr/bin/qemu-i386-static usr/bin/
Step 5: Now we execute the chroot for the first time and...
#
chroot . /debootstrap/debootstrap –second-stage
Step 6: The environment is complete! Now we enter the en...
#
chroot ./ /bin/bash –login -i
Tips:
A few environment variables may be set wrong when first ...
#
export LANGUAGE=”C”
export LC_ALL=”C”
unset HOME
export HOME=/root/
source ~/.bashrc
source ~/.profile
The easiest way to do this so you don’t have to set thos...
chroot ./ /usr/sbin/sshd
Then just SSH localhost with the alternate port. Keep in...
#
ssh -xY root@localhost -p myportnumber
You will have to remount the chroot + special directorie...
To make the script:
#
nano /usr/bin/chrootmount
This will open nano and tell it to create a file in /usr...
#!/bin/bash
mkdir /tmp/mnt/
mount –bind /chroot /tmp/mnt/
mount -t sysfs sys /tmp/mnt/sys/
mount -t proc proc /tmp/mnt/proc/
mount –bind /dev /tmp/mnt/dev/
mount –bind /dev/pts /tmp/mnt/dev/pts/
mount –bind /dev/shm /tmp/mnt/dev/shm/
chroot /tmp/mnt/ /usr/sbin/sshd
Now save the script (Ctrl+X, Y) and chmod it to 755 so i...
If you created the script in the previous tip and want t...
#
nano /etc/systemd/system/chrootmount.service
This will open nano once more. Now add the following:
[Unit]
Description = mounts chroot on boot
[Service]
Type=one-shot
ExecStart=/usr/bin/chrootmount
[Install]
WantedBy=multi-user.target
Save the script (Ctrl+X, Y) and enable it with
#
systemctl enable chrootmount.service
Now the system will automatically execute the chroot mou...
ssh -xY root@localhost -p myportnumber
If you want to access your main filesystem from within t...
mkdir /tmp/mnt/mainfs
mount –bind / /tmp/mnt/mainfs/
ページ名: