Arch install Scripts

Am I correct in assuming that if you download the Arch install scripts to your local machine (that's currently running arch), the process of installing arch onto another hard drive is exactly the same?
Last edited by cyberpsych0sis (2014-11-19 05:01:30)

circleface wrote:Try https://wiki.archlinux.org/index.php/In … ting_Linux and see if it answers your question.  The process is similar, but there are a few differences.
That was the second place I checked all i found was:
The goal of the bootstrapping procedure is to setup an environment from which arch-install-scripts (such as pacstrap and arch-root) run. This goal is achieved by installing arch-install-scripts natively on the host system, or setting up an Arch Linux-based chroot.
If the host system runs Arch Linux, installing arch-install-scripts is straightforward.
Which seems to say it is the same, but it comes across as pretty vague imo.

Similar Messages

  • INSTALL ARCHLINUX (new installation system by Arch Install Script)

    After many failed installations, I've resolved and written a mini-guide how to do an easy installation of Arch Linux. I've added it to Manualinux on point 44b.
    However, I report it below, maybe could be useful to someone:
    44b)INSTALL ARCHLINUX (new installation system by Arch Install Scripts)
    Choice if install ArchLinux 32 or 64 bit, following type these commands:
    -loadkeys it (choice your language)
    -Use cfdisk to create your partitions
    cfdisk /dev/sda  o /dev/sdx
    -Format Partitions Using mkfs and Create Swap
    mkfs.reiserfs /dev/sda1
         or
    mkfs.ext4 /dev/sda1
    mkswap /dev/sda2
    -Reboot system with installation cd
    reboot
    -Mount Partition:
    cd /
    mount /dev/sda1 /mnt
    -Make and mount swap partition:
    swapon /dev/sda2
    -Active wireless or ethernet connection
    wifi-menu (choice your wireless connection, I suggest your to disable temporarely your password on router-modem)
    dhcpcd (attach ethernet wire)
    -Install Base System:
    pacstrap /mnt base base-devel
    -Install Grub2:
    pacstrap /mnt grub-bios
    -Install Syslinux:
    pacstrap /mnt syslinux
    -Generate fstab:
    genfstab -p /mnt >> /mnt/etc/fstab
    -Login to arch-chroot:
    arch-chroot /mnt
    -Install package wifi-select
    ip link set wlan0 up
    pacman -S wifi-select
    -Configure Network:
    vi /etc/rc.conf
    add interface="eth0"
    add interface="wlan0"
    -Edit Hostname:
    vi /etc/hostname
    and add desired hostname
    -Set Timezone:
    ln -s /usr/share/zoneinfo/Europe/Rome /etc/localtime
    -Generate Locale:
    vi /etc/locale.gen
    enable:
    it_IT.UTF-8 UTF-8
    it_IT ISO-8859-1
    it_IT@euro ISO-8859-15
    -Execute locale-gen on shell:
    locale-gen
    -Configure Kernel:
    mkinitcpio -p linux
    -Configure Bootloader:
    grub-mkconfig -o /boot/grub/grub.cfg
    grub-install --recheck /dev/sda
    -Set root password:
    passwd root
    -Exit from arch-chroot:
    exit
    -Unmount Partition:
    umount /mnt
    -Reboot your system
    reboot
    -If ethernet wire is attached:
    dhcpcd
    -If you want configure wireless network:
    ip link set wlan0 up
    wifi-select (if you have not password on router-modem)
    pacman -Syu  kde wicd wicd-gtk (insert kdm wicd in /etc/rc.conf)
    reboot system and configure your router wireless/wifi connection
    Reinsert wireless password on your router/modem
    Last edited by Pantera (2012-09-17 20:14:31)

    You don't need to install both grub and syslinux. You configure grub in "Configure Bootloader" so this step is unnecessary:
    -Install Syslinux:
    pacstrap /mnt syslinux
    This next step doesn't configure the kernel, it creates an initramfs (see the Beginners' Guide):
    -Configure Kernel:
    mkinitcpio -p linux
    Last edited by 2ManyDogs (2012-09-17 20:28:58)

  • "Arch By Hand" UEFI GPT SSD LUKS Install Script

    Arch UEFI GPT LUKS (and non LUKS version) Automated Install Example Script, SSD friendly
    Please note that if you're going to use this you're going to have to a) customize it to fit your needs and b) know what system config you need to do post install (rc.* etc). It's a jumping off point.
    Want to put in a lot of effort just to get Arch Linux listed in your "bios" startup options? You're in the right post! Well, it's more than just that, of course. If you have an EFI machine, increasingly common, this might be of interest.
    I got this working on my x220 tablet and thought I'd post it here. I imagine that as Archboot and the official installer rev we'll see them support this kind of thing as well, so BBS seemed like a good place to post it, but if there is an appropriate wiki location I could add it there as well.
    This is pretty bare bones (otherwise you'd be using AIF or Archboot, natch) and should be customized for your own install purposes. Nonetheless, I suspect others may have been banging their heads on the low overhang of UEFI/GPT install and hope this helps them get up and running.
    This is pretty much all in the wiki and BBS in various places, particularly the GRUB2 wiki entry. However the GPT partitioning (and learning more of sgdisk) were challenging enough that I felt it would be useful for others to see a working script.
    I used the current-as-of-this-post Archboot iso (archlinux-2011.10-1-archboot.iso).
    Don't just dd the archlinux iso to a usb. Format the USB stick as an MBR FAT drive and dump the entire Archboot ISO contents to it. To be honest, I did this in an Ubuntu vmware image I had on my mac, though I'd like to include command line options for doing this. TODO!
    I also stuck the script (included herein) on the drive, but you could get it on the installation image at install time as well via scp or whatever you prefer.
    On my x220 I then set the UEFI "BIOS" (the UEFI setup) to boot *ONLY* from UEFI. Pretty important. You should probably also stack your USB drive to top of your startup list or manually select it at boot time.
    Boot from the USB stick. For my x220 I selected the second of the four efi grub options, x86_64.
    Once Archboot is up, immediately leave the installer (option 8)
    You may want to mount the usb drive to /src if you stuck this script on it. Archboot in UEFI mode doesn't seem to mount the usb drive properly (and the normal Archboot efi install will fail as well due to this). I think this is getting fixed in the next Archboot release, from what I've read on BBS.
    # mount /dev/sdb1 /src
    Run the script. For me this is
    # /src/myarch.sh
    (WARNING: will nuke everything on /dev/sda unless you've changed it).
    There are probably things that could be done better/cleaner, feel free to point those out. This is really just a jumping off point.
    UPDATE 15 NOV 2011: This now sources most packages locally to avoid kernel mismatch between install medium and install target.
    UPDATE 16 NOV 2011: Script now unified the boot and efi partitions.
    UPDATE 17 NOV 2011: Migrated code to github, including two versions (non-encrypted and LUKS-encrypted)
    UPDATE 18 NOV 2011: Added encrypted swap
    UPDATE 18 NOV 2011: Changed /boot/efi/grub to /boot/grub; removed extraneous /boot/efi directory entirely.
    UPDATE 19 NOV 2011: Added a post-install script to handle user setup, etc. No reboot required.
    UPDATE 20 NOV 2011: Post install section more complete, visudo automation added.
    See code at: https://github.com/altercation/arch-by-hand
    Last edited by altercation (2011-11-20 21:09:33)

    I've come up with this script (although it's not quite right either):
    #!/bin/bash
    # prereqs:
    # mount /dev/sdb1 /src
    set -o nounset
    #set -o errexit
    INSTALL_TARGET="/mnt"
    HR="--------------------------------------------------------------------------------"
    # Initialize
    # Warn
    timer=9
    echo -n "This procedure will completely format /dev/sda. Please cancel with ctrl-c to cancel within $timer seconds..."
    while [[ $timer -gt 0 ]]
    do
    sleep 1
    let timer-=1
    echo -en "$timer seconds..."
    done
    echo "Starting"
    # Configure_Host
    echo -e "\nFormatting disk...\n$HR"
    # disk prep
    sgdisk -Z /dev/sda # zap all on disk
    sgdisk -a 2048 -o /dev/sda # new gpt disk 2048 alignment
    # create partitions
    sgdisk -n 1:0:+250M /dev/sda # partition 1 (UEFI BOOT), default start block, 250MB
    sgdisk -n 2:0:+2G /dev/sda # partition 2 (SWAP), default start block, 2G
    sgdisk -n 3:0:+100M /dev/sda # partition3, (BOOT), boot partition
    sgdisk -n 4:0:+10G /dev/sda # partition 4, (ARCH), default start, remaining space
    sgdisk -n 5:0:0 /dev/sda # partition 5, (HOME)
    # set partition types
    sgdisk -t 1:ef00 /dev/sda
    sgdisk -t 2:8200 /dev/sda
    sgdisk -t 3:8300 /dev/sda
    sgdisk -t 4:8300 /dev/sda
    sgdisk -t 5:8300 /dev/sda
    # label partitions
    sgdisk -c 1:"UEFI BOOT" /dev/sda
    sgdisk -c 2:"SWAP" /dev/sda
    sgdisk -c 3:"BOOT" /dev/sda
    sgdisk -c 4:"ARCH" /dev/sda
    sgdisk -c 5:"HOME" /dev/sda
    # make filesystems
    echo -e "\nCreating Filesystems...\n$HR"
    mkfs.vfat /dev/sda1
    mkswap /dev/sda2
    mkfs.ext2 /dev/sda3
    mkfs.ext4 /dev/sda4
    mkfs.ext4 /dev/sda5
    # Run /arch/setup
    echo -n "Don't select Grub as your bootloader and exit setup before the Install Bootloader step"
    /arch/setup
    # unmount filesytems
    umount /dev/sda1
    swapoff /dev/sda2
    umount /dev/sda3
    umount /dev/sda5
    # Get Network
    echo -n "Waiting for network address.."
    #dhclient eth0
    dhcpcd -p eth0
    echo -n "Network address acquired."
    # Update Pacman
    echo -e "\nUpdating pacman...\n$HR"
    sed -i "s/^#S/S/" /etc/pacman.d/mirrorlist
    pacman --noconfirm -Sy
    pacman --noconfirm --needed -S pacman
    pacman --noconfirm -S gptfdisk btrfs-progs-unstable
    # Prepare to chroot to target
    mv ${INSTALL_TARGET}/etc/resolv.conf ${INSTALL_TARGET}/etc/resolv.conf.orig
    cp /etc/resolv.conf ${INSTALL_TARGET}/etc/resolv.conf
    sed -i "s/^#S/S/" ${INSTALL_TARGET}/etc/pacman.d/mirrorlist
    mount -t proc proc ${INSTALL_TARGET}/proc
    mount -t sysfs sys ${INSTALL_TARGET}/sys
    mount -o bind /dev ${INSTALL_TARGET}/dev
    echo -e "${HR}\nINSTALL BASE COMPLETE\n${HR}"
    # Write Files
    # install_efi (to be run *after* chroot /install)
    touch ${INSTALL_TARGET}/install_efi
    chmod a+x ${INSTALL_TARGET}/install_efi
    cat > ${INSTALL_TARGET}/install_efi <<EFIEOF
    mount /boot
    mount /boot/efi
    modprobe efivars
    modprobe dm-mod
    pacman --noconfirm -Sy
    pacman --noconfirm --needed -S pacman
    pacman --noconfirm -R grub
    pacman --noconfirm -S grub2-efi-i386
    grub_efi_i386-install --root-directory=/boot/efi --boot-directory=/boot/efi/efi --bootloader-id=grub --no-floppy --recheck
    efibootmgr --create --gpt --disk /dev/sda --part 1 --write-signature --label "ARCH LINUX" --loader "\\EFI\\grub\\grub.efi"
    grub-mkconfig -o /boot/efi/efi/grub/grub.cfg
    exit
    EFIEOF
    # Install EFI
    chroot /install /install_efi
    rm /install/install_efi

  • How I Got Boxee Working On A New Arch Install -- 3/12/2011

    I thought I'd post a log of how one gets boxee-source working as of version 0.9.23.15885-2.
    I recently built myself a new media center/apache server/seedbox and thought I would put arch on it.  The Install was a breeze --- as far any arch install is concerned.
    The only trouble I really had was with boxee --- usually available as a precompiled package, but (as is often the case) in either the AUR or an unofficial repo.
    There wasn't very much useful (up-to-date) information in the boxee wiki page; I tried the repo listed but it required the python24 dependency to install, with which there are problems. See below.
    There are a lot of problems with compiling boxee in arch at the moment, so I thought I'd list each one and what I did to get around them.
    The three AUR packages in question:
    http://aur.archlinux.org/packages.php?ID=24206
    http://aur.archlinux.org/packages.php?ID=9898
    http://aur.archlinux.org/packages.php?ID=16355
    What I did:
    * Downloaded boxee-source package (not the depreciated boxee package) from AUR  (I used yaourt).
    * Ran makepkg -si; saw what dependencies were required (also available in AUR web interface).  Downloaded python24 and db4.5 dependencies.
    * I noticed that db4.5 is an older version; my installed version is 5.1 !!!!
    * To get python24 to compile, I had to edit the  PKGBUILD script in python24:
    1) First, remove this line:
    [ -e /usr/lib/libdb.so ] && echo "make sure you have no other db* pkg installed" && return 1
    2) Then, delete the "db4.5" dependency from "depends"
    * After python24 compiled and installed (I deleted the db4.5 package source folders) I was able to being the boxee compilation process.  However, I hit another roadblock when the compilation aborted at:
    fatal error linux/smbno.h no such file
    Based on comments in the AUR, I downloaded:  http://dl.dropbox.com/u/5636456/smbno.h and put it in /usr/include/linux  --- then the compilation would continue!
    Finally, boxee was installed. However, one problem remained: boxee would not play videos.  Literally nothing would happen when I chose a file to play.
    I was able to fix this (again with the help of the AUR commentators) by editing the run-boxee-desktop file found in /opt/boxee/.   I had to add this line:
    export LD_PRELOAD=/usr/lib/libva.so
    I had to add it in the same area the rest of the "exports" are in the file; which seemed odd to me. But after that, I was able to use boxee to maximum enjoyment.
    Last edited by yochaigal (2011-03-17 06:52:04)

    yochaigal wrote:The only peristent problem I'm having is that boxee randomly freezes when I play a video.  I get audio but boxee freezes. if the window is maximized i can't unmaximize; i have to kill from tty or ssh. however, if it freezes with the window unmaximized, i can still move the mouse and do other things.
    boxee log says this:
    23:10:45 T:2770783088 M:1705168896   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:3047160688 M:1705181184   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2834795376 M:1705181184 WARNING: CHttpCacheManager::UpdateRefMap negative reference count for url http://app.boxee.tv/applications/popularity (hcm)
    23:10:45 T:2830584688 M:1705181184   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2839542640 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2804353904 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2751892336 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2960128880 M:1704927232   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2770783088 M:1705181184   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2837953392 M:1705054208 WARNING: CHttpCacheManager::UpdateRefMap negative reference count for url http://app.boxee.tv/titles/sources (hcm)
    23:10:45 T:2830584688 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:3047160688 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:3047160688 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2751892336 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2839542640 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2960128880 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2839542640 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2804353904 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2804353904 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2960128880 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:2770783088 M:1705054208   ERROR: CFileCurl::CReadState::Open, didn't get any data from stream. HTTP CODE: 0
    23:10:45 T:3047160688 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2839542640 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2804353904 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2804353904 M:1705054208   ERROR: Texture manager unable to load file:
    23:10:45 T:2960128880 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2770783088 M:1705054208   ERROR: CreateThumbnailFromMemory: exception with fileType: .png
    23:10:45 T:2770783088 M:1705054208   ERROR: Texture manager unable to load file:
    I didn't notice this before. We are getting the same error messages in debug. Out of curiosity, do you have all pacman updates installed? I contacted the AUR maintainer for boxee-source, but his system is operating normally. Googling this " ERROR: CreateThumbnailFromMemory: exception with fileType: .png" I get a laundry list of php related stuff.  My installed version of php is 5.3.6-1.  Maybe it's somehow related?

  • HAI (Home Arch Install) - install packages without root account

    HAI, or Home Arch Install, can "install" and run Arch Linux programs from your normal user account. (Even if you don't run Arch Linux at all - see the config file.)
    HAI's design is heavily inspired by Zero Install, but it uses Arch Linux packages instead of a new package format. This means you can make use of Arch's extensive package database, right now.
    HAI follows the KISS and worse-is-better philosophies. HAI is implemented as a set of specialized bash scripts, with under 500 lines of code in total, so it's not that hard to read, understand and extend.
    HAI doesn't really install the packages it downloads - it uses fakechroot and unionfs-fuse to fool the program you run into thinking it's installed in /usr.
    Quick start guide:
    1. Download HAI from http://www.smnd.sk/tomi/hai/hai-1.1.tar.gz . (The address might eventually change, so please don't link to it directly.)
    2. HAI doesn't need system-wide installation. Just unpack it somewhere.
    3. Put this in your ~/.bashrc file: "alias hai=~/your/directory/with/hai". This allows you to run hai without typing the path.
    4. Run "./bootstrap" from HAI's directory. This downloads dependencies HAI itself needs. (You need FUSE already installed, though.)
    5. Try it:
    hai bwm-ng
    hai frozen-bubble
    hai pysolfc pysolfc-cardsets -- pysol
    hai inkscape -- inkscape somefile.svg
    # in general: hai (what packages to install) -- (what program to run)
    HAI comes with a README.txt file. You really should read it, it's short and if you've read this far, you already know most of it.
    I've been working on HAI for two months and it's finally reached a state bug-free and elegant enough that it satisfies my prefectionism. I developed HAI to scratch my own itch, but please tell me if you try HAI, or perhaps even find it useful! I'd also like to know about any bugs you experience or feature requests you might have. If you find something in the documentation that could use clarifying, tell me as well.
    (Update 2010-05-11: hai-1.1 fixes a bug when downloading from AUR and switches from tar to bsdtar, because tar acts up when downloading xz-compressed packages. For now, bsdtar has to be installed on the local system.)
    Last edited by Tomi (2010-05-11 10:35:44)

    Oops, didn't notice your reply, tavianator. Thanks for the bug reports!
    vercmp: That's what I get for assuming libalpm won't change its internal layout... it was working at the time of HAI's release. Thanks for the fix.
    rsync: I use it to get the fakechroot PKGBUILD. I could download the whole ABS tree through http, but most of the time it would be a waste... I'll try to think of a compromise.
    Using HAI on distros other than Arch isn't very streamlined, though this is something I hope to improve. The SYSTEM_CHECK in the config file needs changing. (It's a program that checks if a package is already installed on the machine.) This line should work (it was tested on Mandriva, which uses rpm too):
    SYSTEM_CHECK='local sysver; sysver=`rpm -qa | grep "^\(\|lib\)$requestname" | sort | grep -o "[^-]*-[^-]*$" | grep -o "^[^-]*"` || true; [ "$sysver" ] && version-ok "$sysver" && true'
    Update on rsync: The PKGBUILD is in http://repos.archlinux.org/wsvn/package … dl&isdir=1 too, but that link can easily change if Arch switched from websvn to someting else. I'd appreciate a second opinion whether to use rsync or this link.
    Last edited by Tomi (2010-05-19 18:21:10)

  • Install media 2012.08.04 and latest install scripts - the shell

    I'm just curious about this: the latest install media uses zsh, the install scripts are bash scripts - the shell you're dropped in after "arch-chroot" is sh (SHELL=/bin/sh chroot "$@")
    Why do we use sh in the chrooted environment?

    Allan wrote:Because zsh is not installed by default...
    I understand, but let me rephrase : why the shell in the chrooted environment is sh and not bash? Isn't bash installed by default?
    In the previous version of the install scripts (present in the previous version of the install cd) the chrooted shell was bash, and in Arch "sh" is a symlink to bash (if I understand correctly, calling "bash" as "sh" make bash behave like sh).
    So, there's a reason to use sh in the chrooted installation?

  • About post install scripts...

    hi,
    i wonder if there is a solution for the post-install script problem to prevent some commands like "rm -rf /" to be executed. I know that Gentoo hasn't got this problem because ebuild scripts use a particular language that doesn't implement a such command. But for Arch which uses bash, could this problem be really resolved ?
    Comete.

    Toth wrote:[...]
    A package is software, and you have to trust that the software you are downloading is legit. If it is, and you trust the packager, you have no reason not to trust the package.
    exactly ---> do not download from sources you dont trust
    (if you ever worked on a windows, you know that already, because there is a lot of evil things around (spyware, virus, bacteria, nice VB-scripts, nice JS-scripts ...))
    -> the problem about security: if your OS becomes popular, then the bad guys see it as enough popular to do something bad with it
    Toth wrote:I assure you, if the package maintainers ever run across a submitted package with "rm -rf /" in the post install script, they won't add it to the Arch Linux repositories. If/when you find a 3rd-party Arch package for download, that's a risk you are going to have to take. Check the scripts, check the source of the program (if you're paranoid). That's about all you can do.
    what about a check (in pacman), to give warning, that something will be done with / ... as i know, there is no line to run with / as parameter for a normal reason during an installation or upgrade
    if you download a non-archlinux.org package (downloaded from somewhere else), the install procedure is now this:
    > pacman -A bad-0.1-1.pkg.tar.gz
    loading package data... done.
    checking for conflicts... done.
    installing ... done.
    >
    the check would look like this:
    > pacman -A bad-0.1-1.pkg.tar.gz
    loading package data... done.
    checking install/upgrade scripts ...
    Warning: Found lines in Install-Script that contain / :
    line 3: do something
    line 4: cd / <---
    line 5: rm -rf *
    line 6: echo "I was a bad script"
    Continue with installation [y|N] y
    checking for conflicts... done.
    installing ... done.
    I was a bad script
    >
    this will at least give the user a chance to look at code that contain "/ " in the install/upgrade/remove-scripts and have some control
    of course this will not check the package-content :-( ... but at least you will have one leak closed particulary

  • [SOLVED] Pass Environment variables from PKGBUILD to .INSTALL script

    Hi everyone,
                       I am trying to modify the grub2-efi-bzr (http://aur.archlinux.org/packages.php?ID=38369) package making some changes in the PKGBUILD and the post-install script. I want to pass few environment variables from the PKGBUILD to the install script. How do I do that?
    Some code from the PKGBUILD
    _bzrtrunk="lp:grub/grub2" # GRUB2 BZR Main Trunk
    # _bzrtrunk="lp:~skodabenz/grub/grub2-bzr-exp" # GRUB2 BZR Experimental Branch
    _bzrmod="grub2"
    if [ ${_bzrtrunk} = "lp:~skodabenz/grub/grub2-bzr-exp" ]
    then
    _bzrmod="grub2_exp"
    pkgver="exp_${pkgver}"
    fi
    # grub-extras bzr repo locations
    _bzrtrunk_zfs="lp:~skodabenz/grub/grub2-extras-zfs"
    _bzrtrunk_lua="lp:~skodabenz/grub/grub2-extras-lua"
    if [ "$CARCH" = 'i686' ]
    then
    _EFI_ARCH=i386
    elif [ "$CARCH" = 'x86_64' ]
    then
    _EFI_ARCH=x86_64
    fi
    # _EFI_ARCH=x86_64 # Uncomment if you want to override the if condition for _EFI_ARCH above, incase the EFI ARCH does not match the Linux Kernel ARCH.
    # $CARCH=x86_64 and _EFI_ARCH=i386 requires gcc-multilib with lib32-glibc installed in the system.
    # I do not know about $CARCH=i686 and _EFI_ARCH=x86_64
    if [ ${_EFI_ARCH} = "i386" ]
    then
    pkgver="${pkgver}_x86"
    _trns_name="grub2_efi_x86"
    elif [ ${_EFI_ARCH} = "x86_64" ]
    then
    pkgver="${pkgver}_x64"
    _trns_name="grub2_efi_x64"
    fi
    Now the post-install script needs the values of _EFI_ARCH and _trns_name env variables. I do not want to copy the if statements to that script as these are decided at compile time but needed while setting up grub2-efi. This is due to the fact that EFI-ARCH need not match the Linux Kernel ARCH. How do I do that.
    Code from the post-install script
    ${_trns_name}-install --root-directory=/ --no-floppy --recheck --debug
    cp /usr/lib/${_trns_name}/${_EFI_ARCH}-efi/lua.mod /boot/${_trns_name}/
    cp /usr/lib/${_trns_name}/${_EFI_ARCH}-efi/zfs.mod /boot/${_trns_name}/
    cp /usr/lib/${_trns_name}/${_EFI_ARCH}-efi/zfsinfo.mod /boot/${_trns_name}/
    cp /usr/lib/${_trns_name}/${_EFI_ARCH}-efi/unifont.pf2 /boot/${_trns_name}/
    cp /usr/lib/${_trns_name}/${_EFI_ARCH}-efi/ascii.pf2 /boot/${_trns_name}/
    ${_trns_name}-mkimage --verbose --directory=/usr/lib/${_trns_name}/${_EFI_ARCH}-efi --prefix="" --output=/boot/${_trns_name}/grub2.efi --format=${_EFI_ARCH}-efi ${_EFI_APP_MODULES}
    Thank in advance.
    Last edited by skodabenz (2010-07-27 15:46:40)

    falconindy wrote:
    Don't rely on %foo% existing -- it won't after the first build and this will prevent the PKGBUILD from being reentrant. I would use something like this (untested):
    sed -i "s|^\(_EFI_ARCH\)=.*|\1=${_EFI_ARCH}|; \
    s|^\(_trns_name\)=.*|\1=${_trns_name}|; \
    s|^\(export _EFI_APP_MODULES\)=.*|\1=${_EFI_APP_MODULES}|" \
    ${startdir}/grub2-efi-bzr.install
    Your code works except for 1 problem in the install script I want
    export __EFI_APP_MODULES="${_EFI_APP_MODULES}" (the passed ${_EFI_APP_MODULES} value should again come inside double quotes).
    right now
    export _EFI_APP_MODULES=ata part_gpt part_msdos fat ntfs ntfscomp ext2 iso9660 udf hfsplus fshelp normal chain linux ls search search_fs_file search_fs_uuid search_label help loopback boot configfile echo efi_gop efi_uga xnu xnu_uuid lvm
    which is equivalent to
    export _EFI_APP_MODULES=ata
    I want
    export _EFI_APP_MODULES="ata part_gpt part_msdos fat ntfs ntfscomp ext2 iso9660 udf hfsplus fshelp normal chain linux ls search search_fs_file search_fs_uuid search_label help loopback boot configfile echo efi_gop efi_uga xnu xnu_uuid lvm"
    How to do it with sed since sed already uses double quotes?

  • Install script is not executed during installation of homemade package

    I'm working on my first PKGBUILD for the AUR, trying to create a package to install dphys-swapfile on Arch.
    Here are the files that I'm using to create this package:
    PKGBUILD
    dphys-swapfile.install
    dphys-swapfile.service
    The installation of dphys-swapfile as specified in the PKGBUILD works perfectly, i.e. it is actually installed to the right location and you can use it without any problems at all.
    The systemd unit file is copied to the right location as well and you can enable and start the service with systemctl.
    The problem arises with the install script. I wrote dphys-swapfile.install so that the service would be automatically enabled and started right after the installation of the package, but this is not working, i.e. the service is neither being enabled not being started, and I don't know what is causing this issue.
    Any insight on what could be failing, as well as general tips on how to improve this package, will be very much appreciated.
    Last edited by jonancm (2015-02-14 22:13:38)

    It looks like presets are the appropriate way to do this:
    systemctl preset is used by the post install scriptlets of RPM packages (or other OS package formats), to enable/disable specific units by default on package installation...

  • Install scripts location [SOLVED]

    In Ubuntu, I had all installed packages' install scripts, md5sum and file lists in /var/lib/dpkg/info. Where can I find this information (especially the install scripts) on arch?
    Last edited by doru001 (2013-07-01 16:43:03)

    Use 'pacscripts e.g.
    $ pacscripts firefox
    post_install() {
    update-desktop-database -q
    gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
    post_upgrade() {
    post_install
    post_remove() {
    post_install
    Edit: For checksums, use 'pacman -Sii foo' or expac, if you want different formatting
    $ pacman -Sii firefox | grep "MD5 Sum"
    MD5 Sum : 6340b282026bda97dd7b2ca5afe52647
    Last edited by karol (2013-07-01 16:35:04)

  • How the bootable Arch install images are created?

    I'm just wondering how to create the bootable Arch install images, including ISO and IMG files which are in the Arch download mirrors.
    Can anyone explain the detailed procedures about it? I just cannot find it in the Wiki.
    Thanks a lot.
    P.S.:
    Is it true that the IMG file was created from the ISO file, as far as Arch install image is concerned?  And how to convert between the IMG and ISO files?
    Thanks.
    Last edited by cwjiof (2008-09-25 07:44:45)

    Using the archiso tool:
    http://projects.archlinux.org/?p=archiso.git;a=summary
    Readme has some more info:
    http://projects.archlinux.org/?p=archis … ME;hb=HEAD
    Archiso is a small set of bash scripts that is capable of building fully
    functional ArchLinux-based liveCDs. It is a very generic tool, so it
    could potentially be used to generate anything from rescue systems,
    to install disks, to special interest liveCD systems, and who knows what
    else. Simply put, if it involves Arch on a shiny coaster, it can do it.
    James
    Last edited by iphitus (2008-09-25 07:58:11)

  • [Solved]32bit chroot install script installs 64bit libs IDK why though

    Ive been though this script with a fine tooth comb and I still cant figure out for the life of me why its still grabbing stuff from the 64bit repo instead of the 32bit repo. when I chroot into /opt/arch32 and issue "uname -m" it still tells me that the arch is x86_64. Even when its downloading stuff from pacman I can see that a lot of the packages have x86_64 at the end of them too.
    edit:
    the mystery is solved, my stage 2 install script copies a preconfigured pacman.conf that doesnt reference the mirrorlist file at all, the repositories were listed in pacman.conf instead.
    Last edited by brando56894 (2009-06-25 02:10:21)

  • Boot problems with second Arch install on an IDE drive

    I have two SATA II drives and two IDE drives (one HDD and one optical) in my box. I had Arch installed on first SATA II drive (/dev/sda). I changed the mkinitcpio files to load sata modules before pata, and that works okay. So, my IDE HDD is now /dev/sdc
    However, I installed a second Arch onto the /dev/sdc (IDE) and it won't boot. It goes through booting process and hangs at checking the drives claiming that the /dev/sda3 has bad superblock. Now, this is really odd, because /dev/sda3 is a SWAP partition, and the init script is trying to run e2fsck on it.
    How do I fix this? Should I simply (somehow) disable the filesystem check?
    (Before you ask, I need the second Arch to build a LiveCD.)

    It's correctly identified as Linux Swap partition. Besides, the first Arch install is still working with that swap partition reporting no problems at boot time.
    Here's the output of fdisk -l:
    Disk /dev/sda: 160.0 GB, 160040803840 bytes
    255 heads, 63 sectors/track, 19457 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x4a424a41
    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 3824 30716248+ 7 HPFS/NTFS
    /dev/sda2 3825 7654 30764475 83 Linux
    /dev/sda3 7655 7903 2000092+ 82 Linux swap / Solaris
    /dev/sda4 7904 13982 48829567+ 5 Extended
    /dev/sda5 7904 13982 48829536 83 Linux
    Disk /dev/sdb: 400.0 GB, 400088457216 bytes
    255 heads, 63 sectors/track, 48641 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x4fa7b7a5
    Device Boot Start End Blocks Id System
    /dev/sdb1 1 48641 390708801 42 SFS
    Disk /dev/sdc: 81.9 GB, 81964302336 bytes
    255 heads, 63 sectors/track, 9964 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xec0c2373
    Device Boot Start End Blocks Id System
    /dev/sdc1 * 1 5 40162 83 Linux
    /dev/sdc2 6 136 1052257+ 82 Linux swap / Solaris
    /dev/sdc3 137 1666 12289725 83 Linux
    /dev/sdc4 1667 9964 66653685 83 Linux
    And just in case, the menu.lst used to boot both Arches:
    # (0) Arch Linux
    title Arch Linux
    root (hd0,1)
    kernel /boot/vmlinuz26 root=/dev/sda2 ro vga=791
    initrd /boot/kernel26.img
    # (1) Arch Linux
    title Arch Linux Fallback
    root (hd0,1)
    kernel /boot/vmlinuz26 root=/dev/sda2 ro
    initrd /boot/kernel26-fallback.img
    # (1) Windows
    title Windows XP
    rootnoverify (hd0,0)
    makeactive
    chainloader +1
    # (2) Arch Linux
    title ArchGem
    root (hd1,0)
    kernel /vmlinuz26 root=/dev/sdc3 ro vga=791
    initrd /kernel26.img
    # (3) Arch Linux
    title ArchGem Fallback
    root (hd1,0)
    kernel /vmlinuz26 root=/dev/sdc3 ro

  • [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

    I am trying to plan an Arch install on a new laptop for dual boot with Windows 8.1, but I know there is a potential to cause huge problems so I have been trying to read and learn about the hard disk partition structure and how I might install the rEFInd boot files so that I am still able to boot Windows once Arch is installed. (Unfortunately for some tasks such as updating the maps on my satnav box Windows is essential). However I am really quite unsure if I am doing the right thing in the way I am thinking about the Arch install so I would appreciate any help from experts on the forum.
    The laptop is a Lenovo IdeaPad Y510p which came with Windows 8 pre-installed, with the option to upgrade to Windows 8.1.  The upgrade was completed without issue and I then looked into the question of hard drive partitions and boot.  I had read posts on the Ubuntu forums about users who had installed Ubuntu on this same laptop and ended up being unable to boot Windows afterwards so I wanted to tread very carefully before executing anything which might cause really major damage. I had also read on the Lenovo forums replies about people who had replaced the hard drive and installed linux only to find that they could  not boot to the recovery partitions, with replies from Lenovo moderators saying that if the partition structure had been changed then the laptop would have to be sent back to Lenovo for a factory repair.
    On this laptop to get into the bios or boot options you do not just press the power button and hit an F key, but instead there is a special small "OneKey Recovery" button next to the power jack, which opens up with options for BIOS setup and boot options as well as normal boot or recovery. This OneKey Recovery button is therefore needed to boot a usbkey - the power button only allows it to boot to windows presumably until/unless a different bootloader and NVRAM entry is amended.
    I have done all the initial ( safe!)changes necessary to move to the point at which I can execute the Arch install. From within Windows (switched off fastboot, and shrunk the "C:" drive to make space for linux partitions).  I have also switched off Secure Boot from the BIOS, and made sure that Windows still boots up fine.
    The current arch install iso (February 2014) boots under uefi just fine - and of course once booted I have access to the gdisk programme.  That certainly showed the pre-existing partitions on the drive (8 partitions with partition number 2 being the EFI partition, and three recovery partitions!) with a GPT partition table, and it should therefore be possible to make the necessary new linux partitions in the now unallocated space on the disk that was freed up with the internal disk management facility within Windows 8.1.  So at that point I created three partitions for a root partition (type 8300), a swap partition (type 8200) and another type 8300 partition which will become /opt in the installed Arch system.
    In order to try and not make any changes to the partition structure I let the three new linux partitions be number 9, 10 and 11.
    I am told that for a GPT disk it is a definite no-no to try to create more than one EFI partition. So I will need to use the existing EFI partition to place the rEFInd files and the kernel once I install Arch.
    In this (Y510p) laptop the EFI partition contains the following structure:
    BOOT/ - containing only boot.sdi
    BOOTSECT.BAK
    EFI/ which contains two directories Boot/ and Microsoft/
    so EFI/Boot/ contains only Boot64.efi which is likely a fallback copy of the Windows 8.1 bootloader
    and EFI/Microsoft/ contains a Boot/ directory - so
    EFI/Microsoft/Boot/ contains loads of language specific directories like en-GB/
    plus bootmgfw.efi (which I believe is the Windows main efi loader file)
    bootmgr.efi
    memtest.efi
    The scheme that I am planning to use which I have previously used in pure Arch uefi machines, is that /boot is a directory in the root partition, /. That way /boot is an ext4 directory and will contain the kernel and initramfs plus the rEFInd linux config file.
    Then I can mount the EFI (vfat) partition as /boot/efi and so I can then make a /boot partition under /.  Then the EFI /BOOT/ directory would be seen in Linux as /boot/efi/BOOT/ and the Windows efi stuff would be in /boot/efi/EFI/Boot/Microsoft/Boot/ in which case I would presume that I have to make a new directory in /boot/efi/EFI/refind/ and put the refind stuff including the filesystem drivers there, and let the kernel go into the (ext4) /boot/ directory which would be preferred!  However I am not 100% confident that this is what will work and I need to read more before trying to do the install. The thing that concerns me is how the system will handle the uefi boot process, and whether it would auto-detect the Windows efi file as well as the Arch refind efi file once the system has started up?
    ... and then there is the issue of the NVRAM entries and I am no longer confident that if I use the usual tools to create an entry (efiboomgr or bcfg), that I will get a successful dual boot system!
    There is still a chance that I would irrevocably damage being able to boot to the Windows and Recovery partition boot options by messing up the EFI and/or the NVRAM so I have to tread very very carefully with this.
    If anyone has gone through this kind of dual boot install with a Windows 8 or 8.1 machine using rEFInd for the bootloader, and can offer advice or help here I would very much appreciate it.  I have another pure Arch system which uses rEFInd that works extremely well, but it seems that dual boot with uefi is a rather more complex animal than a pure linux system!
    Last edited by mcloaked (2014-02-22 10:06:03)

    vipin wrote:I have recently bought the y510p , im planning to install Arch , this is my 4th laptop , i had installed Arch in all the other 3 with no problems, but im a bit worried with the installation as this is the first laptop which has EFI , im a linux user for the past 6 years , i started with fedora , now i like Arch , mike documentation is excellent, i just had one question when i had grub , it automatically finds the new kernel when i update (grub.conf/menu.lst gets updated), does rEFInd also do that.
    When there is an update to the rEFInd package you need to copy the files across to your ESP from the files contained in /usr/share/refind/  usually you need to copy the refind_x64.efi binary as well as the icons, fonts, and drivers directories.  Since there is flexibility in how you configure the kernel and initrd files in terms of where they are located whether you need to do anything else when a new kernel update arrives depends on how you set your system up.  If you have the /boot directory as your ESP partition which will then have the kernel and initrd files updated by default then there no need to do anything else when there is a kernel update. If the ESP is then at /boot/EFI and within that is your refind/ directory then that is where the replacement files go if refind-efi gets a pacman update. So it is actually fairly straight forward. If you configure rEFInd to look for kernels in some other directory than /boot/ then you may need to copy the files there after a kernel update but there is more information in the arch wiki about this.
    During a refind-efi package update there are helpful files in the pacman output (and log) reminding you of what you need to do.  eg for the latest refind-efi update you get:
    [2014-06-18 18:48] [PACMAN] upgraded radvd (1.12-1 -> 1.13-1)
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd UEFI application has been installed at /usr/share/refind/refind_*.efi
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] Other UEFI applications have been installed at /usr/share/refind/tools_*/
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] UEFI drivers have been installed at /usr/share/refind/drivers_*/
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] Copy the efi application (according to your UEFI ARCH)
    [2014-06-18 18:48] [ALPM-SCRIPTLET] and /usr/share/refind/refind.conf-sample to a sub-directory of <EFISYS>/EFI/
    [2014-06-18 18:48] [ALPM-SCRIPTLET] as refind.conf and add an entry to firmware boot menu using efibootmgr
    [2014-06-18 18:48] [ALPM-SCRIPTLET] or mactel-boot (for Macs)
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd Icons have been installed at /usr/share/refind/icons/
    [2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd Fonts have been installed at /usr/share/refind/fonts/
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] HTML Documentation is available at /usr/share/refind/docs/html/
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [ALPM-SCRIPTLET] More info: [url]https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd[/url]
    [2014-06-18 18:48] [ALPM-SCRIPTLET]
    [2014-06-18 18:48] [PACMAN] upgraded refind-efi (0.8.1-1 -> 0.8.2-1)
    I hope that helps.
    By the way you can also boot uefi using grub and in fact you can get rEFInd to chainload grub as a backup bootloader as an added safety factor and have both rEFInd as well as grub installed simultaneously. How that can be done is explained in the thread at https://bbs.archlinux.org/viewtopic.php?id=181906
    Last edited by mcloaked (2014-06-25 17:41:12)

  • Install Script Error?

    It's Christmas day, and I just got an IPOD Video and tried to install the software for it and ran into a whole mess of problems.
    I tried to install ITunes 7 & Quicktime 7, but every time I try I get an error at the end of the installation saying something about a missing Install Script error and that i need to run "ISScript.msi" or contact support.
    I have no idea what to do, and tried to find that file on microsoft.com, but the onlyint that comes up is "Virtual PC 2004" and not how to install it, but work around it.
    any suggestions?

    The Install script engine on this machine is older than the version required to run this setup. If available, please install the lastest version of ISScript.msi or contact your support personnel for further assistance.
    okay, let's try installing a version 11, using the instructions from the following InstallShield document:
    Update to the Latest InstallShield Installation Engines
    is that one of any help with the error message?

Maybe you are looking for