First check in
This commit is contained in:
3
SNAP/README
Normal file
3
SNAP/README
Normal file
@@ -0,0 +1,3 @@
|
||||
This is the directory where the manifest, snapinfo, and files.tar.gz
|
||||
files will be created. It is also where the usher file should be
|
||||
placed if it is required by the package.
|
||||
108
SNAP/usher
Executable file
108
SNAP/usher
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PASSWD="root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
|
||||
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false"
|
||||
|
||||
GROUP="root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
usb:x:14:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
nogroup:x:99:
|
||||
users:x:999:"
|
||||
|
||||
case $1 in
|
||||
preinst)
|
||||
echo "Creating base directory structure"
|
||||
install -d -m 755 ${TARGET}/etc/{ld.so,conf.d,opt}
|
||||
install -d -m 755 ${TARGET}/usr/bin
|
||||
install -d -m 755 ${TARGET}/bin
|
||||
install -d -m 755 ${TARGET}/boot
|
||||
install -d -m 755 ${TARGET}/dev
|
||||
install -d -m 755 ${TARGET}/home
|
||||
install -d -m 755 ${TARGET}/lib
|
||||
install -d -m 755 ${TARGET}/media/{cdrom,floppy}
|
||||
install -d -m 755 ${TARGET}/mnt
|
||||
install -d -m 755 ${TARGET}/opt
|
||||
install -d -m 755 ${TARGET}/proc
|
||||
install -d -m 750 ${TARGET}/root
|
||||
install -d -m 755 ${TARGET}/run/lock
|
||||
install -d -m 755 ${TARGET}/sbin
|
||||
install -d -m 755 ${TARGET}/srv
|
||||
install -d -m 755 ${TARGET}/sys
|
||||
install -d -m 1777 ${TARGET}/tmp
|
||||
install -d -m 755 ${TARGET}/usr/{bin,include,lib,libexec,local}
|
||||
install -d -m 755 ${TARGET}/usr/local/{bin,include,lib,sbin,share}
|
||||
install -d -m 755 \
|
||||
${TARGET}/usr/local/share/{color,dict,doc,info,locale,man}
|
||||
install -d -m 755 ${TARGET}/usr/local/share/man/man{1..8}
|
||||
install -d -m 755 ${TARGET}/usr/local/share/{misc,terminfo,zoneinfo}
|
||||
install -d -m 755 ${TARGET}/usr/local/src
|
||||
install -d -m 755 ${TARGET}/usr/{sbin,share}
|
||||
install -d -m 755 ${TARGET}/usr/share/{color,dict,doc,info,locale}
|
||||
install -d -m 755 ${TARGET}/usr/share/man/man{1..8}
|
||||
install -d -m 755 ${TARGET}/usr/share/{misc,snap,terminfo,zoneinfo}
|
||||
install -d -m 755 ${TARGET}/usr/src
|
||||
install -d -m 755 ${TARGET}/var/cache/nscd
|
||||
install -d -m 755 ${TARGET}/var/lib/{color,locate,misc}
|
||||
install -d -m 755 ${TARGET}/var/{local,log,mail,opt,snap,spool}
|
||||
install -d -m 1777 ${TARGET}/var/tmp
|
||||
install -m 600 /dev/null ${TARGET}/var/log/btmp
|
||||
install -m 644 /dev/null ${TARGET}/var/log/wtmp
|
||||
install -m 664 /dev/null ${TARGET}/var/log/lastlog
|
||||
ln -sf /proc/self/mounts ${TARGET}/etc/mtab
|
||||
ln -sf lib ${TARGET}/lib64
|
||||
ln -sf lib ${TARGET}/usr/lib64
|
||||
ln -sf lib ${TARGET}/usr/local/lib64
|
||||
ln -sf /run/lock ${TARGET}/var/lock
|
||||
ln -sf /run ${TARGET}/var/run
|
||||
|
||||
if [ ! -f ${TARGET}/etc/resolv.conf ]&&[ -f /etc/resolv.conf ]; then
|
||||
echo "Copying resolv.conf from temporary system"
|
||||
cp /etc/resolv.conf ${TARGET}/etc/resolv.conf
|
||||
fi
|
||||
|
||||
if [ ! -f ${TARGET}/etc/passwd ]; then
|
||||
echo "Creating /etc/passwd"
|
||||
echo ${PASSWD} > ${TARGET}/etc/passwd
|
||||
fi
|
||||
|
||||
if [ ! -f ${TARGET}/etc/group ]; then
|
||||
echo "Creating /etc/group"
|
||||
echo ${GROUP} > ${TARGET}/etc/group
|
||||
fi
|
||||
;;
|
||||
postinst)
|
||||
if [[ ${TARGET} ]]; then
|
||||
echo "Refreshing snap"
|
||||
chroot ${TARGET} snap refresh
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
prerm)
|
||||
exit 0
|
||||
;;
|
||||
postrm)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user