Tuesday 2 April 2013

Instal alpine linux to hardisk

If using Alpine Linux 2.2.3 or later

Tango-dialog-warning.png
Warning: This will erase everything on your machine's harddisk. Don't blame me if someone sues you for this, your cat dies etc. You are warned.

The following is meant to be an absolute newbie guide
  • Burn the Alpine ISO image to a CD
  • Put the CD into the new computer and turn on the power. Make sure the computer is capable to boot from a CD. Your manual for the computer or the BIOS can help.
  • Wait for the text login: to appear, type root and press enter.
  • Run the setup-alpine script
    • Choose your keyboard layout. If you don't know your keyboard layout choose us. Here us was chosen.
      • Then I chose the us variant.
    • Host name, which will be the name of your computer, you can just press enter if you want to use the default name
    • Choose your network card, most people can just go with the default (press enter)
      • Most people will use DHCP, so press enter again, or you can enter in your static IP address
      • You will be asked if you want to do any manual network configuration, press enter for no
    • Type in your root password twice.
    • Choose a time zone, you can get a list my pressing ?. If you want a sub zone, e.g. Africa, type in Africa and press enter, ? will give you a list of sub zones in Africa.
    • Press f to choose the fastest mirror.
    • Choose an SSH server, this allows you to remotely manage your machine. OpenSSH is what the big distro's use, Dropbear is a tiny SSH replacement. Choose none for best security.
    • Choose an NTP client, this keeps your machine's time accurate using an Internet time server. Openntpd is what the big distro's use, while Chrony is a tiny replacement.
    • Choose a disk you want to install Alpine onto, as an example, sda is the first disk in your computer.
      • Now choose how you would like to use it, for this guide, choose sys, this will install the entire OS onto your hard drive
      • You are given a final chance to back out, type in Y to continue
  • The installation is now complete and you will be asked to reboot. Type in reboot and press enter
Take out the CD, and your computer should boot into Alpine using your hard drive.

Continue Setting up your Computer



If using Alpine Linux 2.2.2 or earlier

A number of steps are nowadays included in the setup-disk and setup-lbu scripts, which are invoked by setup-alpine. But in these older systems, these steps have to be performed manually.
Run setup-alpine to configure the keyboard, hostname and networking.
setup-alpine
Now for the manual steps. Install needed programs for the setup:
apk add e2fsprogs syslinux mkinitfs
Create partitions with fdisk.
fdisk /dev/sda
Let's say you have 2 partitions: /dev/sda1 as "Linux" (type 83) and /dev/sda2 as "linux swap" (type 82). The partition containing /boot---here, /dev/sda1---must be marked bootable (command "a" within fdisk).
Next, create your filesystem(s) and swap:
mkfs.ext4 /dev/sda1 mkswap /dev/sda2
Mount the filesystem:
mount -t ext4 /dev/sda1 /mnt
Clone the current running config created by setup-alpine (hostname, networking root password):
lbu package - | tar -C /mnt -zxf -
Install base packages on the mounted disk:
apk add --root=/mnt --initdb $(cat /etc/apk/world)
Append the / and swap to /etc/fstab:
echo -e "/dev/sda1 / ext4 defaults 1 1" >> /mnt/etc/fstab echo -e "/dev/sda2 none swap sw 0 0" >> /mnt/etc/fstab
Configure the boot loader, extlinux. We use the provided syslinux.cfg as base.
cp /media/cdrom/syslinux.cfg /mnt/boot/extlinux.conf vi /mnt/boot/extlinux.conf
It should contain something like:
timeout 20
prompt 1
default grsec
label grsec
    kernel /boot/grsec
    append initrd=/boot/grsec.gz root=/dev/sda1 modules=ext4 quiet
Install the bootloader on your /boot partition:
extlinux -i /mnt/boot
Install the early-stage bootloader in the disk's MBR (note that it's /dev/sda not /dev/sda1!)
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda
This also works:
cat /usr/share/syslinux/mbr.bin > /dev/sda
Unmount, remove cdrom, and reboot. (If you can't eject, just remove it manually as the machine reboots)
umount /mnt umount /.modloop eject reboot
In recent versions of Alpine, the second line can be accomplished by rc-service modloop stop. (See this FAQ entry).
After reboot, you should be able to log in as root with the password you created in setup-alpine.

Install desktop pada Alpine linux

Alpine di gunakan untuk netbook dengan hardisk 2 Gb

 Initial setup

Start by booting up Alpine (see these instructions on how to do that)
When you Alpine is up and running, do the initial setup.
setup-alpine

Install packages

Install basic desktop system and gnome packages.
This might take a few minutes depending on your network speed.
apk add alpine-desktop gnome-base lxdm

Optional packages

Video and Input packages

You might also want to install a package suitable for your video chipset and input devices.
For example, if you have an Sis video chipset install 'xf86-video-sis', for Intel video chipset install 'xf86-video-intel'.

apk add xf86-video-sis
and / or
apk add xf86-input-synaptics
Run 'apk search xf86-video*' to see available xf86-video packages.
Run 'apk search xf86-input*' to see available xf86-input packages.

acpid

If you installed your Alpine Linux as a VirtualBox or VMWare guest you might find it handy be able send ACPI shutdown.

rc-update add acpid

Configure xorg-server (optional)

You can configure xorg-server and make your modifications
Xorg -configure
This will result in `/root/xorg.conf.new`. You can modify this file to fit your needs.
(When finished modifying and testing the above configuration file, move it to `/etc/X11/xorg.conf` for normal usage.)

udev

Adding udev might help you with some finicky hardware like touchpads.
apk add udev /etc/init.d/udev start && /etc/init.d/udev-postmount start rc-update add udev sysinit rc-update add udev-postmount default
Adding evdev might also be necessary, for example if the keyboard doesn't work in X...
apk add xf86-input-evdev

Create user accounts

Create a normal user account.
adduser ncopa
Optionally, give that user sudo permissions in /etc/sudoers.

Start your desktop

Start lxdm and log in with your new user.
rc-service lxdm start
Once you have verified that it actually works you can make lxdm start up at boot:
rc-update add lxdm

Troubleshooting

If you are unable to login, check /var/log/lxdm.log, there may be output there from X to indicate failed modules, etc.