Difference between revisions of "User:Djgera"

From ArchWiki
Jump to: navigation, search
(Arch Linux configurations)
 
(131 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 identifier: 0x79dfe14b
 
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sda1  *        2048      133119      65536  83  Linux      (64M - ext4 - /syslinux)
 
/dev/sda2          133120    42076159    20971520  83  Linux      (20G - ext4 - / - 32-bit)
 
/dev/sda3        42076160    84019199    20971520  83  Linux      (20G - ext4 - / - 64-bit)
 
/dev/sda4        84019200  3907029167  1911504984    5  Extended  (1.78T)
 
/dev/sda5        84021248    92409855    4194304  82  Swap      (4G)
 
/dev/sda6        92411904  100800511    4194304  83  Linux      (4G - ext4 - /var - 32-bit)
 
/dev/sda7      100802560  109191167    4194304  83  Linux      (4G - ext4 - /var - 64-bit)
 
/dev/sda8      109193216  117581823    4194304  83  Linux      (4G - ext4 - /home - 32-bit)
 
/dev/sda9      117583872  125972479    4194304  83  Linux      (4G - ext4 - /home - 64-bit)
 
/dev/sda10      125974528  1384265727  629145600  83  Linux      (600G - xfs - /data/data0)
 
/dev/sda11    1384267776  3481419775  1048576000  83  Linux      (1000G - xfs - /data/data1)
 
/dev/sda12    3481421824  3907029167  212803672  83  Linux      (203G - 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 identifier: 0xba469f54
 
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdb1            2048  3907029167  1953513560  83  Linux
 
</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 identifier: 0x78aef04c
 
 
 
  Device Boot      Start        End      Blocks  Id  System
 
/dev/sdc1            2048  3907029167  1953513560  83  Linux
 
</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 /mnt/sda1/syslinux
 
cp /usr/lib/syslinux/{chain,menu}.c32 /mnt/sda1/syslinux/
 
</nowiki>}}
 
 
 
{{hc|
 
/syslinux/syslinux.cfg in '''sda1'''
 
|<nowiki>
 
timeout 10
 
 
 
ui menu.c32
 
 
 
 
 
label LINUX-32
 
    com32 chain.c32
 
    append hd0 2
 
 
 
label LINUX-64
 
    com32 chain.c32
 
    append hd0 3
 
 
 
 
 
label memtest86+
 
    linux /memtest86+-4.20.bin
 
</nowiki>}}
 
 
 
 
 
{{bc|<nowiki>
 
extlinux -i /mnt/sda2/boot/syslinux
 
cp /usr/lib/syslinux/{chain,menu}.c32 /mnt/sda2/boot/syslinux/
 
</nowiki>}}
 
 
 
{{hc|/boot/syslinux/syslinux.cfg in '''sda2'''
 
|<nowiki>
 
timeout 10
 
 
 
ui menu.c32
 
 
 
 
 
label 3.6.11-32
 
    linux /boot/vmlinuz-3.6.11-32
 
    initrd /boot/initramfs-3.6.11-32.img
 
    append root=/dev/sda2 rootfstype=ext4 ro vga=normal
 
 
 
 
 
label MAIN
 
    com32 chain.c32
 
    append hd0 0
 
</nowiki>}}
 
 
 
 
 
{{bc|<nowiki>
 
extlinux -i /mnt/sda3/boot/syslinux
 
cp /usr/lib/syslinux/{chain,menu}.c32 /mnt/sda3/boot/syslinux/
 
</nowiki>}}
 
 
 
{{hc|
 
/boot/syslinux/syslinux.cfg in '''sda3'''
 
|<nowiki>
 
timeout 10
 
 
 
ui menu.c32
 
 
 
 
 
label 3.6.11-64
 
    linux /boot/vmlinuz-3.6.11-64
 
    initrd /boot/initramfs-3.6.11-64.img
 
    append root=/dev/sda3 rootfstype=ext4 ro vga=normal
 
 
 
 
 
label MAIN
 
    com32 chain.c32
 
    append hd0 0
 
</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|
 
/etc/locale.conf|
 
<nowiki>
 
LANG="en_US.UTF-8"
 
</nowiki>}}
 
 
 
{{hc|
 
/etc/hostname
 
|<nowiki>
 
gerardo
 
</nowiki>}}
 
 
 
{{hc|
 
/etc/vconsole.conf
 
|<nowiki>
 
KEYMAP="es"
 
</nowiki>}}
 
 
 
{{bc|<nowiki>
 
/etc/localtime -> /usr/share/zoneinfo/America/Buenos_Aires
 
</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+="hdparm -q -B 255 $devnode"
 
ENV{ID_ATA_FEATURE_SET_AAM}=="1", RUN+="hdparm -q -M 128 $devnode"
 
ENV{ID_ATA_FEATURE_SET_PM}=="1", RUN+="hdparm -q -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
 
 
 
[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
 
 
 
[Install]
 
Alias=multi-user.target.wants/network@enp0s16.service
 
</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
 
├── local-fs.target.wants
 
├── 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
 
│   ├── sshdgenkeys.service -> /usr/lib/systemd/system/sshdgenkeys.service
 
│   ├── sshd.service -> /usr/lib/systemd/system/sshd.service
 
│   └── vnstat.service -> /usr/lib/systemd/system/vnstat.service
 
├── network@.service
 
├── printer.target.wants
 
│   └── cups.service -> /usr/lib/systemd/system/cups.service
 
├── sockets.target.wants
 
│   ├── avahi-daemon.socket -> /usr/lib/systemd/system/avahi-daemon.socket
 
│   └── cups.socket -> /usr/lib/systemd/system/cups.socket
 
└── sysinit.target.wants
 
</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"
 
 
 
/sbin/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>}}
 
 
 
{{hc|
 
/etc/apcupsd/apcupsd.conf
 
|<nowiki>
 
UPSCABLE usb
 
UPSTYPE usb
 
DEVICE /dev/usb/hid/hiddev[0-9]
 
LOCKFILE /var/lock
 
SCRIPTDIR /etc/apcupsd
 
PWRFAILDIR /etc/apcupsd
 
NOLOGINDIR /etc
 
ONBATTERYDELAY 6
 
BATTERYLEVEL 50
 
MINUTES 5
 
TIMEOUT 0
 
ANNOY 300
 
ANNOYDELAY 60
 
NOLOGON disable
 
KILLDELAY 0
 
NETSERVER on
 
NISIP 0.0.0.0
 
NISPORT 3551
 
EVENTSFILE /var/log/apcupsd.events
 
EVENTSFILEMAX 10
 
UPSCLASS standalone
 
UPSMODE disable
 
STATTIME 0
 
STATFILE /var/log/apcupsd.status
 
LOGSTATS off
 
DATATIME 0
 
 
 
</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.reboot" ||
 
        action.id == "org.freedesktop.login1.hibernate" ||
 
        action.id == "org.freedesktop.login1.suspend") {
 
        return "no";
 
    }
 
});
 
 
 
polkit.addRule(function(action, subject) {
 
    if (action.id == "org.freedesktop.upower.hibernate" ||
 
        action.id == "org.freedesktop.upower.suspend") {
 
        return "no";
 
    }
 
});
 
</nowiki>}}
 
 
 
==== filesystem ====
 
 
 
i686
 
{{hc|
 
/etc/fstab
 
|<nowiki>
 
tmp                    /tmp          tmpfs    nodev,nosuid,size=75% 0 0
 
 
 
/dev/sda5              none          swap      defaults 0 0
 
 
 
/dev/sda2              /            ext4      noatime,nodev 0 1
 
/dev/sda6              /var          ext4      noatime,nosuid,nodev 0 2
 
/dev/sda8              /home        ext4      noatime,nosuid,nodev 0 2
 
 
 
/dev/sda10            /data/data0  xfs      ro,noatime,nosuid,nodev,noexec 0 2
 
/dev/sda11            /data/data1  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
 
/dev/sda12            /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>}}
 
 
 
x86_64
 
{{hc|
 
/etc/fstab
 
|<nowiki>
 
tmp                    /tmp          tmpfs    nodev,nosuid,size=75% 0 0
 
 
 
/dev/sda5              none          swap      defaults 0 0
 
 
 
/dev/sda3              /            ext4      noatime,nodev 0 1
 
/dev/sda7              /var          ext4      noatime,nosuid,nodev 0 2
 
/dev/sda9              /home        ext4      noatime,nosuid,nodev 0 2
 
 
 
/dev/sda10            /data/data0  xfs      ro,noatime,nosuid,nodev,noexec 0 2
 
/dev/sda11            /data/data1  xfs      ro,noatime,nosuid,nodev,noexec,noauto 0 2
 
/dev/sda12            /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>}}
 
 
 
==== kmod ====
 
 
 
{{hc|
 
/etc/modules-load.d/djgera.conf
 
|<nowiki>
 
#fbcon
 
</nowiki>}}
 
 
 
{{hc|
 
/etc/modprobe.d/djgera.conf
 
|<nowiki>
 
#blacklist nvidia
 
blacklist nouveau
 
blacklist rtl8187
 
blacklist pata_amd
 
</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>}}
 
 
 
==== xorg-xinit ====
 
 
 
{{hc|
 
/etc/udev/rules.d/61-x11-key.rules
 
|<nowiki>
 
ACTION=="remove", GOTO="x11_input_end"
 
 
 
SUBSYSTEM=="input", ENV{ID_INPUT_KEY}=="?*", ENV{xkblayout}="es"
 
 
 
LABEL="x11_input_end"
 
</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]
 
Architecture = auto
 
 
 
IgnorePkg    = pm-utils pm-quirks
 
IgnorePkg    = linux-headers
 
IgnorePkg    = handbrake handbrake-cli
 
IgnorePkg    = nvidia-utils opencl-nvidia
 
 
 
NoUpgrade  = etc/apcupsd/onbattery etc/apcupsd/offbattery etc/apcupsd/changeme etc/apcupsd/commok etc/apcupsd/commfailure
 
 
 
[core]
 
SigLevel = PackageRequired
 
Include = /etc/pacman.d/mirrorlist
 
 
 
[extra]
 
SigLevel = PackageRequired
 
Include = /etc/pacman.d/mirrorlist
 
 
 
[community]
 
SigLevel = PackageRequired
 
Include = /etc/pacman.d/mirrorlist
 
</nowiki>}}
 
  
 
=== ¡Machetes! ===
 
=== ¡Machetes! ===
Line 582: 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
 
sed -i 's|localhost$|localhost archbase|' /tmp/archbase/etc/hosts
 
ln -s /usr/share/zoneinfo/America/Buenos_Aires /tmp/archbase/etc/localtime
 
echo 'KEYMAP="es"' > /tmp/archbase/etc/vconsole.conf
 
echo 'FONT=""' >> /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 606: Line 45:
  
 
LABEL arch
 
LABEL arch
   LINUX /boot/vmlinuz-linux
+
   LINUX ../vmlinuz-linux
   APPEND root=LABEL=AB_RAIZ
+
   APPEND root=LABEL=AB_RAIZ rw
   INITRD /boot/initramfs-linux.img
+
   INITRD ../initramfs-linux.img
  
 
LABEL arch-fallback
 
LABEL arch-fallback
   LINUX /boot/vmlinuz-linux
+
   LINUX ../vmlinuz-linux
   APPEND root=LABEL=AB_RAIZ
+
   APPEND root=LABEL=AB_RAIZ rw
   INITRD /boot/initramfs-linux-fallback.img
+
   INITRD ../initramfs-linux-fallback.img
 
FIN
 
FIN
 
extlinux -i /tmp/archbase/boot/syslinux
 
extlinux -i /tmp/archbase/boot/syslinux
 
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
 
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
 
blockdev --flushbufs /dev/nbd0
 
qemu-nbd -d /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