monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit 97fbbe80740b54fdaeb5de9d23dbf59a5145cb3b
parent f3753cd19cac147edd77464b49fad31a362ef073
Author: z3bra <willy@mailoo.org>
Date:   Tue, 18 Aug 2015 19:04:01 +0200

new post: alpine at online.net

Diffstat:
2015/08/install-alpine-at-onlinenet.txt | 111+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
config.mk | 3++-
index.txt | 1+
3 files changed, 114 insertions(+), 1 deletion(-)

diff --git a/2015/08/install-alpine-at-onlinenet.txt b/2015/08/install-alpine-at-onlinenet.txt @@ -0,0 +1,111 @@ +# [Install Alpine at online.net](#) +## &mdash; 18 August, 2015 + +To install alpine linux on a dedibox SC, start in rescue mode, connect to the +box and run the following script as root: + + #!/bin/sh + + set -ex + + PATH=/bin:/sbin:/usr/bin:/usr/sbin + KEYMAP="us us" + HOST=alpine + ROOT_FS=ext4 + FEATURES="ata base ide scsi usb virtio $ROOT_FS" + MODULES="sd-mod,usb-storage,$ROOT_FS" + + REL=3.2 + MIRROR=http://nl.alpinelinux.org/alpine + REPO=$MIRROR/v$REL/main + APKV=2.6.3-r0 + DEV=/dev/sda + ROOT_DEV=${DEV}1 + ROOT=/mnt + ARCH=$(uname -m) + + sgdisk -Z $DEV + sgdisk -n 1:0:0 $DEV + sgdisk -t 1:8300 $DEV + sgdisk -c 1:root $DEV + sgdisk -A 1:set:2 $DEV + + mkfs.$ROOT_FS -q -L root $ROOT_DEV + mount $ROOT_DEV $ROOT + + curl -s $MIRROR/v$REL/main/$ARCH/apk-tools-static-${APKV}.apk | tar xz + ./sbin/apk.static --repository $REPO --update-cache --allow-untrusted --root $ROOT --initdb add alpine-base syslinux dhcpcd + + cat << EOF > $ROOT/etc/fstab + $ROOT_DEV / $ROOT_FS defaults,noatime 0 0 + EOF + echo $REPO > $ROOT/etc/apk/repositories + + cat /etc/resolv.conf > $ROOT/etc/resolv.conf + cat << EOF > $ROOT/etc/update-extlinux.conf + overwrite=1 + vesa_menu=0 + default_kernel_opts="quiet" + modules=$MODULES + root=$ROOT_DEV + verbose=0 + hidden=1 + timeout=1 + default=grsec + serial_port= + serial_baud=115200 + xen_opts=dom0_mem=256M + password='' + EOF + + cat << EOF > $ROOT/etc/network/interfaces + auto lo + iface lo inet loopback + + auto eth0 + iface eth0 inet dhcp + hostname $HOST + EOF + + mount --bind /proc $ROOT/proc + mount --bind /dev $ROOT/dev + mount --bind /sys $ROOT/sys + + chroot $ROOT /bin/sh -x << CHROOT + apk update + apk add openssh + + setup-hostname -n $HOST + + rc-update -q add acpid default + rc-update -q add cron default + rc-update -q add devfs sysinit + rc-update -q add dhcpcd boot + rc-update -q add dmesg sysinit + rc-update -q add hwdrivers sysinit + rc-update -q add mdev sysinit + rc-update -q add modules boot + rc-update -q add networking boot + rc-update -q add urandom boot + rc-update -q add sshd default + + echo features=\""$FEATURES"\" > /etc/mkinitfs/mkinitfs.conf + + apk add linux-grsec + extlinux -i /boot + dd bs=440 conv=notrunc count=1 if=/usr/share/syslinux/gptmbr.bin of=/dev/sda + CHROOT + + chroot /mnt passwd + + umount $ROOT/proc + umount $ROOT/dev + umount $ROOT/sys + umount $ROOT + +Then restart the box into normal mode. + +Thanks a lot to [uggedal](http://uggedal.com) and [sin](http://u.2f30.org/sin) +for their help with this. + +<!-- vim: set ft=markdown ts=4 et tw=80: --> diff --git a/config.mk b/config.mk @@ -28,7 +28,8 @@ PAGES = index.html \ 2015/03/under-wendys-dress.html \ 2015/04/the-wrong-sysadmin.html \ 2015/06/vomiting-colors.html \ - 2015/08/cross-compiling-with-pcc-and-musl.html + 2015/08/cross-compiling-with-pcc-and-musl.html \ + 2015/08/install-alpine-at-onlinenet.html FEEDS = rss/feed.xml EXTRA = css img vid data errors favicon.ico diff --git a/index.txt b/index.txt @@ -1,3 +1,4 @@ +* 0x0019 - [Install Alpine at online.net](/2015/08/install-alpine-at-onlinenet.html) * 0x0018 - [cross-compiling with PCC and musl](/2015/08/cross-compiling-with-pcc-and-musl.html) * 0x0017 - [Vomiting colors](/2015/06/vomiting-colors.html) * 0x0016 - [The wrong sysadmin](/2015/04/the-wrong-sysadmin.html)