archlinux ARM installation script

Raspberry Pi 2

archlinux ARM installation script

Postby dafero » Fri Apr 29, 2016 9:28 pm

Hi all,

the other day I was reinstalling (again sigh...) archlinux ARM on my Pi2 and at the end I came up with a handy script to automate all the installation process.

I'm very happy with it and I think more people can benefit from it.
If you want to give it a go, you can find the code here: https://github.com/danifr/miscellaneous ... install.sh

Here is the log sample of all the steps done by the script.
$this->bbcode_second_pass_code('', 'dafero@archenvy ~/g/miscellaneous> sudo sh alarm_install.sh
+***********************************************************+
* *
* Welcome! This program will automate the installation of *
* ArchLinuxARM RP2 on your microSD card. *
* *
+***********************************************************+
Please enter your sdcard device name [mmcblk0]:
This program will FORMAT and INSTALL ArchLinuxARM on /dev/mmcblk0. Are you sure you want to continue?(y/n): y
[INFO] Creating partitions on /dev/mmcblk0...

Welcome to fdisk (util-linux 2.28).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Created a new DOS disklabel with disk identifier 0xca33a2a3.

Command (m for help): Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-15523839, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-15523839, default 15523839):
Created a new partition 1 of type 'Linux' and of size 100 MiB.

Command (m for help): Selected partition 1
Partition type (type L to list all types): Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): Partition type
p primary (1 primary, 0 extended, 3 free)
e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (206848-15523839, default 206848): Last sector, +sectors or +size{K,M,G,T,P} (206848-15523839, default 15523839):
Created a new partition 2 of type 'Linux' and of size 7.3 GiB.

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[INFO] Formating partitions...
mkfs.fat 3.0.28 (2015-05-16)
p1: No such file or directory
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 1914624 4k blocks and 479552 inodes
Filesystem UUID: 4c04b58c-064b-4f17-8fa8-bbcbdab3c135
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

[INFO] Creating temporary mount directories...
[INFO] Mounting...
[INFO] Downloading latest version of ArchLinuxARM from http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
--2016-04-29 23:03:40-- http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
Resolving os.archlinuxarm.org (os.archlinuxarm.org)... 50.116.36.110
Connecting to os.archlinuxarm.org (os.archlinuxarm.org)|50.116.36.110|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://de7.mirror.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz [following]
--2016-04-29 23:03:40-- http://de7.mirror.archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
Resolving de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)... 88.198.253.13
Connecting to de7.mirror.archlinuxarm.org (de7.mirror.archlinuxarm.org)|88.198.253.13|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 290319167 (277M) [application/octet-stream]
Saving to: ‘/tmp/ArchLinuxARM-rpi-2-latest.tar.gz’

/tmp/ArchLinuxARM-rpi-2-lat 100%[===========================================>] 276.87M 1.44MB/s in 3m 27s

2016-04-29 23:07:07 (1.34 MB/s) - ‘/tmp/ArchLinuxARM-rpi-2-latest.tar.gz’ saved [290319167/290319167]

[INFO] Extracting files into /tmp/raspberrypi/root...
[INFO] Syncing... (this might take a while)
[INFO] Copying boot into /tmp/raspberrypi/boot
[INFO] Unmounting...
[INFO] Everything looks good! Insert the sdcard in you RaspberryPi and have fun!
')
Feedback would be highly appreciated!!

Thanks a lot!
Daniel.
dafero
 
Posts: 8
Joined: Tue Aug 11, 2015 9:02 pm

Re: archlinux ARM installation script

Postby WarheadsSE » Fri Apr 29, 2016 9:35 pm

$this->bbcode_second_pass_quote('', '[')INFO] Formating partitions...
mkfs.fat 3.0.28 (2015-05-16)
p1: No such file or directory
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: archlinux ARM installation script

Postby dafero » Fri Apr 29, 2016 9:47 pm

Well spotted!!
Fixed already via --> https://github.com/danifr/miscellaneous ... b19bbbeL38

Thanks WarheadsSE!
dafero
 
Posts: 8
Joined: Tue Aug 11, 2015 9:02 pm


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 3 guests