Skip to content

Commit

Permalink
Add build script for lncm-box image
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherDroog authored Nov 19, 2018
1 parent 3bd618b commit ecb55fb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions variant-alpine/make_img.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# Creates a zipped & partitioned image file for burning onto SD cards
# 256MB bootable FAT32L partition with official Alpine linux and lncm box
# Make sure "parted", "dosfstools" and "zip" are installed

mkdir lncm-workdir
cd lncm-workdir
ALP=alpine-rpi-3.8.1-armhf.tar.gz
BOX=lncm-box-v0.2.1.tar.gz
IMG=lncm-box-v0.2.1.img
MNT=/mnt/lncm
wget http://dl-cdn.alpinelinux.org/alpine/v3.8/releases/armhf/${ALP}
wget https://github.com/lncm/pi-factory/releases/download/v0.2.1/${BOX}
dd if=/dev/zero of=$IMG bs=1M count=256
DEV=$(losetup -f --show $IMG)
parted -s $DEV mklabel msdos mkpart p fat32 2048s 100% set 1 boot on
parted -s $DEV print
mkfs.vfat ${DEV}p1 -IF 32
mkdir $MNT
mount ${DEV}p1 $MNT
tar -xzf $ALP -C ${MNT}/ --no-same-owner
tar -xzf $BOX -C ${MNT}/ --no-same-owner
sync
umount $MNT
losetup -d ${DEV}
zip -r ${IMG}.zip $IMG

0 comments on commit ecb55fb

Please sign in to comment.