简易安装Arch Linux ARM for Raspberry Pi 3

  技术入门

把下列代码保存为:rpi3-arch-linux-to-sdcard.sh

#!/bin/bash

# <https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3>

echo -e "\n\nArch Linux ARM to SD Card"
echo -e "For the Raspberry Pi 3, if you want to use the unofficial arm64 variant."
echo -e "(Otherwise use the Raspberry Pi 2 version of this script!)\n\n"

if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

echo -e "\nAll drives on this computer:\n"
ls -1 /dev/sd?

echo -e "\nLast messages in syslog:\n"
dmesg | tail

echo -e "\nChoose sd card (like /dev/sdX):\n"
read SDCARD

echo -e "\n\nCurrent partitioning of $SDCARD:\n"
parted $SDCARD print

echo -e "\n\nYou chose $SDCARD\nAre you sure to continue? Press Ctrl-C to abort!"
read

cd /tmp

echo -e "\nDownloading the Arch Linux ARM root filesystem (if needed):\n"
URL=https://mirrors.ustc.edu.cn/archlinuxarm/os/ArchLinuxARM-rpi-3-latest.tar.gz
# Sometimes the download server is slow. In that case, try a different one instead:
#URL=http://de7.mirror.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz
FNAME=$(basename "$URL")
FSIZE=$(curl --head --location --silent "$URL" --write-out '%{http_code} %{size_download} \n' | tac | grep -m1 Content-Length | cut -f 2 -d' ' | tr -d '\r')
if [ -n "$FNAME" ]
then
  CURSIZE=$(wc -c <"$FNAME")
  if [ $CURSIZE -ne $FSIZE ]; then
    rm "$FNAME"
    echo "Removing any downloaded and leftover Arch Linux ARM image"
  fi
fi
curl --location --remote-name --time-cond "$FNAME" "$URL"
if [ $? -ne 0 ]; then
  echo "Could not download the image file, please check the mirror"
  exit 1
fi

echo -e "\nUnmounting partitions found on ${SDCARD}\n"
for MOUNT in ${SDCARD}?
do
  echo $MOUNT
  umount $MOUNT
done

parted -s $SDCARD unit s print
parted -s $SDCARD mktable msdos
parted -s $SDCARD mkpart primary fat32 8192s 128MiB
parted -s $SDCARD mkpart primary 128MiB 100%
parted -s $SDCARD unit s print

mkfs.vfat ${SDCARD}1
mkfs.ext4 ${SDCARD}2

rm -rf boot
rm -rf root

mkdir boot
mkdir root

mount ${SDCARD}1 boot
mount ${SDCARD}2 root

echo -e "\nExtracting the root filesystem\n"
bsdtar -xpf ArchLinuxARM-rpi-3-latest.tar.gz -C root
sync

echo -e "\nMoving boot files to the first partition\n"
mv root/boot/* boot

echo -e "\nUnmounting the two partitions\n"
umount boot root

rmdir boot root

echo "Insert the SD card into the Raspberry Pi , connect ethernet, and apply 5V power."
echo "Use the serial console or SSH to the IP address given to the board by your router. The username/password combination is alarm/alarm. The default root password is 'root'."

cd -

如果网络较慢请先下载

http://archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz

放置到/tmp下面,按提示运行即可。

来源:https://gist.github.com/pklaus/0e90aaa2d91064edd731fa30f44fce3f

3 thoughts on - 简易安装Arch Linux ARM for Raspberry Pi 3

  • Приветствую Вас! Мы -студия разработки и создания online-проектов. И меня зовут Антон, я основатель группы специалистов, рерайтеров/копирайтеров, профессионалов, оптимизаторов, разработчиков, линкбилдеров, копирайтеров, link builders, маркетологов. Мы – компания профессиональных фрилансеров. Наши профессионалы могут помочь вашему любому вебсайту занять топ 3 в поисковой выдаче любой системе. Мы предлагаем высококачественную раскрутку интернет-проектов в поисковиках! Все специалисты которые сейчас работают в команде прошли значительный профессиональный путь, мы в точности знаем, как грамотно организовывать ваш собственный онлайн-проект, выдвигать его на 1-ое место, преобразовать трафик в заказы. Мы вам предлагаем абсолютно бесплатное предложение по раскрутке любых интернет-сайтов. С нетерпением ждем Вас!

    бесплатное сео курсы сео бесплатно

  • Our purpose at vape4style.com is actually to give our consumers with the most ideal vaping knowledge possible, helping them vape with style!. Based in NYC as well as in company since 2015, our team are actually a custom-made vaping warehouse store offering all forms of vape mods, e-liquids, pure nicotine salts, pod systems, storage tanks, coils, as well as various other vaping extras, such as electric batteries and exterior wall chargers. Our e-juices are constantly new since our team certainly not only offer our products retail, however additionally disperse to local New York City retail stores and also deliver wholesale alternatives. This permits our company to constantly spin our inventory, supplying our consumers as well as outlets along with one of the most freshest stock possible.

    If you are actually a vaper or even making an effort to leave smoke, you reside in the best area. Desire to save some amount of money in process? Rush and also join our email newsletter to get unique nightclub VIP, vape4style rebates, advertisings and also free of cost giveaways!

    We are actually an unique Northeast Yihi supplier. Our team are actually additionally authorized distributors of Negative Drip, Port Vape, Charlie’s Chalk Dust, Beard Vape, SVRF by Saveur Vape, Ripe Vapes, Smok, Segeli, Dropped Vape, Kangertech, Triton as well as many more. Don’t observe something you are looking for on our site? Certainly not a concern! Simply let us recognize what you are looking for and our company will certainly find it for you at a discounted price. Have a inquiry about a certain item? Our vape professionals will definitely be glad to offer more information concerning just about anything our team market. Merely send our team your inquiry or even contact our company. Our crew will certainly rejoice to aid!

    svrf by saveur department stores : Yihi SL Class

LEAVE A COMMENT

88 ÷ = 11