Migrating Arch's initscripts to dash

I recently "discovered" dash and how fast it is as compared to bash. FYI, dash is "a POSIX-compliant shell that is much smaller than bash". That being said, here are some simple benchmarks which compare the speed of bash and dash using a for loop (btw, I'm ran the tests below in bash since 'time' is a bash built-in):
(test.sh w/ output redirection)
for x in `seq 50000`; do
echo "" > /dev/null
done
results for bash:
$ time bash test.sh
real    0m2.143s
user    0m1.740s
sys     0m0.413s
$ time bash test.sh
real    0m2.180s
user    0m1.730s
sys     0m0.450s
$ time bash test.sh
real    0m2.189s
user    0m1.717s
sys     0m0.460s
ave: 2.171 seconds
results for dash:
$ time dash test.sh
real    0m0.741s
user    0m0.350s
sys     0m0.403s
$ time dash test.sh
real    0m0.729s
user    0m0.413s
sys     0m0.327s
$ time dash test.sh
real    0m0.732s
user    0m0.360s
sys     0m0.373s
ave: 0.734 seconds
* In this test, dash is 2.96 times faster than bash!
(test.sh w/o output redirection)
for x in `seq 50000`; do
echo -n ""
done
results for bash:
$ time bash test.sh
real    0m0.845s
user    0m0.833s
sys     0m0.010s
$ time bash test.sh
real    0m0.867s
user    0m0.863s
sys     0m0.007s
$ time bash test.sh
real    0m0.871s
user    0m0.870s
sys     0m0.003s
ave: 0.861 seconds
results for dash:
$ time dash test.sh
real    0m0.167s
user    0m0.177s
sys     0m0.003s
$ time dash test.sh
real    0m0.165s
user    0m0.153s
sys     0m0.020s
$ time dash test.sh
real    0m0.174s
user    0m0.167s
sys     0m0.013s
ave: 0.169 seconds
* In this test, dash is 5.10 times faster than bash! Astonishing!
Now think about this... How much will Arch's boot speed increase if we use dash instead of bash for our initscripts? Of course, there are some caveats like some "bash-specific" or "bash-oriented" (non-POSIX-compliant) shell scripts that won't work in dash.
I don't know if there are already existing efforts to make this happen so I'm bringing this up now. Tell me what you think.
BTW, I also found a discussion about dash and bash in the ubuntu-devel mailing list.
Last edited by djclue917 (2007-11-30 03:40:40)

Out of curiosity (Okay I'm procrastinating doing something else) I did a quick port of /lib/udev/load-modules.sh from bash to dash. This is a known  bottleneck for boot time because it's called several times and is a bit slow.
The big problem is that /etc/rc.conf uses arrays and dash doesn't support them. In the case of load-modules.sh we don't need true arrays but just space-separated values. In a complete move to dash, /etc/rc.conf would be updated to reflect this. But to not break things I just use eval/grep/tr to parse rc.conf. Which is probably not very efficient. (And could lead to bugs)
I tested both with a module I actual use, and a blacklisted module. I saw speed improvements with dash in both cases. Because my testing was not very scientific, I'm posting my code instead of numbers:
load-module.dash
#! /bin/dash
# Implement blacklisting for udev-loaded modules
# Includes module checking
# - Aaron Griffin & Tobias Powalowski for Archlinux
# /etc/rc.conf is only parsable by bash. Fake it for dash.
#. /etc/rc.conf
eval `grep MOD /etc/rc.conf | tr '()' '""'`
[ $# -ne 1 ] && exit 1
if [ -f /proc/cmdline ]; then
for cmd in $(cat /proc/cmdline); do
case $cmd in
*=*) eval $cmd ;;
esac
done
fi
# blacklist framebuffer modules
for x in $(echo /lib/modules/$(uname -r)/kernel/drivers/video/*/*fb*); do
BLACKLIST="$BLACKLIST $(basename $x .ko)"
done
for x in $(echo /lib/modules/$(uname -r)/kernel/drivers/video/*fb*); do
BLACKLIST="$BLACKLIST $(basename $x .ko)"
done
# get the real names from modaliases
i="$(/sbin/modprobe -i --show-depends $1 | sed "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" | sed 's|-|_|g')"
# get blacklistet modules
k="$(echo $BLACKLIST ${MOD_BLACKLIST} | sed 's|-|_|g')"
j="$(echo $MODULES | sed 's|-|_|g')"
#add disabled MODULES (!) to blacklist - much requested feature
for m in ${j}; do
[ "$m" != "${m#!}" ] && k="${k} ${m#!}"
done
# add disablemodules= from commandline to blacklist
k="${k} $(echo ${disablemodules} | sed 's|-|_|g' | sed 's|,| |g')"
# echo "k = [[ $k ]]" # Confirm that module parsing is working
# echo "m = [[ $m ]]" # Confirm that module parsing is working
if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" ] && [ "$load_modules" != "off" ]; then
if [ "${k}" != "" ]; then
for n in ${i}; do
if echo ${k} | /bin/grep "\<$n\>" 2>&1 >/dev/null; then
/usr/bin/logger -p info \
"udev load-modules: $i is blacklisted"
exit 1
fi
done
fi
/sbin/modprobe $1
else
/usr/bin/logger -p info \
"udev load-modules: autoloading is disabled, not loading $i"
fi
# vim: set et ts=4:
testdash
#!/bin/dash
[ $# -ne 2 ] && exit 1
test_shell=$1
test_mod=$2
modprobe -r $test_mod
for i in `seq 1 100`; do
if [ $test_shell = "dash" ]; then
/bin/dash ./load-modules.dash $test_mod
elif [ $test_shell = "sh" ]; then
/bin/sh ./load-modules.sh $test_mod
elif [ $test_shell = "bash" ]; then
/bin/bash ./load-modules.sh $test_mod
elif [ $test_shell = "shdash" ]; then
/bin/sh ./load-modules.dash $test_mod
elif [ $test_shell = "bashdash" ]; then
/bin/bash ./load-modules.dash $test_mod
fi
modprobe -r slhc
done
Invoke with
time ./testdash dash slhc
Or
time ./testdash sh slhc
You also can test /bin/bash versus /bin/sh (Which i assume is a symlink to bash, but bash handles it differently) or you can test bash or sh with my dash script (Which is slower due to the eval/grep/tr hack)
Someone running bootchart before and after might be interesting.

Similar Messages

  • [SOLVED] Archiso doesn't work when booting

    (Note for moderators: I don't know where to put this post, so I just put it here. Move it if it isn't in the right section.)
    Hello
    Here's my problem: I want to make a Arch live-cd with custom packages, custom hooks, ... So I searched for a way to do it. Larch works, but it's not modular. Then, I found Archiso, the official tool for Arch developers: very modular, and fits exactly to my needs.
    The only problem is that when I want to boot it (with VirtualBox), a kernel panic occurs The error is:
    /bin/run-init: opening console: No such file or directory
    Kernel panic - not syncing: Attempted to kill init!
    According to the archiso hook, it appears that when passing control to Arch Linux Initscripts, it tries to open /dev/console, and fails.
    What's the problem, and how can I fix it?
    devildante
    Last edited by devildante (2009-03-30 19:12:02)

    after building the iso and the archiso-git package from the aur several times, i still get the same error:
    build log:
    make all
    mkarchiso -p "`cat packages.list` grub-gfx" create "work"
    mkarchiso : Configuration Settings
    working directory: work
    image name: none
    ====> Creating working directory: work
    ====> Installing packages to 'work/root-image/'
    /tmp/alpm_cgZcCL/.INSTALL: line 4: grep: command not found
    Cleaning up what we can
    mv "work/root-image/boot" "work/iso/"
    cp -r boot-files/* "work/iso/boot/"
    cp isomounts "work"
    sed -i "s|@ARCH@|`uname -m`|g" "work/isomounts"
    mkinitcpio -c mkinitcpio.conf -b "work/root-image" -k 2.6.29-ARCH -g "work/iso/boot/archbox".img
    :: Begin build
    :: Parsing hook [base]
    :: Parsing hook [archiso-early]
    :: Parsing hook [udev]
    :: Parsing hook [archiso]
    :: Parsing hook [pata]
    :: Parsing hook [scsi]
    :: Parsing hook [sata]
    :: Parsing hook [usb]
    :: Parsing hook [fw]
    :: Parsing hook [filesystems]
    :: Parsing hook [usbinput]
    :: Generating module dependencies
    :: Generating image 'work/iso/boot/archbox.img'...SUCCESS
    cp -r overlay "work/"
    cp -r "work/root-image/usr/lib/grub/i386-pc/"* "work/iso/boot/grub"
    mkarchiso -f -p grub-gfx iso "work" "`pwd`/archbox-1.00-`uname -m`".iso
    mkarchiso : Configuration Settings
    working directory: work
    image name: /home/gentox/archbox/archbox-1.00-i686.iso
    ====> Generating SquashFS image for 'work/root-image'
    Creating SquashFS image. This may take some time...
    Image creation done in 10.57 minutes.
    ====> Generating SquashFS image for 'work/overlay'
    Creating SquashFS image. This may take some time...
    Image creation done in 0.00 minutes.
    ====> Making bootable image
    Creating ISO image...
    mkarchiso -f -p grub-gfx usb "work" "`pwd`/archbox-1.00-`uname -m`".img
    mkarchiso : Configuration Settings
    working directory: work
    image name: /home/gentox/archbox/archbox-1.00-i686.img
    ====> Generating SquashFS image for 'work/root-image'
    Removing old SquashFS image...done.
    Creating SquashFS image. This may take some time...
    Image creation done in 9.20 minutes.
    ====> Generating SquashFS image for 'work/overlay'
    Removing old SquashFS image...done.
    Creating SquashFS image. This may take some time...
    Image creation done in 0.00 minutes.
    ====> Making bootable image
    1096899+0 Datensätze ein
    1096899+0 Datensätze aus
    561612288 Bytes (562 MB) kopiert, 10,7464 s, 52,3 MB/s
    mke2fs 1.41.6 (30-May-2009)
    Dateisystem-Label=
    OS-Typ: Linux
    Blockgröße=4096 (log=2)
    Fragmentgröße=4096 (log=2)
    34320 Inodes, 137112 Blöcke
    0 Blöcke (0.00%) reserviert für den Superuser
    Erster Datenblock=0
    Maximale Dateisystem-Blöcke=142606336
    5 Blockgruppen
    32768 Blöcke pro Gruppe, 32768 Fragmente pro Gruppe
    6864 Inodes pro Gruppe
    Superblock-Sicherungskopien gespeichert in den Blöcken:
    32768, 98304
    Schreibe Inode-Tabellen: erledigt
    Schreibe Superblöcke und Dateisystem-Accountinginformationen: erledigt
    Das Dateisystem wird automatisch nach jeweils 32 Einhäng-Vorgängen bzw.
    alle 180 Tage überprüft, je nachdem, was zuerst eintritt. Veränderbar mit
    tune2fs -c oder -t .
    WARNING: All config files need .conf: /etc/modprobe.d/sound, it will be ignored in a future release.
    WARNING: All config files need .conf: /etc/modprobe.d/framebuffer_blacklist.pacsave, it will be ignored in a future release.
    63+0 Datensätze ein
    63+0 Datensätze aus
    32256 Bytes (32 kB) kopiert, 0,000226286 s, 143 MB/s
    Warnung: /home/gentox/archbox/archbox-1.00-i686.img ist kein blockorientiertes Gerät
    Festplatte /home/gentox/archbox/archbox-1.00-i686.img: Die Geometrie konnte nicht festgestellt werden
    Festplatte /home/gentox/archbox/archbox-1.00-i686.img: 68 Zylinder, 255 Köpfe, 63 Sektoren/Spur
    sfdisk: FEHLER: Sektor 0 hat keine MS-DOS-Signatur
    /home/gentox/archbox/archbox-1.00-i686.img: nicht erkannte Partitiontabellentyp
    Alte Aufteilung:
    Keine Partitionen gefunden
    Warnung: gegebene Größe (1096899) überschreitet maximal erlaubte Größe (1092357)
    Neue Aufteilung:
    Warnung: Die Partition sieht aus, als sie gemacht worden
    für C/H/S=*/73/6 (anstelle von 68/255/63).
    Für diese Auflistung nehme ich diese Geometrie an.
    Einheit = Sektoren von 512 Bytes, Zählung beginnt bei 0
    Gerät boot. Anfang Ende #Sektoren Id System
    /home/gentox/archbox/archbox-1.00-i686.img1 * 63 1096961 1096899 83 Linux
    Anfang: (c,h,s) erwartet (0,10,4) gefunden (0,1,1)
    Ende: (c,h,s) erwartet (1023,72,6) gefunden (68,72,6)
    /home/gentox/archbox/archbox-1.00-i686.img2 0 - 0 0 Leer
    /home/gentox/archbox/archbox-1.00-i686.img3 0 - 0 0 Leer
    /home/gentox/archbox/archbox-1.00-i686.img4 0 - 0 0 Leer
    Warnung: Partition 1 reicht über das Ende der Platte hinaus
    Die neue Partitionstabelle wurde erfolgreich geschrieben
    Die Partitionstabelle wird erneut gelesen…
    BLKRRPART: Unpassender IOCTL (I/O-Control) für das Gerät
    Wenn Sie eine DOS-Partition angelegt oder geändert haben, z. B. /dev/foo7,
    dann nehmen Sie dd(1), um die ersten 512 Bytes auf 0 zu setzen:
    „dd if=/dev/zero of=/dev/foo7 bs=512 count=1" (siehe fdisk(8)).
    Probing devices to guess BIOS drives. This may take a long time.
    GNU GRUB version 0.97 (640K lower / 3072K upper memory)
    [ Minimal BASH-like line editing is supported. For the first word, TAB
    lists possible command completions. Anywhere else TAB lists the possible
    completions of a device/filename. ]
    grub> device (hd0) /home/gentox/archbox/archbox-1.00-i686.img
    grub> root (hd0,0)
    Filesystem type is ext2fs, partition type 0x83
    grub> setup (hd0)
    Checking if "/boot/grub/stage1" exists... yes
    Checking if "/boot/grub/stage2" exists... yes
    Checking if "/boot/grub/e2fs_stage1_5" exists... yes
    Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
    succeeded
    Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
    Done.
    building dir:
    http://root.stcim.de/arch0r/archbox.tgz
    best regards :>
    Last edited by arch0r (2009-06-09 19:38:09)

  • [Not solved]systemd-tmpfiles stat(/run/user/myuser/gvfs) failed: Perm

    I get this error message since a couple of days and systemd-tmpfiles service is slow to start compared to before. I have no arch-units/initscripts anymore. I update everyday but I can see no updates that sticks out in pacman-log, on the day before this failure appeared. (systemd-tools was updated 3 days before this error)
    Permissions;
    /run/user
    drwxr-xr-x 3 root root 60 7 jun 10.51 .
    drwxr-xr-x 11 root root 340 7 jun 10.51 ..
    drwx------ 3 myuser myuser 80 7 jun 10.51 myuser
    /run/user/myuser
    drwx------ 3 myuser myuser 80 7 jun 10.51 .
    drwxr-xr-x 3 root root 60 7 jun 10.51 ..
    dr-x------ 2 myuser myuser 0 7 jun 10.51 gvfs
    lrwxrwxrwx 1 root root 17 7 jun 10.51 X11-display -> /tmp/.X11-unix/X0
    /run/user/myuser/gvfs
    dr-x------ 2 myuser myuser 0 7 jun 10.51 .
    drwx------ 3 myuser myuser 80 7 jun 10.51 ..
    EDIT: Now I've look at the files;
    /usr/lib/tmpfiles.d
    totalt 160K
    drwxr-xr-x 2 root root 4,0K 2 jun 15.54 .
    drwxr-xr-x 167 root root 128K 7 jun 07.34 ..
    -rw-r--r-- 1 root root 30 1 jun 02.28 console.conf
    -rw-r--r-- 1 root root 29 27 maj 06.29 consolekit.conf
    -rw-r--r-- 1 root root 719 1 jun 02.28 legacy.conf
    -rw-r--r-- 1 root root 729 1 jun 02.28 systemd.conf
    -rw-r--r-- 1 root root 449 1 jun 02.28 tmp.conf
    -rw-r--r-- 1 root root 622 1 jun 02.28 x11.conf
    And the only thing possibly close is; d /run/user 0755 root root 10d
    from systemd.conf.
    Last edited by swanson (2012-06-08 07:20:28)

    Nope, error still there and no clue what's happening. It occurs without me trying to mount anything, no usb's, no phones and no disks.

  • Kernel panic when booting from USB

    Hi guys, I'm trying to install arch on a cd-less HW (www.linutop.com) but during boot from USB
    I get this kernel panic:
    :: Waiting for devices to settle...
    usb 2-3.1: configuration #1 chosen from 1 choice
    :: Waiting 16s for USB devices
    scsi 2:0:0:0: Direct-Access     CBM    Flash Disk     4.00 PQ: 0 ANSI: 2
    sd 2:0:0:0: [sdb]: Assuming drive cache: write through
    sdb: sdb1
    sd 2:0:0:0: [sdb] Attached SCSI removable disk
    :: Scanning for boot device...
    :: Scanning cd drives...
    :: Scanning usb drives...
    /dev/sdb1
    squashfs: version 3.4 (2008/08/26) Phillip Lougher
    Registering unionfs 2.5 (for 2.6.27-rc6)
    :: Mounting root (union) filesystem
    :: Mounting images
    ::: Binding /bootmnt to bootmnt
    :: Passing control to Arch Linux Initscripts...Please Wait
    /bin/run-init: opening console: No such file or directory
    Kernel panic - not syncing: Attempted to kill init!
    This happens with both images archlinux-2009.02-2-ftp-i686.img and archlinux-2009.02-core-i686.img.
    Have checked md5's of the downloaded files and they were correct, have also tried to double write it
    to the usb stick but still the same kernel panic message.
    (I can play play space invaders from the grub menu though :-) )
    Many thanks for any info on this.
    UPDATE:
    Ups, it uses AMD Geode processor and google doesn't suggest it's i686 compatible. Can this be the reason? Please confirm and I'll mark this as solved.
    Last edited by inetic (2009-03-22 23:56:39)

    It is Geode LX. Thanks
    Last edited by inetic (2009-03-23 12:11:32)

  • After migrating data from Time Machine, some of my photos are not showing up in iPhoto. I get a 'dashed rectangle." When I click on it I get ' ! in a Triangle" When I click on that, I actually can see the photo. I want to see my photos

    After migrating data from Time Machine, some of my photos are not showing up in iPhoto LIbrary view. I get a 'dashed rectangle." When I click on it I get ' ! in a Triangle" When I click on that, I actually can see the photo. I want to see all  my photos in 'Library' view, and I can't figure out how these photos seem to be arbitrarily hidden. Help, please.

    Try these for the first attempt:
    First be sure to have a backup copy of the library if you already don't have one.
    OT

  • Migrating from Arch to Dual Boot (Arch 64 + Win8.1 64).

    Hello my friends.
    I used to have a dual boot system (MBR, if I'm not mistaken), with Arch Linux on hda (1TB) and Windows 7 on hdb (300GB). I did this installation more than 3 years ago.
    The disk with windows died recently, and because I need it for work (virtual machine is not an option), I decided to make a "refresh" on my machine.
    I bought two new disks, a 240GB SSD and a 3TB HDD.
    What I would like to do is to install both Windows 8.1 and Arch Linux on the SSD disk (100GB for Windows, 140GB for Arch, my main system), and use the 3TB (for Arch) and the 1TB (for Windows) disks as storage.
    While doing a research on how to do the installation, some questions arised.
    I know that I must (or at least should, for make the processe easier) install Windows first. I will install in the EFI mode, as my machine alread has it.
    1. Which boot loader I should use when installing Arch Linux?
    From what I'd read, to keep things simple, I should opt for a bootloader like gummyboat, that will recognise the Windows without manual intervantion. Is this right?
    2. Will I have problems with the Windows Update?
    I read here https://bbs.archlinux.org/viewtopic.php?id=187194 that when Windows update, it mess with the EFI partition and will make the Arch stop booting (the boot will enter directly on Windows). Is this correct? Is this related only to "automatic" updates (and manual updates can be made without problem)? There is any way to avoid this?
    3. After installing both systems, will Arch Linux recognize my 1TB disk?
    My 1TB disk has my actual Arch linux installation, and data. I would like to copy this data to the 3TB disk and then, under Windows, format it to serve as my Windows storage disk.
    I can do this BEFORE installing the system, or after. But the second option causes me some concerning regarding the rights and so on, so that I do not know if my "new" system" will be able to copy things from the old system.
    Should I make the copy before installing Arch Linux?
    I think this is it.
    If you could helping me with these questions and pointing problems/flaws with my approach, I'll be immensely gratefull.
    Chhers,
    Eduardo.

    Hello elken
    While I could maintain the system under BIOS/MBR, and I don't had any problem with this in the last 2 years, I want to change my system to EFI/GPT.
    I found that Windows under EFI must be under GPT (As pre-installed Windows 8.1), while under BIOS it must be under MBR. So, as my system is (will be) a DUAL one, and It is not a MAC system (that would allow to the EFI/GPT loader to chain a BIOS/MBR, I have to choose between EFI/GPT or BIOS/MBR.
    Because my system can be setup under EFI/GPT, and because sooner or later BIOS/MBR will start to disappear, I want to change it now. This will mke it easier in the future to upgrade my system, I think.
    Not to mention that GPT has some nice advantages over MBR. For example, GPT can handle my 3TB disk without problems, while MBR not. (At least, fdisk wasn't able to deal with it).
    So, you could say that despite BIOS/MBR being fully funcional right now, it's a matter of personal taste (and learning) to me, this desire to completely change my system to EFI/GPT
    For now, I decided to mantain the LINUX and WINDOWS separated (as they are now), i.e., on separate disks. This should solve the problem of windows messing with the boot loader when upgrading (point 2).
    About the bootloader, I think I'll change to gummybot, to test it. I think I could still use grub 2 (I'm not entirely sure), but Gummybot seems simple and fair enough.
    As an aside, I think I will try to migrate my system to the new HDF using rsync and making the necessary adjustments (like in fstab).
    It seems not to difficult, and there are many documents out there on how to do this.
    When I finish, I'll post here how I did and what worked and what not
    Cheers,
    Eduardo

  • Newbie consulting about migration to Arch Linux from Ubuntu

    I am using Ubuntu until I find Arch Linux, and I feel I quite agree with its principle of simplicity. I am considering a migration to Arch Linux.
    The two major aspects I am thinking over are NTFS support and Chinese support.
    As for NTFS, I need a system which has the capability to both read and write NTFS partitions, and stability is quite important for me. I cannot afford any data loss! With Ubuntu, I have never suffered a data loss from NTFS partitions.
    As for Chinese, I do not care about the UI language. Usually I use US English. But I need the system to display Chinese and allow me to input Chinese.
    Does Arch Linux meet my requirements? Or is it possible to configure it to have those capabilities?
    Thank you! And sorry for my poor English.

    Runiq wrote:
    ntfs-3g takes care of NTFS support. It's quite stable here, and I reckon Ubuntu uses it as well.
    From my experiences with writing Japanese, I'd say that Arch is definitely able display Chinese as well. Writing chinese Characters shouldn't be that difficult either, given the fact that all Linux packages are basically the same. It's also possible to display and write Chinese characters in a console.
    As for stability, I never had any problems, though it's in rare cases necessary to refer to the homepage before updating system-critical packages. I'd also update at least once a week if I were you.
    Thank you!
    The stability I stated mainly refers to the stability of ntfs-3g.

  • Migrating Fedora to Arch with Raid

    Hi everyone,
    I am considering moving from Fedora 16 to Arch and I was wondering if anybody could point me in the right direction re:
    1. special considerations and support when migrating from Fedora to Arch (preserving file structures)
    2. I have a 4 disc Raid 5 lvm ext4 setup that I want to keep. It's about 4TB of data so very hard to backup. Any suggestions on what install risks I need to look out for? Again, just pointers to available resources would be great.
    thanks,
    Michael

    answers;
    1.nothing specific, Follow the beginners guide and you will be mostly fine.
    2.Wiki again.RAID and LVM
    Last edited by hadrons123 (2012-01-22 14:04:25)

  • Migration to Arch Linux without extra partition requirement

    Hello every body.
    I'm currently making somes linux migration distribution, which means, installing on the current root partition Arch Linux and then having the possibility to switch from one to the other one just like you would have 2 distros on separate partitions. As you can imagine it's a interesting challenge. For me it is a must since I do not have any disk free needer want to create any new partitions. Moreover, the all process is possible to be done remotetly.
    They is an available detail explaination how I proceed at http://kiao.no-ip.info/depot/arch.
    Just be aware it is continuously updated as I'm doing the migration.
    Any comment are welcome
    Thierry
    Last edited by kiao (2007-07-10 12:26:30)

    Have you looked at the wiki for installing the arch32 bit enviornment on arch64 ?
    I think it's basically a decription of what your wanting to do. Even though it was written for just adding a minimal 32 bit install within arch 64, you could use the steps to install a complete sytem within another.
    http://wiki.archlinux.org/index.php/Arc … bit_system

  • How do I migrate from KDEMOD back to Arch's KDE package?

    I've been a fan of KDEMOD for a long time, now that they are phasing it out, I'm kinda stuck in the limbo and would like to move to Arch's KDE package, is there a seamless way that you guys can recommend while keeping my KDE configurations?
    Thanks!

    I would back up your ~/.kde4
    cp -vR ~/.kde4 ~./kde4bak
    In theory you should be able to comment out the kdemod repos in pacman.conf and then run
    pacman -Syyuu
    to refresh the databases and downgrade from kdemod.
    You should then be able to install KDE from [extra] or [kde-unstable] if the latter is enabled
    You might also want to get a list of installed KDEmod packages to know what KDE packages to get

  • Help migrating from OS X to Arch

    Hi Arch users,
    I'm using Mac OS X as my primary OS. Certain constraints on my job don't hold anymore, so I have regained freedom of choice and I'm looking forward to switch back to Linux. I have already installed Arch on an old laptop, the distro of my choice.
    The main pieces of my tool chain are free (as in freedom), so in that aspect switching is a no brainer. I'm referring to Emacs, Git, TeX and MediaWiki.
    However, I'm struggling to find some applications that offer me:
    * An address book that syncs with cell phones
    * An email client integrated with the address book
    * A simple GTD task and project manager
    * A calendar application
    ** Syncing of the previous two among them and with cell phones
    I know Evolution might offer some of the above functionality. I would prefer a more Unix-like solution, though. I mean, small programs that do one thing and do it well, e.g. mutt, alpine or vim.
    I'm looking for suggestions as what to try in order to achieve that functionality.
    Thanks in advance.
    PS: I might also add that Emacs may offer some of what I'm looking for, but I'd prefer not ending up making Emacs my whole OS. Org Mode might be a good choice for GTD, though.
    If anyone knows OS X, just for reference, I'm using: Address Book, iCal, Mail, Actiontastic and Quicksilver.

    Possible, sure. In each case, I think they're just lines in text files. You could write a script to do this:
    1. pull each birthday from the abook database, save it in an associative array1 keyed by names.
    2. Also pull the last modtime from the abook database, call it modtime1.
    3. pull each birthday from the remind database, save it in an assoc array2 keyed by names.
    4. Also pull the last modtime from the remind database, call it modtime2.
    5. the synch script has its own assoc array3 and array4, keyed by names, which it reads/writes to disk. array3[name] is a birthday. array4[name] is a last modtime.
    6. for each name in the union of array1's keys and array2's keys:
    set array1_is_newer to false, and array2_is_newer to false
    if array1[name] != array3[name] and modtime1 > array4[name] then array1_is_newer = true end
    if array2[name] != array3[name] and modtime2 > array4[name] then array2_is_newer = true end
    if array1_is_newer and array2_is_newer then
    prompt the user what to do
    else if array1_is_newer then
    array3[name] = array1[name]
    array4[name] = modtime1
    update the remind database with array1[name]
    else if array2_is_newer then
    ...similarly
    else
    do nothing
    end
    7. at the end, write array3 and array4 back to disk.
    Anyway, that's the basic idea. Now, has someone already written and debugged and polished such a script? I dunno. Let us know if you come across it. But it wouldn't be hard if you're comfortable scripting.
    Last edited by Profjim (2010-02-02 21:32:33)

  • Main obstacle migrating to Arch: netcfg2 wireless using ralink drivers

    Dlink DWL-G122  rev:B1 usb wireless card (ralink chipset)   --> rt2500usb,rt2x00usb,rt2x00lib modules loaded on boot
    Arch will connect to my network on boot; I am assigned a proper ip from the router but I can't ping anything (router, other windows box on network, google) or use pacman. If I take down the network and try to bring it back up again I get:
    :: wep up [BUSY]
    DHCP IP lease attempt failed [FAIL]
    I can get a connection using the windows driver and ndiswrapper but the connection is very unstable ( the same driver is running fine using ndiswrapper on Ubuntu). In any case I'd much rather run a kernel supported native driver. Below are my config files. Can anyone provide some insight? Many thanks,
    /etc/rc.conf
    LOCALE="en_US.utf8"
    HARDWARECLOCK="localtime"
    USEDIRECTISA="no"
    TIMEZONE="Canada/Pacific"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(!ndiswrapper !ndiswrapper-utils e100 mii via-rhine rt2500usb
    rt2x00lib rt2x00usb
    snd-mixer-oss
    snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore)
    USELVM="no"
    HOSTNAME="jdesk"
    eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
    INTERFACES=(!eth0)
    gateway="default gw 192.168.0.1"
    ROUTES=(!gateway)
    NETWORKS=(wep)
    DAEMONS=(syslog-ng !network netfs crond net-profiles)
    /etc/network.d/wep
    CONNECTION="wireless"
    DESCRIPTION="A simple WEP encrypted wireless connection"
    INTERFACE=wlan0
    SCAN="yes"
    TIMEOUT="50"
    SECURITY="wep"
    ESSID="Rhodes"
    KEY="s:mykey"
    IP="dhcp"

    Could be a recent kernel bug
    http://bbs.archlinux.org/viewtopic.php? … 41#p440841
    There's a workaround, and the update should hit the repos fairly quickly.
    Last edited by iphitus (2008-10-27 09:16:10)

  • Cannot boot after a migration to systemd in OpenVZ

    EDIT: I "solved" my problem, and I doubt this thread will ever help anybody. You're warned.
    Hello,
    Earlier today, my Arch install that was still running with initscripts (and without the last filesystem/bash upgrade) suddently rebooted, and that broke a certain number of things (services weren't starting anymore, etc.). I figured I had waited too long before migrating to systemd for good, and therefore I followed the migration guide on the Wiki, added the "init=/usr/lib/systemd/systemd" kernel parameter and rebooted again.
    Sadly, ps -p 1 was still showing init instead of systemd. After a few more tries, I installed systemd-sysvcompat (thus replacing the sysvinit package), and rebooted again. That last reboot failed. Now OpenVZ stops suddently with the following messages:
    [root@ks /]# vzctl start 106
    Starting container ...
    vzquota : (warning) Quota is running for id 106 already
    Container is mounted
    Adding IP address(es): ***
    Setting CPU units: 1000
    Setting CPUs: 2
    /bin/bash: line 72: /bin/cp: No such file or directory
    ERROR: Can't copy file /etc/rc.conf
    Unable to start init, probably incorrect template
    Container start failed
    Stopping container ...
    Container was stopped
    vzquota : (error) Quota off syscall for id 106: Device or resource busy
    vzquota off failed [3]
    I tried to chroot in the VM folder and reinstall sysvinit, but that was too late:
    pacman -U /var/cache/pacman/pkg/sysvinit-2.88-9-x86_64.pkg.tar.xz
    error: could not open file: /etc/mtab: No such file or directory
    error: could not determine filesystem mount points
    error: failed to commit transaction (unexpected error)
    Errors occurred, no packages were upgraded.
    It looks like I can't use pacman in a chroot. The host OS is not running Arch so I cannot use pacman with the --root flag.
    I'm running out of ideas. Any help would be really appreciated...
    Thank you.
    Last edited by Vlavv (2013-06-27 00:26:12)

    The problem with the chroot options is that I don't have the root privileges on the host machine. I was only able to access that chroot thanks to a kind administrator, but I couldn't ask too much either.
    OK, so I've done some Ugly Things, messed with the contents of the sysvinit package archive manually to get the right files at the right places, and eventually managed to boot my VM and get all the stuff working. I'm certainly not proud of myself, but at least things are working again for now. I'll do a clean reinstall later. Thank you for the suggestion, and sorry for the noise.
    Cheers.

  • Samba shares no longer visible after migration to systemd

    EDIT: Note the file server is CLI only.
    I upgraded my file server to systemd about a week ago and have yet to get the Samba share visible from other devices within my network.  Eveything worked fine under initscripts and other than system upgrades the only thing that has changed about the system is the migration to systemd and addition of the netcfg package.  I can connect manually by typing "smb://<IP>" in a file manager address field but when trying to access the Share via browsing on two different WD media players, a Xoom tablet, typing "smb://" in the address bar of a basic file manager like Thunar or PCManFM or using browsing the Network or Samba Shares links in the Network place from Dolphin the share just doesn't show up.
    The fact that I can access the Share directly, it's just not visible when browsing, makes me think samba is working properly but I'm not sure how to further diagnose the issue and I'd really like to solve the problem and learn something rather than just load up a previous image of the PC before the systemd migration.
    Commands from client
    my /etc/hosts...
    cat /etc/hosts
    #<ip-address> <hostname.domain.org> <hostname>
    127.0.0.1 localhost.localdomain localhost dads-pc
    192.168.10.131 dads-pc.HOMESERVER dads-pc
    192.168.10.100 Serverbox.HOMESERVER Serverbox
    Master Browser search, this does look odd, I don't use it on any machine so where the heck did the .255 at the end of the IP address come from? 
    $ nmblookup -M HOMESERVER
    querying HOMESERVER on 192.168.10.255
    name_query failed to find name HOMESERVER#1d
    I can sign in fine...
    $ smbclient -L Serverbox
    Enter dad's password:
    Failed to load upcase.dat, will use lame ASCII-only case sensitivity rules
    Failed to load lowcase.dat, will use lame ASCII-only case sensitivity rules
    Domain=[HOMESERVER] OS=[Unix] Server=[Samba 3.6.9]
    Sharename Type Comment
    IPC$ IPC IPC Service (Samba Server)
    Server Disk The Family Network Share Files
    ParentalMovies Disk Movie folders for Mom and Dad
    Movies Disk Family Movie folders
    Domain=[HOMESERVER] OS=[Unix] Server=[Samba 3.6.9]
    Server Comment
    SERVERBOX Samba Server
    Workgroup Master
    HOMESERVER SERVERBOX
    I can sign in as one of the media players fine...
    $ smbclient -L Serverbox -U lr_mediaplayer
    Enter lr_mediaplayer's password:
    Failed to load upcase.dat, will use lame ASCII-only case sensitivity rules
    Failed to load lowcase.dat, will use lame ASCII-only case sensitivity rules
    Domain=[HOMESERVER] OS=[Unix] Server=[Samba 3.6.9]
    Sharename Type Comment
    IPC$ IPC IPC Service (Samba Server)
    Server Disk The Family Network Share Files
    ParentalMovies Disk Movie folders for Mom and Dad
    Movies Disk Family Movie folders
    Domain=[HOMESERVER] OS=[Unix] Server=[Samba 3.6.9]
    Server Comment
    SERVERBOX Samba Server
    Workgroup Master
    HOMESERVER SERVERBOX
    Commands from Server
    Both smbd and nmbd services appear functional...
    $ systemctl status smbd nmbd
    smbd.service - Samba SMB/CIFS server
    Loaded: loaded (/etc/systemd/system/smbd.service; enabled)
    Active: active (running) since Mon, 2012-11-19 17:48:07 CST; 2h 9min ago
    Main PID: 534 (smbd)
    CGroup: name=systemd:/system/smbd.service
    ├ 534 /usr/sbin/smbd -F
    ├ 551 /usr/sbin/smbd -F
    └ 559 /usr/sbin/smbd -F
    nmbd.service - Samba NetBIOS name server
    Loaded: loaded (/etc/systemd/system/nmbd.service; enabled)
    Active: active (running) since Mon, 2012-11-19 17:48:07 CST; 2h 9min ago
    Main PID: 536 (nmbd)
    CGroup: name=systemd:/system/nmbd.service
    └ 536 /usr/sbin/nmbd -F
    The global portion of my /etc/samba/smb.conf file...
    [global]
    workgroup = HOMESERVER
    server string = Samba Server
    log file = /var/log/samba/%m.log
    max log size = 50
    dns proxy = No
    valid users = dad, lisa, administrator,lr_mediaplayer, xoom, br_mediaplayer
    read list = dad, lisa, administrator, lr_mediaplayer, xoom, br_mediaplayer
    write list = dad, lisa, administrator
    load printers = no
    write cache size = 262144
    large readwrite = yes
    # These next lines have been added after systemd conversion based on web research, none of which has helped.
    log level = 10
    name resolve order = host bcast lmhosts wins
    interfaces = eth0 192.168.10.100/19
    preferred master = yes
    Testing of the /etc/samba/smb.conf file, no errors ...
    $ testparm smb.conf
    Load smb config files from smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[Movies]"
    Processing section "[ParentalMovies]"
    Processing section "[Server]"
    Loaded services file OK.
    WARNING: You have some share names that are longer than 12 characters.
    These may not be accessible to some older clients.
    (Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
    Server role: ROLE_STANDALONE
    My network config file for [email protected]...
    $ cat /etc/network.d/eth0
    CONNECTION='ethernet'
    DESCRIPTION='A basic static ethernet connection using iproute'
    INTERFACE='eth0'
    IP='static'
    ADDR='192.168.10.100'
    #ROUTES=('192.168.0.0/24 via 192.168.1.2')
    GATEWAY='192.168.10.1'
    DNS=('76.85.229.110' '76.85.229.111')
    Master Browser search and again with the rogue .255 ending for the IP address being broadcast.
    $ nmblookup -M HOMESERVER
    INFO: Current debug levels:
    all: 10
    tdb: 10
    printdrivers: 10
    lanman: 10
    smb: 10
    rpc_parse: 10
    rpc_srv: 10
    rpc_cli: 10
    passdb: 10
    sam: 10
    auth: 10
    winbind: 10
    vfs: 10
    idmap: 10
    quota: 10
    acls: 10
    locking: 10
    msdfs: 10
    dmapi: 10
    registry: 10
    doing parameter name resolve order = host bcast lmhosts wins
    doing parameter log file = /var/log/samba/%m.log
    doing parameter max log size = 50
    doing parameter dns proxy = No
    doing parameter valid users = dad, lisa, administrator,lr_mediaplayer, xoom, br_mediaplayer
    doing parameter read list = dad, lisa, administrator, lr_mediaplayer, xoom, br_mediaplayer
    doing parameter write list = dad, lisa, administrator
    doing parameter load printers = no
    doing parameter write cache size = 262144
    doing parameter large readwrite = yes
    doing parameter preferred master = yes
    pm_process() returned Yes
    lp_servicenumber: couldn't find homes
    set_server_role: role = ROLE_STANDALONE
    Substituting charset 'UTF-8' for LOCALE
    added interface eth0 ip=fe80::3285:a9ff:fe8e:90f7%eth0 bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
    added interface eth0 ip=192.168.10.100 bcast=192.168.10.255 netmask=255.255.255.0
    bind succeeded on port 0
    Socket options:
    SO_KEEPALIVE = 0
    SO_REUSEADDR = 1
    SO_BROADCAST = 1
    Could not test socket option TCP_NODELAY.
    Could not test socket option TCP_KEEPCNT.
    Could not test socket option TCP_KEEPIDLE.
    Could not test socket option TCP_KEEPINTVL.
    IPTOS_LOWDELAY = 0
    IPTOS_THROUGHPUT = 0
    SO_SNDBUF = 212992
    SO_RCVBUF = 212992
    SO_SNDLOWAT = 1
    SO_RCVLOWAT = 1
    SO_SNDTIMEO = 0
    SO_RCVTIMEO = 0
    Could not test socket option TCP_QUICKACK.
    Socket opened.
    lang_tdb_init: /usr/lib/samba/en_US.UTF-8.msg: No such file or directory
    querying HOMESERVER on 192.168.10.255
    bind succeeded on port 0
    Socket options:
    SO_KEEPALIVE = 0
    SO_REUSEADDR = 1
    SO_BROADCAST = 1
    Could not test socket option TCP_NODELAY.
    Could not test socket option TCP_KEEPCNT.
    Could not test socket option TCP_KEEPIDLE.
    Could not test socket option TCP_KEEPINTVL.
    IPTOS_LOWDELAY = 0
    IPTOS_THROUGHPUT = 0
    SO_SNDBUF = 212992
    SO_RCVBUF = 212992
    SO_SNDLOWAT = 1
    SO_RCVLOWAT = 1
    SO_SNDTIMEO = 0
    SO_RCVTIMEO = 0
    Could not test socket option TCP_QUICKACK.
    parse_nmb: packet id = 9235
    nmb packet from 192.168.10.100(35072) header: id=9235 opcode=Query(0) response=Yes
    header: flags: bcast=No rec_avail=Yes rec_des=Yes trunc=No auth=Yes
    header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0
    answers: nmb_name=HOMESERVER<1d> rr_type=32 rr_class=1 ttl=259200
    answers 0 char .....d hex 0000C0A80A64
    Got a positive name query response from 192.168.10.100 ( 192.168.10.100 )
    192.168.10.100 HOMESERVER<1d>
    Thank you.
    Last edited by imatechguy (2012-11-20 03:16:39)

    ChojinDSL wrote:Do you have a firewall running on that server?
    Are your clients also using systemd?
    Yes I do have a firewall, iptables, and it's the same configuration from before the migration to systemd.  Also note that I can access the shares when explicitly defining the path whether that's in a File Manager, cli or other so access isn't being blocked.  For lack of a better explanation the whole thing gives the appearance that although the Share is active it's just not broadcasting it's existence like it should be.
    I have two PC's, both Arch, one with Openbox and one running KDE that I have migrated to systemd.  Both can access the Share when the path is explicitly defined but don't see it when trying to just browse for the the Share.  I have a Xoom tablet, running Android Jelly Bean, that exhibits the same behavior.  I also have two media players, one an older WD LiveTV Plus model the other a newer WD LiveTV model, neither of which can see the share and browsing is the only option for those devices.  So I've got a pretty good assortment of devices and operating systems that could see the share when browsing previously but can not see the same share by browsing since the migration to systemd on the file server.
    Thank you.

  • Replacing bash with dash or zsh as default shell

    Now that initscripts are no longer default init system for Arch, it should be possible (if initscripts removed from system) to remove bash and replace it with other shell, right? On my system I have this:
    :: autoconf: requires bash
    :: automake: requires bash
    :: ca-certificates: requires bash
    :: cpupower: requires bash
    :: dcron: requires bash
    :: enca: requires bash
    :: fftw: requires bash
    :: filesystem: requires bash
    :: gpm: requires bash
    :: gsl: requires bash
    :: gzip: requires bash
    :: iptables: requires bash
    :: libksba: requires bash
    :: m4: requires bash
    :: man-db: requires bash
    :: mkinitcpio: requires bash
    :: p7zip-light: requires bash
    :: pacman: requires bash
    :: pkgstats: requires bash
    :: pm-utils: requires bash
    :: shadow: requires bash
    :: smartmontools: requires bash
    :: systemd: requires bash
    :: unzip: requires bash
    (Note: I've removed packets requiring sh.)
    Here's a complete list of packets depending on bash (110):
    abcde
    abs
    acpid
    antiword
    arch-backup
    archboot
    arch-install-scripts
    arch-wiki-lite
    audio-convert
    aurphan
    autoconf
    autojump
    automake
    bashburn
    bash-completion
    bashdb
    bashrun
    bwidget
    ca-certificates
    cl
    cpupower
    cronie
    dcron
    dhclient
    dkms
    drbd
    dvdrtools
    ecl
    enca
    fftw
    filesystem
    foomatic-db-engine
    fssos-nsvs
    geos
    gimp-gap
    gpm
    groovy
    gsl
    gzip
    hdparm (optional)
    ifplugd
    incron
    initscripts
    inputattach
    iptables
    jython
    kim4
    laptop-mode-tools
    libksba
    lksctp-tools
    lrzip
    lvm2
    lvm2 (testing)
    lxc
    m4
    man-db
    mathomatic (optional)
    mfs-chunkserver
    mfs-client
    minicom
    mkinitcpio
    multipath-tools
    nanoblogger
    noip
    ode
    oidentd
    opencv-samples
    openlierox (optional)
    openslp
    ozerocdoff
    p7zip
    pacman
    pacmatic
    pax-utils
    pkgstats
    pkgtools
    pmount
    pm-utils
    polipo
    ponysay
    preload
    quilt
    ratpoison
    rblcheck
    redis
    rkhunter
    rpcbind
    rpmextract
    sane
    sdcc
    shadow
    smartmontools
    source-highlight
    speedtouch
    systemd
    tablelist
    taglib-rcc
    ted
    tor
    translate-toolkit
    txt2man
    unzip
    uptimed
    vde2
    vnstat
    wdm
    wings3d
    wireshark-cli
    xbase
    xdm-archlinux
    Do these packages (except initscripts) really need bash? Debian uses dash as its default shell, I think Arch at least need to offer a possibility for using shells other than bash as default.
    Any thoughts?

    Demon wrote:Why not? I'm just exploring the possibilities.
    zsh is not completely backwards-compatible with bash (not that bash is "backwards" in any real way).  There's always a chance that, without the bash interpreter installed, some utilities written in bash won't work properly.  Also, sh in Arch is distributed in the bash package, so uninstalling it will pull those packages with it.
    Demon wrote:But then packages not needing bash (autoconf, automake, gzip, unzip) should list only sh as dependency, not bash. Right?
    Some of them already do:
    Arch Linux :: GLaDOS » pacman -Rp bash
    error: failed to prepare transaction (could not satisfy dependencies)
    :: autoconf: requires bash
    :: automake: requires bash
    :: bison: requires sh
    :: ca-certificates: requires bash
    :: cairo: requires sh
    :: cpupower: requires bash
    :: cronie: requires bash
    :: db: requires sh
    :: dhcpcd: requires sh
    :: dictd: requires sh
    :: diffutils: requires sh
    :: dmenu: requires sh
    :: e2fsprogs: requires sh
    :: fakeroot: requires sh
    :: filesystem: requires bash
    :: findutils: requires sh
    :: flex: requires sh
    :: freetype2: requires sh
    :: gawk: requires sh
    :: gdbm: requires sh
    :: gettext: requires sh
    :: gmp: requires sh
    :: gpm: requires bash
    :: grep: requires sh
    :: gzip: requires bash
    :: icu: requires sh
    :: iptables: requires bash
    :: keyutils: requires sh
    :: laptop-mode-tools: requires bash
    :: libgpg-error: requires sh
    :: libksba: requires bash
    :: libpng: requires sh
    :: libtool: requires sh
    :: libusb-compat: requires sh
    :: m4: requires bash
    :: make: requires sh
    :: man-db: requires bash
    :: mkinitcpio: requires bash
    :: nss: requires sh
    :: pacman: requires bash
    :: perl: requires sh
    :: sane: requires bash
    :: sed: requires sh
    :: shadow: requires bash
    :: systemd: requires bash
    :: taglib: requires sh
    :: tar: requires sh
    :: unzip: requires bash
    :: which: requires sh
    :: xorg-mkfontdir: requires sh
    :: xz: requires sh

Maybe you are looking for