Last active
August 6, 2018 15:48
-
-
Save ardemiranda/72b56e2283e1e84de045e871446f288d to your computer and use it in GitHub Desktop.
Install archlinux inside debian armv7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOT=/archlinux | |
ROOT_BUILD=$ROOT/build | |
DEVICE=/dev/sdax | |
mkdir -p $ROOT | |
mount $DEVICE $ROOT | |
mkdir -p $ROOT_BUILD | |
apt-get install build-essential libarchive-dev autoconf git autopoint libtool pkg-config libssl-dev gettext rng-tools lsof u-boot-tools | |
cd $ROOT_BUILD | |
git clone https://git.archlinux.org/arch-install-scripts.git | |
git clone https://git.archlinux.org/pacman.git | |
cd $ROOT_BUILD/pacman | |
git checkout v5.1.1 | |
./autogen.sh | |
./configure --disable-doc --prefix=/usr --sysconfdir=/etc --localstatedir=/var | |
make v=1 | |
make install | |
mkdir -p /etc/pacman.d/ | |
echo "Server = http://ca.us.mirror.archlinuxarm.org/\$arch/\$repo" >> /etc/pacman.d/mirrorlist | |
#export LD_LIBRARY_PATH=/usr/local/lib/ | |
#echo "Architecture = armv7h" >> /usr/local/etc/pacman.conf | |
sed -i -e 's/Architecture = auto/Architecture = armv7h/g' /etc/pacman.conf | |
echo "XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u" >> /etc/pacman.conf | |
echo "[core]" >> /etc/pacman.conf | |
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf | |
echo "[extra]" >> /etc/pacman.conf | |
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf | |
pacman -Sy | |
cd $ROOT_BUILD/arch-install-scripts | |
make | |
./pacstrap $ROOT base | |
# generate entropy | |
rngd -r /dev/urandom | |
./arch-chroot $ROOT pacman-key --init | |
./arch-chroot $ROOT pacman-key --populate archlinuxarm | |
./pacstrap $ROOT archlinux-keyring | |
# umount $ROOT/proc or $ROOT/sys | |
./arch-chroot $ROOT pacman -Syu | |
./arch-chroot $ROOT pacman -S base openssh linux | |
./arch-chroot $ROOT systemctl enable sshd | |
# configure static ip | |
./arch-chroot $ROOT systemctl enable netctl | |
cp $ROOT/etc/netctl/examples/ethernet-static $ROOT/etc/netctl/eth0 | |
#./genfstab $ROOT >> $ROOT/etc/fstab | |
echo "/dev/sdaX / ext4 errors=remount-ro,relatime 0 1" >> $ROOT/etc/fstab | |
echo "/dev/sdaA /boot ext4 errors=remount-ro,relatime 0 1" >> $ROOT/etc/fstab | |
echo "/dev/sdaC swap swap defaults 0 0" >> $ROOT/etc/fstab | |
# Instllation archlinux | |
./arch-chroot $ROOT | |
# https://wiki.archlinux.org/index.php/installation_guide | |
#flash u-boot | |
cat /proc/mtd | |
#This informations to configure /etc/fw_env.config get in /proc/mtd | |
# When flash NOR offset = 0 and NAND the offset is necessary | |
#dev offset size | |
/dev/mtd1 0x0 0x00010000 | |
cat /proc/cmdline | |
fw_printenv localargs | |
# change variable root=/dev/sdaX | |
fw_setenv localargs "xxxxxx root=/dev/sdaX xxxx" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment