Permalink
Browse files

lglive-installer.sh: Improved

  • Loading branch information...
1 parent 70ae126 commit dfc91b84af135ddd2f52e17dd6399704336e6eda @opatut opatut committed Apr 30, 2011
Showing with 12 additions and 8 deletions.
  1. +12 −8 overlay/opt/bin/lglive-installer.sh
@@ -27,46 +27,50 @@ autopart() {
# create boot partition
parted -s $DEVICE mkpart primary 1 100
- parted -s $DEVICE mkpart set 1 boot on
- mkfs.ext2 -L boot-lglive /dev/sda1
+ parted -s $DEVICE set 1 boot on
+ sleep 2
+ mkfs.ext2 -L boot-lglive ${DEVICE}1
# create swap partition
parted -s $DEVICE mkpart primary 100 612
- parted -s $DEVICE mkpart set 2 swap on
- mkswap -L swap-lglive /dev/sda2
+ sleep 2
+ mkswap -L swap-lglive ${DEVICE}2
swapon -L swap-lglive
# create root partition
parted -s $DEVICE mkpart primary 612 100%
- mkfs.ext4 -L root-lglive /dev/sda3
+ sleep 2
+ mkfs.ext4 -L root-lglive ${DEVICE}3
}
copy_files() {
# copy boot files
mkdir /mnt/boot-lglive/
mount -L boot-lglive /mnt/boot-lglive/
- cp -a /mnt/bootmnt/lglive/boot/* /mnt/boot-lglive/
- cp -a /mnt/bootmnt/syslinux /mnt/boot-lglive/
+ cp -a /bootmnt/lglive/boot/* /mnt/boot-lglive/
+ cp -a /bootmnt/syslinux /mnt/boot-lglive/
# copy root files
mkdir /mnt/root-lglive/
mount -L root-lglive /mnt/root-lglive/
cp -a /bin /etc /gamelist_* /home /lib /opt /root /run /sbin /srv /usr /var /mnt/root-lglive/
mkdir /mnt/root-lglive/{dev,sys,proc,media,mnt,tmp,boot}
chmod 777 /mnt/root-lglive/tmp/
+ mount --bind /mnt/root-lgive/tmp /tmp
}
install_bootloader() {
cat /usr/lib/syslinux/mbr.bin > $DEVICE
sed -i 's|/boot/lglive|..|g' /mnt/boot-lglive/syslinux/syslinux.cfg
extlinux --install /mnt/boot-lglive/syslinux
- sed -s 's|APPEND initrd|APPEND root=LABEL=root-lglive initrd|g' /mnt/boot-lglive/syslinux/syslinux.cfg
+ sed -i 's|APPEND initrd|APPEND root=LABEL=root-lglive initrd|g' /mnt/boot-lglive/syslinux/syslinux.cfg
# bake kernel
sed -i 's|HOOKS.*|HOOKS="base udev pata scsi sata resume filesystems"|g' /etc/mkinitcpio.conf
sed -i 's|kernel26\.img|lglive.img|g' /etc/mkinitcpio.d/kernel26.preset
sed -i 's|PRESETS.*|PRESETS=("default")|g' /etc/mkinitcpio.d/kernel26.preset
+ mkdir /boot
mount --bind /mnt/boot-lglive /boot
mkinitcpio -p kernel26

0 comments on commit dfc91b8

Please sign in to comment.