Difference between revisions of "User:Djgera"

From ArchWiki
Jump to: navigation, search
(pacman)
(Arch Linux configurations)
 
(93 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
* [http://github.com/djgera djgera's GitHub]
 
* [http://github.com/djgera djgera's GitHub]
  
=== My machine ===
+
=== Arch Linux configurations ===  
  
* '''Motherboard''': Asus M2N32-SLI Deluxe (Firmware: 1603)
+
[[User:Djgera/exequiel|host: exequiel]]
* '''CPU''': AMD Athlon 64 X2 5200+ [ADA5200IAA6CS]
+
* '''RAM''': 4 x 1GB OCZ DDR2 800MHz Platinum Rev 2 (4-4-4-15) [OCZ2P800R21G]
+
* '''GPU''': EVGA GeForce GT 520 1GB RAM DDR3 | VBIOS: 75.19.1b.00.20 | PN: 01G-P3-1523-KR
+
* '''Audio''': Sound Blaster Live! MP3
+
* '''Storage (sda)''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 05.01D05) [WD2001FASS-00W2B0]
+
* '''Storage (sdb)''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 01.00101) [WD2001FASS-00W2B0]
+
* '''Storage (sdc)''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 05.01D05) [WD2001FASS-00W2B0]
+
* '''Storage [backup]''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 01.00101) [WD2001FASS-00W2B0]
+
* '''Storage [backup]''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 05.01D05) [WD2002FAEX-007BA0]
+
* '''Storage [backup]''': Western Digital Caviar Black 2TB - 64MB Cache (Firmware: 05.01D05) [WD2002FAEX-007BA0]
+
* '''Optical Drive''': LG DVD-RW SATA Dual Layer (Fimware IL00) [GH20NS15]
+
* '''Power Supply''': PowerCooler ATX12V 2.0 PS-500SS 500W
+
* '''Monitor''': Dell UltraSharp 24" - (H-IPS panel [LM240WU4-SLB1]) - 1920x1200 - [U2410 / Rev A05]
+
* '''Keyboard/Mouse''': Logitech Cordless Desktop EX 100
+
* '''Webcam''': Logitech HD Webcam C510
+
* '''Printer''': HP Laserjet P1006
+
* '''UPS''': APC Back-UPS RS800VA, 230V [BR800i] (Firmware: 9.o5 .I USB FW:o5)
+
  
=== System configuration ===
+
[[User:Djgera/papucho|host: papucho]]
  
==== HDD partition scheme ====
+
[[User:Djgera/backup|host: backup]]
 
+
{{bc|<nowiki>
+
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
+
Units = sectors of 1 * 512 = 512 bytes
+
Sector size (logical/physical): 512 bytes / 512 bytes
+
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
Disk label type: dos
+
Disk identifier: 0x79dfe14b
+
 
+
  Device Boot      Start        End      Blocks  Id  System
+
/dev/sda1  *        2048      133119      65536  83  Linux      ( +64M  - ext4 - /boot      )
+
/dev/sda2          133120    42076159    20971520  83  Linux      ( +20G  - ext4 - /          )
+
/dev/sda3        42076160    84019199    20971520  83  Linux      ( +20G  - ext4 - /var        )
+
/dev/sda4        84019200  3907029167  1911504984    5  Extended    (        -      -            )
+
/dev/sda5        84021248    92415999    4197376  82  Linux Swap  ( +4099M -      -            )
+
/dev/sda6        92418048  125972479    16777216  83  Linux      ( +16G  - ext4 - /home      )
+
/dev/sda7      125974528  1384265727  629145600  83  Linux      ( +600G  - xfs  - /data/data0 )
+
/dev/sda8      1384267776  3481419775  1048576000  83  Linux      ( +1000G - xfs  - /data/data1 )
+
/dev/sda9      3481421824  3907029167  212803672  83  Linux      (        - xfs  - /data/data2 )
+
</nowiki>}}
+
 
+
{{bc|<nowiki>
+
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
+
Units = sectors of 1 * 512 = 512 bytes
+
Sector size (logical/physical): 512 bytes / 512 bytes
+
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
Disk label type: dos
+
Disk identifier: 0xba469f54
+
 
+
  Device Boot      Start        End      Blocks  Id  System
+
/dev/sdb1            2048  3907029167  1953513560  83  Linux      (        - xfs  - /data/data3 )
+
</nowiki>}}
+
 
+
{{bc|<nowiki>
+
Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
+
Units = sectors of 1 * 512 = 512 bytes
+
Sector size (logical/physical): 512 bytes / 512 bytes
+
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
Disk label type: dos
+
Disk identifier: 0x78aef04c
+
 
+
  Device Boot      Start        End      Blocks  Id  System
+
/dev/sdc1            2048  3907029167  1953513560  83  Linux      (        - xfs  - /data/data4 )
+
</nowiki>}}
+
 
+
==== syslinux ====
+
 
+
syslinux (mbr.bin) installed on MBR ('''sda''')
+
{{bc|<nowiki>
+
dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr.bin of=/dev/sda
+
</nowiki>}}
+
 
+
{{bc|<nowiki>
+
extlinux -i /boot/syslinux
+
cp /usr/lib/syslinux/menu.c32 /boot/syslinux/
+
</nowiki>}}
+
 
+
{{hc|
+
/boot/syslinux/syslinux.cfg
+
|<nowiki>
+
timeout 10
+
 
+
ui menu.c32
+
 
+
 
+
label 3.8.13
+
    linux ../vmlinuz-3.8.13
+
    initrd ../initramfs-3.8.13.img
+
    append root=/dev/sda2 rootfstype=ext4 ro vga=normal
+
 
+
 
+
label memtest86+
+
    linux ../memtest86+-4.20.bin
+
</nowiki>}}
+
 
+
==== mkinitcpio ====
+
 
+
{{hc|
+
/etc/mkinitcpio-djgera.conf
+
|<nowiki>
+
HOOKS="base udev save_hdd_live timestamp fsck shutdown"
+
</nowiki>}}
+
 
+
 
+
{{hc|
+
/usr/lib/initcpio/install/save_hdd_live
+
|<nowiki>
+
build()
+
{
+
    add_file /etc/udev/rules.d/69-save-hdd-live.rules
+
    add_binary hdparm
+
}
+
 
+
help ()
+
{
+
cat <<HELPEOF
+
  This hook will save your HDD live!
+
HELPEOF
+
}
+
</nowiki>}}
+
 
+
==== systemd ====
+
 
+
{{hc|
+
localectl
+
|<nowiki>
+
  System Locale: LANG=en_US.UTF-8
+
      VC Keymap: es
+
      X11 Layout: es
+
</nowiki>}}
+
 
+
{{hc|
+
hostnamectl
+
|<nowiki>
+
  Static hostname: exequiel
+
        Icon name: computer-desktop
+
          Chassis: desktop
+
        Machine ID: cd9e9d24fe37411c3b2d22c14951b1a1
+
          Boot ID: e4f43e59f71748388c7a747e5dbbbfdb
+
  Operating System: Arch Linux
+
            Kernel: Linux 3.8.13-64
+
      Architecture: x86_64
+
</nowiki>}}
+
 
+
{{hc|
+
timedatectl
+
|<nowiki>
+
      Local time: Sun 2013-06-09 17:28:36 ART
+
  Universal time: Sun 2013-06-09 20:28:36 UTC
+
        RTC time: Sun 2013-06-09 20:28:33
+
        Timezone: America/Buenos_Aires (ART, -0300)
+
    NTP enabled: yes
+
NTP synchronized: yes
+
RTC in local TZ: no
+
      DST active: n/a
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/udev/rules.d/69-save-hdd-live.rules
+
|<nowiki>
+
ACTION=="remove", GOTO="save_hdd_live_end"
+
SUBSYSTEM!="block", GOTO="save_hdd_live_end"
+
ENV{DEVTYPE}!="disk", GOTO="save_hdd_live_end"
+
 
+
ENV{ID_ATA_FEATURE_SET_APM}=="1", RUN+="/usr/bin/hdparm -B 255 $devnode"
+
ENV{ID_ATA_FEATURE_SET_AAM}=="1", RUN+="/usr/bin/hdparm -M 128 $devnode"
+
ENV{ID_ATA_FEATURE_SET_PM}=="1", RUN+="/usr/bin/hdparm -S 0 $devnode"
+
 
+
LABEL="save_hdd_live_end"
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/udev/rules.d/69-usbasp.rules
+
|<nowiki>
+
ACTION=="remove", GOTO="usbasp_end"
+
 
+
SUBSYSTEM=="usb", ATTR{product}=="USBasp", TAG+="uaccess"
+
 
+
LABEL="usbasp_end"
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/udev/rules.d/69-usbserial.rules
+
|<nowiki>
+
ACTION=="remove", GOTO="usbserial_end"
+
 
+
SUBSYSTEM=="tty", KERNEL=="ttyUSB0", TAG+="uaccess"
+
 
+
LABEL="usbserial_end"
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/udev/rules.d/69-android.rules
+
|<nowiki>
+
ACTION=="remove", GOTO="android_end"
+
 
+
SUBSYSTEM=="usb", ATTR{product}=="MT65xx Android Phone", TAG+="uaccess"
+
 
+
LABEL="android_end"
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/systemd/system/network@.service
+
|<nowiki>
+
[Unit]
+
Description=Network Connectivity On %i
+
Wants=network.target
+
Before=network.target
+
BindsTo=sys-subsystem-net-devices-%i.device
+
After=sys-subsystem-net-devices-%i.device
+
 
+
 
+
[Service]
+
Type=oneshot
+
RemainAfterExit=yes
+
EnvironmentFile=/etc/conf.d/network/%i
+
ExecStart=/sbin/ip link set dev %i up
+
ExecStart=/sbin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i
+
ExecStart=/sbin/ip route add default via ${gateway}
+
ExecStop=/sbin/ip addr flush dev %i
+
ExecStop=/sbin/ip link set dev %i down
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/conf.d/network/enp0s16
+
|<nowiki>
+
address=192.168.0.77
+
netmask=24
+
broadcast=192.168.0.255
+
gateway=192.168.0.1
+
</nowiki>}}
+
 
+
{{bc|<nowiki>
+
/etc/systemd/system
+
├── dbus-org.freedesktop.Avahi.service -> /usr/lib/systemd/system/avahi-daemon.service
+
├── default.target -> /usr/lib/systemd/system/multi-user.target
+
├── getty.target.wants
+
│   └── getty@tty1.service -> /usr/lib/systemd/system/getty@.service
+
├── hddtemp.service.d
+
│   └── es.conf
+
├── multi-user.target.wants
+
│   ├── apcupsd.service -> /usr/lib/systemd/system/apcupsd.service
+
│   ├── avahi-daemon.service -> /usr/lib/systemd/system/avahi-daemon.service
+
│   ├── cronie.service -> /usr/lib/systemd/system/cronie.service
+
│   ├── cups.path -> /usr/lib/systemd/system/cups.path
+
│   ├── hddtemp.service -> /usr/lib/systemd/system/hddtemp.service
+
│   ├── mpd.service -> /usr/lib/systemd/system/mpd.service
+
│   ├── network@enp0s16.service -> /etc/systemd/system/network@.service
+
│   ├── ntpd.service -> /usr/lib/systemd/system/ntpd.service
+
│   ├── remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
+
│   ├── smartd.service -> /usr/lib/systemd/system/smartd.service
+
│   ├── smartlog@sda.service -> /etc/systemd/system/smartlog@.service
+
│   ├── smartlog@sdb.service -> /etc/systemd/system/smartlog@.service
+
│   ├── smartlog@sdc.service -> /etc/systemd/system/smartlog@.service
+
│   └── vnstat.service -> /usr/lib/systemd/system/vnstat.service
+
├── network@.service
+
├── printer.target.wants
+
│   └── cups.service -> /usr/lib/systemd/system/cups.service
+
├── smartlog@.service
+
└── sockets.target.wants
+
    ├── avahi-daemon.socket -> /usr/lib/systemd/system/avahi-daemon.socket
+
    ├── cups.socket -> /usr/lib/systemd/system/cups.socket
+
    └── sshd.socket -> /usr/lib/systemd/system/sshd.socket
+
</nowiki>}}
+
 
+
==== glibc ====
+
{{hc|
+
/etc/locale.gen
+
|<nowiki>
+
en_US.UTF-8 UTF-8 
+
en_US ISO-8859-1 
+
es_AR.UTF-8 UTF-8 
+
es_AR ISO-8859-1
+
</nowiki>}}
+
 
+
 
+
==== smartmontools ====
+
 
+
{{hc|
+
/etc/systemd/system/smartlog@.service
+
|<nowiki>
+
[Unit]
+
Description=SMART on disk %i
+
 
+
[Service]
+
ExecStart=/usr/bin/smartctl -a /dev/%i
+
SyslogIdentifier=smart-%i
+
</nowiki>}}
+
 
+
==== hddtemp ====
+
 
+
{{hc|
+
/etc/systemd/system/hddtemp.service.d/es.conf
+
|<nowiki>
+
[Service]
+
ExecStart=
+
ExecStart=/usr/bin/hddtemp -dF /dev/sda /dev/sdb /dev/sdc
+
</nowiki>}}
+
 
+
 
+
==== apcupsd ====
+
 
+
{{hc|
+
/usr/lib/systemd/system-shutdown/apc_killpower
+
|<nowiki>
+
#!/bin/sh
+
 
+
if [ -f /etc/apcupsd/powerfail -a "$1" = "poweroff" ]; then
+
    /etc/apcupsd/apccontrol killpower
+
fi
+
</nowiki>}}
+
 
+
{{hc|
+
/root/bin/ups-mailer
+
|<nowiki>
+
#!/bin/sh
+
 
+
TO="<USER>@<DOMAIN>"
+
MAIL="/usr/bin/mail"
+
export MAILRC="/root/.mailrc"
+
 
+
/usr/bin/apcaccess status | $MAIL -s "${0##*/} | $(hostname)" "$TO"
+
 
+
exit 0
+
 
+
</nowiki>}}
+
 
+
{{bc|<nowiki>
+
/etc/apcupsd/
+
├── changeme -> /root/bin/ups-mailer
+
├── commfailure -> /root/bin/ups-mailer
+
├── commok -> /root/bin/ups-mailer
+
├── offbattery -> /root/bin/ups-mailer
+
└── onbattery -> /root/bin/ups-mailer
+
</nowiki>}}
+
 
+
==== heirloom-mailx ====
+
 
+
{{hc|
+
/root/.mailrc
+
|<nowiki>
+
set sendmail="/usr/bin/msmtp"
+
set from="Gerardo Exequiel Pozzi <USER@DOMAIN>"
+
</nowiki>}}
+
 
+
==== msmtp ====
+
 
+
{{hc|
+
/root/.msmtprc
+
|<nowiki>
+
account <USER>
+
host <DOMAIN>
+
from <USER@DOMAIN>
+
auth on
+
tls on
+
tls_starttls off
+
tls_trust_file /etc/ssl/certs/ca-certificates.crt
+
port 465
+
user <USER>
+
password <PASSWORD>
+
</nowiki>}}
+
 
+
==== mc ====
+
 
+
{{hc|
+
/etc/profile.d/mc.sh
+
|<nowiki>
+
alias mc='. /usr/lib/mc/mc-wrapper.sh'
+
</nowiki>}}
+
 
+
==== polkit ====
+
 
+
{{hc|
+
/etc/polkit-1/rules.d/69-djgera.rules
+
|<nowiki>
+
polkit.addRule(function(action, subject) {
+
    if (action.id == "org.freedesktop.login1.power-off" ||
+
        action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
+
        action.id == "org.freedesktop.login1.reboot" ||
+
        action.id == "org.freedesktop.login1.reboot-multiple-sessions" ||
+
        action.id == "org.freedesktop.login1.hibernate" ||
+
        action.id == "org.freedesktop.login1.hibernate-multiple-sessions" ||
+
        action.id == "org.freedesktop.login1.suspend" ||
+
        action.id == "org.freedesktop.login1.suspend-multiple-sessions") {
+
        return "no";
+
    }
+
});
+
 
+
polkit.addRule(function(action, subject) {
+
    if (action.id == "org.freedesktop.upower.hibernate" ||
+
        action.id == "org.freedesktop.upower.suspend") {
+
        return "no";
+
    }
+
});
+
</nowiki>}}
+
 
+
==== filesystem ====
+
 
+
{{hc|
+
/etc/fstab
+
|<nowiki>
+
tmp                    /tmp          tmpfs    nodev,nosuid,size=100% 0 0
+
 
+
/dev/sda5              none          swap      defaults 0 0
+
 
+
/dev/sda1              /boot        ext4      noatime,nosuid,nodev,noexec 0 2
+
/dev/sda2              /            ext4      noatime,nodev 0 1
+
/dev/sda3              /var          ext4      noatime,nosuid,nodev 0 2
+
/dev/sda6              /home        ext4      noatime,nosuid,nodev 0 2
+
 
+
/dev/sda7              /data/data0  xfs      ro,noatime,nosuid,nodev,noexec 0 2
+
/dev/sda8              /data/data1  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
+
/dev/sda9              /data/data2  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
+
/dev/sdb1              /data/data3  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
+
/dev/sdc1              /data/data4  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
+
</nowiki>}}
+
 
+
 
+
{{hc|
+
/etc/nsswitch.conf
+
|<nowiki>
+
passwd: files
+
group: files
+
shadow: files
+
 
+
publickey: files
+
 
+
hosts: files dns
+
networks: files
+
 
+
protocols: files
+
services: files
+
ethers: files
+
rpc: files
+
 
+
netgroup: files
+
</nowiki>}}
+
 
+
==== kmod ====
+
 
+
{{hc|
+
/etc/modules-load.d/djgera.conf
+
|<nowiki>
+
#fbcon
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/modprobe.d/djgera.conf
+
|<nowiki>
+
#blacklist nvidia
+
blacklist fbcon
+
blacklist nouveau
+
blacklist rtl8187
+
blacklist pata_amd
+
blacklist snd_hda_intel
+
</nowiki>}}
+
 
+
{{hc|
+
/etc/modprobe.d/nvidia.conf
+
|<nowiki>
+
options nvidia NVreg_EnableMSI=1
+
</nowiki>}}
+
 
+
==== xorg-server ====
+
 
+
{{hc|
+
/etc/X11/xorg.conf
+
|<nowiki>
+
Section "Device"
+
    Identifier    "nvidia0"
+
    Driver        "nvidia"
+
#    Driver        "nouveau"
+
#    Option        "GLXVBlank" "on"
+
EndSection
+
</nowiki>}}
+
 
+
==== fontconfig ====
+
{{hc|
+
/etc/fonts/local.conf
+
|<nowiki>
+
<?xml version='1.0'?>
+
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
<fontconfig>
+
<match target="font">
+
  <edit mode="assign" name="autohint">
+
  <bool>true</bool>
+
  </edit>
+
</match>
+
</fontconfig>
+
</nowiki>}}
+
 
+
==== pacman ====
+
 
+
{{hc|
+
/etc/pacman.conf
+
|<nowiki>
+
[options]
+
HoldPkg    = pacman glibc
+
Architecture = auto
+
 
+
IgnorePkg    = pm-utils pm-quirks
+
IgnorePkg    = linux-headers
+
IgnorePkg    = syslinux
+
IgnorePkg    = hplip
+
IgnorePkg    = flashplugin
+
IgnorePkg    = lib32-flashplugin
+
IgnorePkg    = freetype2 fontconfig
+
IgnorePkg    = lib32-freetype2 lib32-fontconfig
+
IgnorePkg    = nvidia-utils nvidia-libgl opencl-nvidia
+
IgnorePkg    = lib32-nvidia-utils lib32-nvidia-libgl lib32-opencl-nvidia
+
 
+
NoUpgrade  = etc/apcupsd/onbattery etc/apcupsd/offbattery etc/apcupsd/changeme etc/apcupsd/commok etc/apcupsd/commfailure
+
 
+
Color
+
VerbosePkgLists
+
 
+
SigLevel    = Required DatabaseOptional
+
LocalFileSigLevel = Optional
+
 
+
[core]
+
Include = /etc/pacman.d/mirrorlist
+
 
+
[extra]
+
Include = /etc/pacman.d/mirrorlist
+
 
+
[community]
+
Include = /etc/pacman.d/mirrorlist
+
 
+
[multilib]
+
Include = /etc/pacman.d/mirrorlist
+
</nowiki>}}
+
 
+
==== mpd ====
+
 
+
{{hc|
+
/etc/mpd.conf
+
|<nowiki>
+
music_directory "/data/musica"
+
playlist_directory "/var/lib/mpd/playlists"
+
db_file "/var/lib/mpd/mpd.db"
+
log_file "syslog"
+
pid_file "/var/run/mpd/mpd.pid"
+
state_file "/var/lib/mpd/mpdstate"
+
user "mpd"
+
metadata_to_use "none"
+
max_playlist_length "32768"
+
audio_output {
+
    type "alsa"
+
    name "default"
+
}
+
</nowiki>}}
+
  
 
=== ¡Machetes! ===
 
=== ¡Machetes! ===
Line 575: Line 27:
 
A quick way to make an image with a base installation without installer.
 
A quick way to make an image with a base installation without installer.
 
* Packages needed: syslinux arch-install-scripts
 
* Packages needed: syslinux arch-install-scripts
* First time boot with fallback initramfs, then run mkinitcpio -p linux
+
* First time boot with fallback initramfs, then run mkinitcpio -p linux.
 +
* Adjust /etc/locale.gen, run locale-gen.
  
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
modprobe nbd max_part=8
 
modprobe nbd max_part=8
qemu-img create -f qcow2 archbase.qcow2 1G
+
qemu-img create -f qcow2 /tmp/archbase.qcow2 1G
qemu-nbd -c /dev/nbd0 archbase.qcow2
+
qemu-nbd -c /dev/nbd0 /tmp/archbase.qcow2
 
sleep 2
 
sleep 2
echo -e "p\nn\np\n1\n\n\na\n1\np\nw\nq\n" | fdisk /dev/nbd0
+
sgdisk -n 1:+0:0 -A 1:set:2 /dev/nbd0
 
mkfs.ext4 -m0 -L AB_RAIZ /dev/nbd0p1
 
mkfs.ext4 -m0 -L AB_RAIZ /dev/nbd0p1
 
mkdir /tmp/archbase
 
mkdir /tmp/archbase
 
mount /dev/nbd0p1 /tmp/archbase
 
mount /dev/nbd0p1 /tmp/archbase
pacstrap /tmp/archbase
+
pacstrap -c /tmp/archbase
echo 'LABEL=AB_RAIZ / ext4 defaults 0 1' >> /tmp/archbase/etc/fstab
+
echo 'archbase' > /tmp/archbase/etc/hostname
+
ln -s /usr/share/zoneinfo/America/Buenos_Aires /tmp/archbase/etc/localtime
+
echo 'KEYMAP="es"' > /tmp/archbase/etc/vconsole.conf
+
echo 'LANG="en_US.UTF-8"' > /tmp/archbase/etc/locale.conf
+
 
mkdir /tmp/archbase/boot/syslinux
 
mkdir /tmp/archbase/boot/syslinux
 
cat << FIN > /tmp/archbase/boot/syslinux/syslinux.cfg
 
cat << FIN > /tmp/archbase/boot/syslinux/syslinux.cfg
Line 598: Line 46:
 
LABEL arch
 
LABEL arch
 
   LINUX ../vmlinuz-linux
 
   LINUX ../vmlinuz-linux
   APPEND root=LABEL=AB_RAIZ
+
   APPEND root=LABEL=AB_RAIZ rw
 
   INITRD ../initramfs-linux.img
 
   INITRD ../initramfs-linux.img
  
 
LABEL arch-fallback
 
LABEL arch-fallback
 
   LINUX ../vmlinuz-linux
 
   LINUX ../vmlinuz-linux
   APPEND root=LABEL=AB_RAIZ
+
   APPEND root=LABEL=AB_RAIZ rw
 
   INITRD ../initramfs-linux-fallback.img
 
   INITRD ../initramfs-linux-fallback.img
 
FIN
 
FIN
Line 609: Line 57:
 
umount /tmp/archbase
 
umount /tmp/archbase
 
rmdir /tmp/archbase
 
rmdir /tmp/archbase
cat /usr/lib/syslinux/mbr.bin > /dev/nbd0
+
cat /usr/lib/syslinux/bios/gptmbr.bin > /dev/nbd0
 
blockdev --flushbufs /dev/nbd0
 
blockdev --flushbufs /dev/nbd0
 
qemu-nbd -d /dev/nbd0
 
qemu-nbd -d /dev/nbd0
</nowiki>}}
 
 
====== Increment size of the image ======
 
 
* Assume partition of 1G created in previous step. Resize to 2G.
 
 
{{bc|<nowiki>
 
modprobe nbd max_part=8
 
qemu-img convert archbase.qcow2 -O raw archbase.raw
 
dd of=archbase.raw bs=1G count=0 seek=2
 
qemu-img convert archbase.raw -O qcow2 archbase.qcow2
 
qemu-nbd -c /dev/nbd0 archbase.qcow2
 
sleep 2
 
echo -e "p\nd\nn\np\n1\n\n\na\n1\np\nw\nq\n" | fdisk /dev/nbd0
 
e2fsck -f /dev/nbd0p1
 
resize2fs /dev/nbd0p1
 
blockdev --flushbufs /dev/nbd0
 
qemu-nbd -d /dev/nbd0
 
</nowiki>}}
 
 
===== Network =====
 
 
{{bc|<nowiki>
 
ip tuntap add dev tap0 mode tap user djgera
 
ip tuntap add dev tap1 mode tap user djgera
 
brctl addbr br0
 
brctl setfd br0 0
 
brctl addif br0 enp0s16
 
brctl addif br0 tap0
 
brctl addif br0 tap1
 
ip link set dev br0 up
 
ip link set dev tap0 up
 
ip link set dev tap1 up
 
ip addr del 192.168.0.77/24 dev enp0s16
 
ip addr add 192.168.0.77/24 broadcast + dev br0
 
ip route add default via 192.168.0.1
 
 
</nowiki>}}
 
</nowiki>}}

Latest revision as of 20:04, 24 March 2015

Presentation

My name is Gerardo Exequiel Pozzi (djgera). I am from Buenos Aires (Argentina), my year of birth is 1982. My areas of interest are: low-level programming, theory of languages and mathematics in general.

I am using Arch Linux since December of 2008, my original distro was Slackware Linux since October of 2001. I like helping the community in what it can within my reach, for example reporting bugs and feature request, new ideas, packaging, etc.

Reported bugs and feature requests

Git repo

Arch Linux configurations

host: exequiel

host: papucho

host: backup

¡Machetes!

qemu-kvm

Quick image with base setup

A quick way to make an image with a base installation without installer.

  • Packages needed: syslinux arch-install-scripts
  • First time boot with fallback initramfs, then run mkinitcpio -p linux.
  • Adjust /etc/locale.gen, run locale-gen.
modprobe nbd max_part=8
qemu-img create -f qcow2 /tmp/archbase.qcow2 1G
qemu-nbd -c /dev/nbd0 /tmp/archbase.qcow2
sleep 2
sgdisk -n 1:+0:0 -A 1:set:2 /dev/nbd0
mkfs.ext4 -m0 -L AB_RAIZ /dev/nbd0p1
mkdir /tmp/archbase
mount /dev/nbd0p1 /tmp/archbase
pacstrap -c /tmp/archbase
mkdir /tmp/archbase/boot/syslinux
cat << FIN > /tmp/archbase/boot/syslinux/syslinux.cfg
# DEFAULT arch

LABEL arch
  LINUX ../vmlinuz-linux
  APPEND root=LABEL=AB_RAIZ rw
  INITRD ../initramfs-linux.img

LABEL arch-fallback
  LINUX ../vmlinuz-linux
  APPEND root=LABEL=AB_RAIZ rw
  INITRD ../initramfs-linux-fallback.img
FIN
extlinux -i /tmp/archbase/boot/syslinux
umount /tmp/archbase
rmdir /tmp/archbase
cat /usr/lib/syslinux/bios/gptmbr.bin > /dev/nbd0
blockdev --flushbufs /dev/nbd0
qemu-nbd -d /dev/nbd0